@elastic/ems-client 8.6.2 → 8.7.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 +2 -4
- package/.buildkite/pipeline.yml +1 -1
- package/.github/workflows/backport.yml +1 -1
- package/.github/workflows/publish.yml +26 -0
- package/.nvmrc +1 -1
- package/CHANGELOG.md +16 -1
- package/CONTRIBUTING.md +4 -6
- package/eslint.config.mjs +2 -4
- package/package.json +35 -31
- package/renovate.json +10 -4
- package/src/ems_client.ts +3 -3
- package/target/node/ems_client.js +6 -4
- package/target/node/file_layer.js +1 -2
- package/target/web/ems_client.js +138 -168
- package/target/web/file_layer.js +23 -25
- package/target/web/tms_service.js +262 -275
- package/test/__snapshots__/ems_client.test.ts.snap +1 -1
- package/tsconfig.json +2 -2
- package/target/origin.d.ts +0 -4
package/.backportrc.json
CHANGED
|
@@ -2,12 +2,10 @@
|
|
|
2
2
|
"repoOwner": "elastic",
|
|
3
3
|
"repoName": "ems-client",
|
|
4
4
|
"targetBranchChoices": [
|
|
5
|
-
"master"
|
|
6
|
-
"7.17"
|
|
5
|
+
"master"
|
|
7
6
|
],
|
|
8
7
|
"branchLabelMapping": {
|
|
9
|
-
"^v8.\\d+.\\d+$": "master"
|
|
10
|
-
"^v7.\\d+.\\d+$": "v7.17"
|
|
8
|
+
"^v8.\\d+.\\d+$": "master"
|
|
11
9
|
},
|
|
12
10
|
"targetPRLabels": ["backport"],
|
|
13
11
|
"commitConflicts": true,
|
package/.buildkite/pipeline.yml
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
agents:
|
|
2
|
-
image: "docker.elastic.co/ci-agent-images/ems/buildkite-agent-
|
|
2
|
+
image: "docker.elastic.co/ci-agent-images/ems/buildkite-agent-node22:1771594567@sha256:88bf3be943d134a6d67615808dfa2f1d1dd2c4ab05b80da3cda54d3562d2618b"
|
|
3
3
|
cpu: "2"
|
|
4
4
|
memory: "2G"
|
|
5
5
|
|
|
@@ -11,7 +11,7 @@ jobs:
|
|
|
11
11
|
runs-on: ubuntu-latest
|
|
12
12
|
steps:
|
|
13
13
|
- name: Backport Action
|
|
14
|
-
uses: sorenlouv/backport-github-action@
|
|
14
|
+
uses: sorenlouv/backport-github-action@9460b7102fea25466026ce806c9ebf873ac48721 # v11.0.0
|
|
15
15
|
with:
|
|
16
16
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
17
17
|
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
name: Publish to npm
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
publish:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
id-token: write
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
|
|
17
|
+
- uses: actions/setup-node@v4
|
|
18
|
+
with:
|
|
19
|
+
node-version: "24"
|
|
20
|
+
registry-url: "https://registry.npmjs.org"
|
|
21
|
+
|
|
22
|
+
- run: yarn install --frozen-lockfile
|
|
23
|
+
|
|
24
|
+
- run: yarn build
|
|
25
|
+
|
|
26
|
+
- run: npm publish --provenance --access public
|
package/.nvmrc
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
lts/
|
|
1
|
+
lts/jod
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,21 @@ 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
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
## [8.7.0] - 2026-04-09
|
|
10
|
+
### Changed
|
|
11
|
+
- Upgraded maplibre-gl from v3 to v5 #650 #693
|
|
12
|
+
- Upgraded lru-cache from v4 to v11 #663
|
|
13
|
+
- Added Node.js 24 support #1012
|
|
14
|
+
- Update dependencies (search PRs for `is:pr label:v8.6.4 label:dependencies `)
|
|
15
|
+
|
|
16
|
+
## [8.6.3] - 2025-01-15
|
|
17
|
+
### Changed
|
|
18
|
+
- Upgrade to Node 22 #552
|
|
19
|
+
- Update dependencies (search PRs for `is:pr label:v8.6.3 label:dependencies `)
|
|
20
|
+
|
|
6
21
|
## [8.6.2] - 2024-12-24
|
|
7
22
|
### Changed
|
|
8
23
|
- Downgraded chroma-js #526
|
|
@@ -17,7 +32,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|
|
17
32
|
|
|
18
33
|
### Changed
|
|
19
34
|
- Dependencies reorganization and validation against Kibana #289
|
|
20
|
-
- Update dependencies (search PRs for `is:pr label:
|
|
35
|
+
- Update dependencies (search PRs for `is:pr label:v8.5.4 label:dependencies`)
|
|
21
36
|
|
|
22
37
|
## [8.5.3] - 2024-07-10
|
|
23
38
|
### Changed
|
package/CONTRIBUTING.md
CHANGED
|
@@ -9,16 +9,14 @@
|
|
|
9
9
|
|
|
10
10
|
If you have access to make releases, the process is as follows:
|
|
11
11
|
|
|
12
|
-
1. Be sure you have checked out the `master`
|
|
12
|
+
1. Be sure you have checked out the `master` branch and have pulled latest changes
|
|
13
13
|
1. Update the version in `package.json` accordingly.
|
|
14
14
|
1. Update the CHANGELOG.md
|
|
15
15
|
1. Commit changes with message "bump to x.y.z" where x.y.z is the version in package.json
|
|
16
|
-
1. Tag the commit with `git tag vx.y.
|
|
16
|
+
1. Tag the commit with `git tag vx.y.z`, for example `git tag v7.2.1`
|
|
17
17
|
1. Push commits and tags upstream with `git push upstream master && git push upstream --tags` (and optionally to your own fork as well)
|
|
18
|
-
1.
|
|
19
|
-
1.
|
|
20
|
-
1. Publish to npm with `npm publish --access public`
|
|
21
|
-
1. If necessary, push the new branch upstream and create/archive Snyk targets
|
|
18
|
+
1. The [publish workflow](.github/workflows/publish.yml) will automatically build and publish to npm via [npm Trusted Publishers](https://docs.npmjs.com/trusted-publishers) when the tag is pushed
|
|
19
|
+
1. Monitor the publish run in the repository's [Actions tab](https://github.com/elastic/ems-client/actions/workflows/publish.yml)
|
|
22
20
|
|
|
23
21
|
## Continuous Integration
|
|
24
22
|
|
package/eslint.config.mjs
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
|
|
3
1
|
import eslint from '@eslint/js';
|
|
4
2
|
import tseslint from 'typescript-eslint';
|
|
5
3
|
import globals from 'globals';
|
|
6
4
|
|
|
7
|
-
export default
|
|
5
|
+
export default [
|
|
8
6
|
eslint.configs.recommended,
|
|
9
7
|
...tseslint.configs.recommended,
|
|
10
8
|
{
|
|
@@ -22,4 +20,4 @@ export default tseslint.config(
|
|
|
22
20
|
}
|
|
23
21
|
}
|
|
24
22
|
},
|
|
25
|
-
|
|
23
|
+
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elastic/ems-client",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.7.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,46 +31,50 @@
|
|
|
31
31
|
},
|
|
32
32
|
"homepage": "https://github.com/elastic/ems-client#readme",
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@types/geojson": "7946.0.
|
|
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.
|
|
38
|
-
"lru-cache": "
|
|
39
|
-
"maplibre-gl": "3.
|
|
40
|
-
"semver": "
|
|
37
|
+
"lodash": "^4.17.23",
|
|
38
|
+
"lru-cache": "11.2.6",
|
|
39
|
+
"maplibre-gl": "5.3.0",
|
|
40
|
+
"semver": "7.7.4",
|
|
41
41
|
"topojson-client": "^3.1.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@babel/cli": "7.
|
|
45
|
-
"@babel/core": "7.
|
|
44
|
+
"@babel/cli": "7.28.6",
|
|
45
|
+
"@babel/core": "7.29.0",
|
|
46
46
|
"@babel/plugin-proposal-class-properties": "7.18.6",
|
|
47
|
-
"@babel/preset-env": "7.
|
|
48
|
-
"@babel/preset-typescript": "7.
|
|
49
|
-
"@eslint/core": "
|
|
50
|
-
"@eslint/js": "
|
|
47
|
+
"@babel/preset-env": "7.29.2",
|
|
48
|
+
"@babel/preset-typescript": "7.28.5",
|
|
49
|
+
"@eslint/core": "1.1.1",
|
|
50
|
+
"@eslint/js": "10.0.1",
|
|
51
51
|
"@types/chroma-js": "2.4.5",
|
|
52
|
-
"@types/
|
|
53
|
-
"@types/
|
|
54
|
-
"@types/
|
|
55
|
-
"@types/
|
|
56
|
-
"@types/
|
|
57
|
-
"@types/semver": "7.5.8",
|
|
52
|
+
"@types/jest": "30.0.0",
|
|
53
|
+
"@types/lodash": "4.17.24",
|
|
54
|
+
"@types/lru-cache": "7.10.10",
|
|
55
|
+
"@types/node": "24.12.0",
|
|
56
|
+
"@types/semver": "7.7.1",
|
|
58
57
|
"@types/topojson-specification": "1.0.5",
|
|
59
|
-
"@typescript-eslint/eslint-plugin": "8.
|
|
60
|
-
"@typescript-eslint/parser": "8.
|
|
61
|
-
"babel-jest": "
|
|
62
|
-
"eslint": "
|
|
63
|
-
"eslint-config-prettier": "
|
|
64
|
-
"eslint-plugin-prettier": "5.
|
|
65
|
-
"globals": "
|
|
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",
|
|
62
|
+
"eslint-config-prettier": "10.1.8",
|
|
63
|
+
"eslint-plugin-prettier": "5.5.5",
|
|
64
|
+
"globals": "17.4.0",
|
|
66
65
|
"husky": "9.1.7",
|
|
67
|
-
"jest": "
|
|
68
|
-
"prettier": "3.
|
|
69
|
-
"ts-jest": "29.
|
|
70
|
-
"typescript": "5.
|
|
71
|
-
"typescript-eslint": "8.
|
|
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"
|
|
71
|
+
},
|
|
72
|
+
"resolutions": {
|
|
73
|
+
"**/glob": "^13.0.0",
|
|
74
|
+
"**/minimatch": "^10.2.4",
|
|
75
|
+
"@babel/helper-compilation-targets/lru-cache": "11.2.6"
|
|
72
76
|
},
|
|
73
77
|
"engines": {
|
|
74
|
-
"node": ">=
|
|
78
|
+
"node": ">=22"
|
|
75
79
|
}
|
|
76
80
|
}
|
package/renovate.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
|
3
|
+
"enabled": true,
|
|
4
|
+
"minimumReleaseAge": "14 days",
|
|
3
5
|
"extends": [
|
|
4
|
-
"
|
|
6
|
+
"github>elastic/renovate-config"
|
|
5
7
|
],
|
|
8
|
+
"baseBranches": ["master"],
|
|
6
9
|
"labels": [
|
|
7
|
-
"dependencies"
|
|
8
|
-
"v7.17.5",
|
|
9
|
-
"v8.6.2"
|
|
10
|
+
"dependencies"
|
|
10
11
|
],
|
|
11
12
|
"packageRules": [
|
|
12
13
|
{
|
|
@@ -16,6 +17,11 @@
|
|
|
16
17
|
{
|
|
17
18
|
"matchDepTypes": ["devDependencies"],
|
|
18
19
|
"automerge": true
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"description": "Master branch specific rules",
|
|
23
|
+
"matchBaseBranches": ["master"],
|
|
24
|
+
"labels": ["dependencies", "v8.6.4"]
|
|
19
25
|
}
|
|
20
26
|
]
|
|
21
27
|
}
|
package/src/ems_client.ts
CHANGED
|
@@ -17,7 +17,7 @@ import semverMinor from 'semver/functions/minor';
|
|
|
17
17
|
import { format as formatUrl, parse as parseUrl, UrlObject } from 'url';
|
|
18
18
|
import { toAbsoluteUrl } from './utils';
|
|
19
19
|
import { ParsedUrlQueryInput } from 'querystring';
|
|
20
|
-
import LRUCache from 'lru-cache';
|
|
20
|
+
import { LRUCache } from 'lru-cache';
|
|
21
21
|
|
|
22
22
|
const REST_API_REGEX = /\d{4}-\d{2}-\d{2}/;
|
|
23
23
|
export const LATEST_API_URL_PATH = 'latest';
|
|
@@ -298,7 +298,7 @@ export class EMSClient {
|
|
|
298
298
|
if (e instanceof Error) {
|
|
299
299
|
throw e;
|
|
300
300
|
} else {
|
|
301
|
-
throw new Error('Unknown error');
|
|
301
|
+
throw new Error('Unknown error', { cause: e });
|
|
302
302
|
}
|
|
303
303
|
}
|
|
304
304
|
}
|
|
@@ -429,7 +429,7 @@ export class EMSClient {
|
|
|
429
429
|
}
|
|
430
430
|
|
|
431
431
|
private _invalidateSettings(): void {
|
|
432
|
-
this._cache.
|
|
432
|
+
this._cache.clear();
|
|
433
433
|
this._getMainCatalog = _.once(async (): Promise<EmsCatalogManifest> => {
|
|
434
434
|
const services = [];
|
|
435
435
|
if (this._tileApiUrl) {
|
|
@@ -13,7 +13,7 @@ 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 _lruCache =
|
|
16
|
+
var _lruCache = require("lru-cache");
|
|
17
17
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
18
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
19
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
@@ -124,7 +124,7 @@ class EMSClient {
|
|
|
124
124
|
this._language = config.language || DEFAULT_LANGUAGE;
|
|
125
125
|
this._fetchFunction = config.fetchFunction;
|
|
126
126
|
this._proxyPath = config.proxyPath || '';
|
|
127
|
-
this._cache = new _lruCache.
|
|
127
|
+
this._cache = new _lruCache.LRUCache({
|
|
128
128
|
max: config.cacheSize || 10
|
|
129
129
|
});
|
|
130
130
|
this._invalidateSettings();
|
|
@@ -163,7 +163,9 @@ class EMSClient {
|
|
|
163
163
|
if (e instanceof Error) {
|
|
164
164
|
throw e;
|
|
165
165
|
} else {
|
|
166
|
-
throw new Error('Unknown error'
|
|
166
|
+
throw new Error('Unknown error', {
|
|
167
|
+
cause: e
|
|
168
|
+
});
|
|
167
169
|
}
|
|
168
170
|
}
|
|
169
171
|
}
|
|
@@ -267,7 +269,7 @@ class EMSClient {
|
|
|
267
269
|
});
|
|
268
270
|
}
|
|
269
271
|
_invalidateSettings() {
|
|
270
|
-
this._cache.
|
|
272
|
+
this._cache.clear();
|
|
271
273
|
this._getMainCatalog = _lodash.default.once(async () => {
|
|
272
274
|
const services = [];
|
|
273
275
|
if (this._tileApiUrl) {
|
|
@@ -7,8 +7,7 @@ exports.FileLayer = exports.EMSFormatType = void 0;
|
|
|
7
7
|
var _url = _interopRequireDefault(require("url"));
|
|
8
8
|
var _ems_service = require("./ems_service");
|
|
9
9
|
var topojson = _interopRequireWildcard(require("topojson-client"));
|
|
10
|
-
function
|
|
11
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
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); }
|
|
12
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
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; }
|
|
14
13
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|