@elastic/ems-client 8.7.0 → 8.8.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.
@@ -17,10 +17,25 @@ const DEFAULT_BRANCH = 'main';
17
17
  const branch = process.env.KIBANA_BRANCH || DEFAULT_BRANCH;
18
18
  const kibanaPackageUrl = `https://raw.githubusercontent.com/elastic/kibana/${branch}/package.json`;
19
19
 
20
+ // Dependencies that are allowed to be ahead of Kibana, with the reason.
21
+ // Remove an entry once Kibana catches up.
22
+ const IGNORED_DEPENDENCIES = {
23
+ 'maplibre-gl':
24
+ 'Kibana upgrades to 6.4.1 in https://github.com/elastic/kibana/pull/301722 and overrides the ems-client version meanwhile',
25
+ };
26
+
20
27
  const processDependency = function (dependency, srcDeps, dstDeps, dstDevDeps) {
21
28
  if (!(dependency in dstDeps) && !(dependency in dstDevDeps)) {
22
29
  return true;
23
30
  }
31
+
32
+ if (dependency in IGNORED_DEPENDENCIES) {
33
+ const destination = dstDeps[dependency] || dstDevDeps[dependency];
34
+ console.log(
35
+ `⏭ ${dependency}: ${srcDeps[dependency]} vs ${destination} (ignored: ${IGNORED_DEPENDENCIES[dependency]})`
36
+ );
37
+ return true;
38
+ }
24
39
  const source = srcDeps[dependency].replace('^', '');
25
40
  const destination = dstDeps[dependency] || dstDevDeps[dependency];
26
41
 
@@ -1,5 +1,5 @@
1
1
  agents:
2
- image: "docker.elastic.co/ci-agent-images/ems/buildkite-agent-node22:1771594567@sha256:88bf3be943d134a6d67615808dfa2f1d1dd2c4ab05b80da3cda54d3562d2618b"
2
+ image: "docker.elastic.co/ci-agent-images/ems/buildkite-agent-node24:1783438567@sha256:24f8a6deec508b11e4e0748df2af4439f888d9d616eabd3beb0891b9184c8edf"
3
3
  cpu: "2"
4
4
  memory: "2G"
5
5
 
@@ -11,9 +11,9 @@ jobs:
11
11
  runs-on: ubuntu-latest
12
12
  steps:
13
13
  - name: Backport Action
14
- uses: sorenlouv/backport-github-action@9460b7102fea25466026ce806c9ebf873ac48721 # v11.0.0
14
+ uses: sorenlouv/backport-github-action@8a6c0381851f43f9f1fddc7303f0e9015eb57b62 # v12.0.4
15
15
  with:
16
- github_token: ${{ secrets.GITHUB_TOKEN }}
16
+ github_token: ${{ secrets.BACKPORT_TOKEN }}
17
17
 
18
18
  - name: Info log
19
19
  if: ${{ success() }}
@@ -11,10 +11,14 @@ jobs:
11
11
  permissions:
12
12
  contents: read
13
13
  id-token: write
14
+ env:
15
+ # setup-node v7 no longer exports a placeholder token (v6 did), and every yarn
16
+ # command fails on ${NODE_AUTH_TOKEN} in the generated .npmrc. Publishing uses OIDC.
17
+ NODE_AUTH_TOKEN: XXXXX-XXXXX-XXXXX-XXXXX
14
18
  steps:
15
- - uses: actions/checkout@v4
19
+ - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
16
20
 
17
- - uses: actions/setup-node@v4
21
+ - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
18
22
  with:
19
23
  node-version: "24"
20
24
  registry-url: "https://registry.npmjs.org"
package/.nvmrc CHANGED
@@ -1 +1 @@
1
- lts/jod
1
+ 24
package/CHANGELOG.md CHANGED
@@ -3,7 +3,11 @@ 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.7.1] - TBD
6
+ ## [8.8.0] - 2026-10-29
7
+ ### Changed
8
+ - Upgraded maplibre-gl from v5 to v6.4.1, the version Kibana upgrades to in elastic/kibana#301722 #1243
9
+ - Require Node.js 24 (`engines.node` is now `>=24`) #1236
10
+ - Ignore maplibre-gl in the Kibana dependencies check and hold it at 6.4.1 in Renovate until Kibana moves on #1243
7
11
 
8
12
 
9
13
  ## [8.7.0] - 2026-04-09
package/babel.config.js CHANGED
@@ -5,9 +5,7 @@ module.exports = {
5
5
  [
6
6
  '@babel/preset-env',
7
7
  {
8
- useBuiltIns: 'entry',
9
8
  modules: false,
10
- corejs: 3,
11
9
  },
12
10
  ],
13
11
  ],
@@ -20,6 +18,7 @@ module.exports = {
20
18
  targets: {
21
19
  node: 'current',
22
20
  },
21
+ modules: 'commonjs',
23
22
  },
24
23
  ],
25
24
  ],
@@ -32,11 +31,11 @@ module.exports = {
32
31
  targets: {
33
32
  node: 'current',
34
33
  },
34
+ modules: 'commonjs',
35
35
  },
36
36
  ],
37
37
  ],
38
38
  },
39
39
  },
40
40
  presets: ['@babel/preset-typescript'],
41
- plugins: ['@babel/plugin-proposal-class-properties'],
42
41
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elastic/ems-client",
3
- "version": "8.7.0",
3
+ "version": "8.8.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",
@@ -34,47 +34,46 @@
34
34
  "@types/geojson": "7946.0.16",
35
35
  "@types/topojson-client": "3.1.5",
36
36
  "chroma-js": "2.4.2",
37
- "lodash": "^4.17.23",
38
- "lru-cache": "11.2.6",
39
- "maplibre-gl": "5.3.0",
40
- "semver": "7.7.4",
37
+ "lodash": "^4.18.1",
38
+ "lru-cache": "11.5.3",
39
+ "maplibre-gl": "6.4.1",
40
+ "semver": "7.8.5",
41
41
  "topojson-client": "^3.1.0"
42
42
  },
43
43
  "devDependencies": {
44
- "@babel/cli": "7.28.6",
45
- "@babel/core": "7.29.0",
46
- "@babel/plugin-proposal-class-properties": "7.18.6",
47
- "@babel/preset-env": "7.29.2",
48
- "@babel/preset-typescript": "7.28.5",
49
- "@eslint/core": "1.1.1",
44
+ "@babel/cli": "8.0.6",
45
+ "@babel/core": "8.0.7",
46
+ "@babel/preset-env": "8.0.7",
47
+ "@babel/preset-typescript": "8.0.7",
48
+ "@eslint/core": "1.2.1",
50
49
  "@eslint/js": "10.0.1",
51
50
  "@types/chroma-js": "2.4.5",
52
51
  "@types/jest": "30.0.0",
53
- "@types/lodash": "4.17.24",
52
+ "@types/lodash": "4.17.27",
54
53
  "@types/lru-cache": "7.10.10",
55
- "@types/node": "24.12.0",
56
- "@types/semver": "7.7.1",
54
+ "@types/node": "24.19.2",
55
+ "@types/semver": "7.8.0",
57
56
  "@types/topojson-specification": "1.0.5",
58
- "@typescript-eslint/eslint-plugin": "8.57.2",
59
- "@typescript-eslint/parser": "8.57.2",
60
- "babel-jest": "30.3.0",
61
- "eslint": "10.1.0",
57
+ "@typescript-eslint/eslint-plugin": "8.72.0",
58
+ "@typescript-eslint/parser": "8.72.0",
59
+ "babel-jest": "30.5.2",
60
+ "eslint": "10.13.0",
62
61
  "eslint-config-prettier": "10.1.8",
63
- "eslint-plugin-prettier": "5.5.5",
64
- "globals": "17.4.0",
62
+ "eslint-plugin-prettier": "5.5.7",
63
+ "globals": "17.13.0",
65
64
  "husky": "9.1.7",
66
- "jest": "30.3.0",
67
- "prettier": "3.8.1",
68
- "ts-jest": "29.4.6",
69
- "typescript": "5.9.3",
70
- "typescript-eslint": "8.57.2"
65
+ "jest": "30.5.2",
66
+ "prettier": "3.9.10",
67
+ "ts-jest": "29.4.15",
68
+ "typescript": "6.0.3",
69
+ "typescript-eslint": "8.72.0"
71
70
  },
72
71
  "resolutions": {
73
- "**/glob": "^13.0.0",
74
- "**/minimatch": "^10.2.4",
75
- "@babel/helper-compilation-targets/lru-cache": "11.2.6"
72
+ "**/glob": "^13.0.6",
73
+ "**/minimatch": "^10.2.5",
74
+ "**/protocol-buffers-schema": "^3.6.1"
76
75
  },
77
76
  "engines": {
78
- "node": ">=22"
77
+ "node": ">=24"
79
78
  }
80
79
  }
package/renovate.json CHANGED
@@ -2,13 +2,9 @@
2
2
  "$schema": "https://docs.renovatebot.com/renovate-schema.json",
3
3
  "enabled": true,
4
4
  "minimumReleaseAge": "14 days",
5
- "extends": [
6
- "github>elastic/renovate-config"
7
- ],
8
- "baseBranches": ["master"],
9
- "labels": [
10
- "dependencies"
11
- ],
5
+ "extends": ["github>elastic/renovate-config"],
6
+ "baseBranchPatterns": ["master"],
7
+ "labels": ["dependencies"],
12
8
  "packageRules": [
13
9
  {
14
10
  "matchUpdateTypes": ["minor", "patch"],
@@ -18,10 +14,15 @@
18
14
  "matchDepTypes": ["devDependencies"],
19
15
  "automerge": true
20
16
  },
17
+ {
18
+ "description": "Hold maplibre-gl at the version Kibana uses (elastic/kibana#301722). Remove once Kibana moves on.",
19
+ "matchPackageNames": ["maplibre-gl"],
20
+ "allowedVersions": "6.4.1"
21
+ },
21
22
  {
22
23
  "description": "Master branch specific rules",
23
24
  "matchBaseBranches": ["master"],
24
- "labels": ["dependencies", "v8.6.4"]
25
+ "labels": ["dependencies", "v8.8.0"]
25
26
  }
26
27
  ]
27
28
  }
package/src/ems_client.ts CHANGED
@@ -7,7 +7,7 @@
7
7
  import _ from 'lodash';
8
8
  import { TMSService } from './tms_service';
9
9
  import { EMSFormatType, FileLayer } from './file_layer';
10
- import { FeatureCollection } from 'geojson';
10
+ import type { FeatureCollection } from 'geojson';
11
11
 
12
12
  import semverCoerce from 'semver/functions/coerce';
13
13
  import semverValid from 'semver/functions/valid';
package/src/file_layer.ts CHANGED
@@ -14,7 +14,7 @@ import {
14
14
  FileLayerField,
15
15
  } from './ems_client';
16
16
  import { AbstractEmsService } from './ems_service';
17
- import { FeatureCollection } from 'geojson';
17
+ import type { FeatureCollection } from 'geojson';
18
18
  import * as topojson from 'topojson-client';
19
19
 
20
20
  export enum EMSFormatType {
@@ -1,6 +1,6 @@
1
1
  import { TMSService } from './tms_service';
2
2
  import { EMSFormatType, FileLayer } from './file_layer';
3
- import { FeatureCollection } from 'geojson';
3
+ import type { FeatureCollection } from 'geojson';
4
4
  export declare const LATEST_API_URL_PATH = "latest";
5
5
  type LocalizedStrings = {
6
6
  [key: string]: string;
@@ -1,6 +1,6 @@
1
1
  import { EMSClient, FileLayerConfig, FileLayerField } from './ems_client';
2
2
  import { AbstractEmsService } from './ems_service';
3
- import { FeatureCollection } from 'geojson';
3
+ import type { FeatureCollection } from 'geojson';
4
4
  export declare enum EMSFormatType {
5
5
  geojson = "geojson",
6
6
  topojson = "topojson"
@@ -13,16 +13,16 @@ var _major = _interopRequireDefault(require("semver/functions/major"));
13
13
  var _minor = _interopRequireDefault(require("semver/functions/minor"));
14
14
  var _url = require("url");
15
15
  var _utils = require("./utils");
16
+ var _querystring = require("querystring");
16
17
  var _lruCache = require("lru-cache");
17
18
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
18
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
19
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
20
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /*
19
+ /*
21
20
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
22
21
  * or more contributor license agreements. Licensed under the Elastic License
23
22
  * 2.0; you may not use this file except in compliance with the Elastic License
24
23
  * 2.0.
25
24
  */
25
+
26
26
  const REST_API_REGEX = /\d{4}-\d{2}-\d{2}/;
27
27
  const LATEST_API_URL_PATH = exports.LATEST_API_URL_PATH = 'latest';
28
28
  /**
@@ -81,28 +81,29 @@ const unescapeTemplateVars = url => {
81
81
  //this is not the default locale from Kibana, but the default locale supported by the Elastic Maps Service
82
82
  const DEFAULT_LANGUAGE = 'en';
83
83
  class EMSClient {
84
+ EMS_LOAD_TIMEOUT = 32000;
85
+ _queryParams;
86
+ _appVersion;
87
+ _fetchFunction;
88
+ _sanitizer;
89
+ _fileApiUrl;
90
+ _tileApiUrl;
91
+ _emsVersion;
92
+ _emsLandingPageUrl;
93
+ _language;
94
+ _proxyPath;
95
+ _cache;
96
+ _isRestApi = false;
97
+
98
+ /**
99
+ * these methods are assigned outside the constructor
100
+ */
101
+ _getMainCatalog;
102
+ _getDefaultTMSCatalog;
103
+ _getDefaultFileCatalog;
104
+ _loadTMSServices;
105
+ _loadFileLayers;
84
106
  constructor(config) {
85
- _defineProperty(this, "EMS_LOAD_TIMEOUT", 32000);
86
- _defineProperty(this, "_queryParams", void 0);
87
- _defineProperty(this, "_appVersion", void 0);
88
- _defineProperty(this, "_fetchFunction", void 0);
89
- _defineProperty(this, "_sanitizer", void 0);
90
- _defineProperty(this, "_fileApiUrl", void 0);
91
- _defineProperty(this, "_tileApiUrl", void 0);
92
- _defineProperty(this, "_emsVersion", void 0);
93
- _defineProperty(this, "_emsLandingPageUrl", void 0);
94
- _defineProperty(this, "_language", void 0);
95
- _defineProperty(this, "_proxyPath", void 0);
96
- _defineProperty(this, "_cache", void 0);
97
- _defineProperty(this, "_isRestApi", false);
98
- /**
99
- * these methods are assigned outside the constructor
100
- */
101
- _defineProperty(this, "_getMainCatalog", void 0);
102
- _defineProperty(this, "_getDefaultTMSCatalog", void 0);
103
- _defineProperty(this, "_getDefaultFileCatalog", void 0);
104
- _defineProperty(this, "_loadTMSServices", void 0);
105
- _defineProperty(this, "_loadFileLayers", void 0);
106
107
  // Remove kbnVersion in 8.0
107
108
  if ('kbnVersion' in config) {
108
109
  console.warn('The "kbnVersion" parameter for ems-client is deprecated. Please use "appVersion" instead.');
@@ -4,30 +4,20 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.AbstractEmsService = void 0;
7
+ var _ems_client = require("./ems_client");
7
8
  var _utils = require("./utils");
8
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
9
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
10
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /*
9
+ /*
11
10
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
12
11
  * or more contributor license agreements. Licensed under the Elastic License
13
12
  * 2.0; you may not use this file except in compliance with the Elastic License
14
13
  * 2.0.
15
14
  */
15
+
16
16
  class AbstractEmsService {
17
+ _emsClient;
18
+ _config;
19
+ _proxyPath;
17
20
  constructor(config, emsClient, proxyPath) {
18
- _defineProperty(this, "_emsClient", void 0);
19
- _defineProperty(this, "_config", void 0);
20
- _defineProperty(this, "_proxyPath", void 0);
21
- /**
22
- * Checks if url is absolute. If not, prepend the basePath.
23
- */
24
- _defineProperty(this, "_getAbsoluteUrl", url => {
25
- if (/^https?:\/\//.test(url)) {
26
- return url;
27
- } else {
28
- return (0, _utils.toAbsoluteUrl)(this.getApiUrl(), url);
29
- }
30
- });
31
21
  this._config = config;
32
22
  this._emsClient = emsClient;
33
23
  this._proxyPath = proxyPath;
@@ -50,5 +40,16 @@ class AbstractEmsService {
50
40
  });
51
41
  return attributions.join('|');
52
42
  }
43
+
44
+ /**
45
+ * Checks if url is absolute. If not, prepend the basePath.
46
+ */
47
+ _getAbsoluteUrl = url => {
48
+ if (/^https?:\/\//.test(url)) {
49
+ return url;
50
+ } else {
51
+ return (0, _utils.toAbsoluteUrl)(this.getApiUrl(), url);
52
+ }
53
+ };
53
54
  }
54
55
  exports.AbstractEmsService = AbstractEmsService;
@@ -5,13 +5,13 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.FileLayer = exports.EMSFormatType = void 0;
7
7
  var _url = _interopRequireDefault(require("url"));
8
+ var _ems_client = require("./ems_client");
8
9
  var _ems_service = require("./ems_service");
9
10
  var topojson = _interopRequireWildcard(require("topojson-client"));
10
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
11
+ var cache;
12
+ function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var r, c, a = Object.defineProperty, n = { __proto__: null, default: e }; if (Object(e) !== e) return n; if (cache || "function" != typeof WeakMap || (cache = new WeakMap()), cache) { if (cache.has(e)) return cache.get(e); cache.set(e, n); } for (c in e) "default" !== c && {}.hasOwnProperty.call(e, c) && ((r = a && Object.getOwnPropertyDescriptor(e, c)) && (r.get || r.set) ? a(n, c, r) : n[c] = e[c]); return n; }
11
13
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
13
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
14
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /*
14
+ /*
15
15
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
16
16
  * or more contributor license agreements. Licensed under the Elastic License
17
17
  * 2.0; you may not use this file except in compliance with the Elastic License
@@ -23,9 +23,9 @@ let EMSFormatType = exports.EMSFormatType = /*#__PURE__*/function (EMSFormatType
23
23
  return EMSFormatType;
24
24
  }({});
25
25
  class FileLayer extends _ems_service.AbstractEmsService {
26
+ _config;
26
27
  constructor(config, emsClient, proxyPath) {
27
28
  super(config, emsClient, proxyPath);
28
- _defineProperty(this, "_config", void 0);
29
29
  this._config = config;
30
30
  }
31
31
  async getGeoJson() {