@elastic/ems-client 8.5.1 → 8.5.3

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.
@@ -9,6 +9,9 @@ set -eu
9
9
  echo "--- :yarn: Installing dependencies"
10
10
  yarn install
11
11
 
12
+ echo "--- :gear: Checking dependencies with Kibana"
13
+ node .buildkite/compare_dependencies.js
14
+
12
15
  echo "--- :alembic: Running tests"
13
16
  yarn test
14
17
 
@@ -0,0 +1,67 @@
1
+ /*
2
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3
+ * or more contributor license agreements. Licensed under the Elastic License
4
+ * 2.0; you may not use this file except in compliance with the Elastic License
5
+ * 2.0.
6
+ */
7
+
8
+ /* Script that will check the current package.json dependencies
9
+ against Kibana (using BUILDKITE_BRANCH to determine the branch)
10
+ and exits with a 1 status code if, for any shared dependency,
11
+ EMS Client is behind */
12
+
13
+ const fs = require('node:fs');
14
+ const semver = require('semver');
15
+
16
+ const DEFAULT_BRANCH = 'main';
17
+ const branch = process.env.KIBANA_BRANCH || DEFAULT_BRANCH;
18
+ const kibanaPackageUrl = `https://raw.githubusercontent.com/elastic/kibana/${branch}/package.json`;
19
+
20
+ const processDependency = function (dependency, srcDeps, dstDeps, dstDevDeps) {
21
+ if (!(dependency in dstDeps) && !(dependency in dstDevDeps)) {
22
+ return true;
23
+ }
24
+ const source = srcDeps[dependency].replace('^', '');
25
+ const destination = dstDeps[dependency] || dstDevDeps[dependency];
26
+
27
+ if (semver.satisfies(source, destination)) {
28
+ return true;
29
+ }
30
+
31
+ if ( dependency in dstDevDeps){
32
+ console.log(`⚠ ${dependency}: ${source} vs ${destination}`);
33
+ return true
34
+ }
35
+
36
+ console.log(`🛑 ${dependency}: ${source} vs ${destination}`);
37
+ return false;
38
+ };
39
+
40
+ const main = async function () {
41
+ const kibanaPackage = await fetch(kibanaPackageUrl);
42
+ const kibanaPackageJson = await kibanaPackage.json();
43
+ const kibanaDeps = kibanaPackageJson['dependencies'];
44
+ const kibanaDevDeps = kibanaPackageJson['devDependencies'];
45
+
46
+ const emsClientPackageJson = JSON.parse(fs.readFileSync('package.json'));
47
+ const emsClientDeps = {
48
+ ...emsClientPackageJson['dependencies'],
49
+ ...emsClientPackageJson['devDependencies']
50
+ };
51
+
52
+ console.log(`ems-client@${emsClientPackageJson['version']}`);
53
+ console.log(`kibana@${kibanaPackageJson['version']}`);
54
+
55
+ const results = Object.keys(emsClientDeps).map((dep) =>
56
+ processDependency(dep, emsClientDeps, kibanaDeps, kibanaDevDeps)
57
+ );
58
+
59
+ process.exit(results.every(r => r) ? 0 : 1);
60
+ };
61
+
62
+ main()
63
+ .then(console.log)
64
+ .catch((error) => {
65
+ console.error(error);
66
+ process.exit(1);
67
+ });
@@ -1,8 +1,10 @@
1
1
  agents:
2
- image: "docker.elastic.co/ci-agent-images/ems/buildkite-agent-node20:0.1"
2
+ image: "docker.elastic.co/ci-agent-images/ems/buildkite-agent-node20:0.4"
3
3
  cpu: "2"
4
4
  memory: "2G"
5
5
 
6
6
  steps:
7
7
  - label: ":hammer_and_wrench: Test and build"
8
8
  command: ".buildkite/build.sh"
9
+ env:
10
+ KIBANA_BRANCH: "main"
@@ -0,0 +1 @@
1
+ yarn test
package/CHANGELOG.md CHANGED
@@ -3,6 +3,16 @@ 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
7
+
8
+ ### Changed
9
+ - Update dependencies #242
10
+
11
+ ## [8.5.2] - 2024-07-05
12
+
13
+ ## Changed
14
+ - Update dependencies #232 #233 #234 #235
15
+
6
16
  ## [8.5.1] - 2023-11-09
7
17
 
8
18
  ### Added
@@ -0,0 +1,25 @@
1
+ // @ts-check
2
+
3
+ import eslint from '@eslint/js';
4
+ import tseslint from 'typescript-eslint';
5
+ import globals from 'globals';
6
+
7
+ export default tseslint.config(
8
+ eslint.configs.recommended,
9
+ ...tseslint.configs.recommended,
10
+ {
11
+ ignores: ["target","*.config.js",".buildkite"]
12
+ },
13
+ {
14
+ files: ['**/*.{ts,tsx,mts,cts}'],
15
+ rules: {
16
+ 'no-undef': 'off',
17
+ '@typescript-eslint/ban-types': 'off'
18
+ },
19
+ "languageOptions": {
20
+ "globals": {
21
+ ...globals.node
22
+ }
23
+ }
24
+ },
25
+ );
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "@elastic/ems-client",
3
- "version": "8.5.1",
3
+ "version": "8.5.3",
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",
7
7
  "types": "target/index.d.ts",
8
8
  "scripts": {
9
+ "prepare": "husky",
9
10
  "prelint": "tsc --noEmit",
10
- "lint": "eslint . --ext .ts,.tsx",
11
+ "lint": "prettier --check src/* && eslint .",
11
12
  "pretest": "yarn lint",
12
13
  "test": "jest",
13
14
  "build": "tsc --emitDeclarationOnly && yarn build-web && yarn build-node",
@@ -29,20 +30,14 @@
29
30
  "url": "https://github.com/elastic/ems-client/issues"
30
31
  },
31
32
  "homepage": "https://github.com/elastic/ems-client#readme",
32
- "husky": {
33
- "hooks": {
34
- "pre-commit": "yarn test"
35
- }
36
- },
37
33
  "dependencies": {
38
- "@types/geojson": "^7946.0.10",
39
- "@types/lru-cache": "^5.1.0",
40
- "@types/topojson-client": "^3.1.1",
41
- "@types/topojson-specification": "^1.0.1",
34
+ "@types/geojson": "^7946.0.14",
35
+ "@types/topojson-client": "^3.1.4",
36
+ "@types/topojson-specification": "^1.0.5",
42
37
  "chroma-js": "^2.1.0",
43
- "lodash": "^4.17.15",
44
- "lru-cache": "^6.0.0",
45
- "semver": "7.5.4",
38
+ "lodash": "^4.17.21",
39
+ "lru-cache": "^4.1.5",
40
+ "semver": "^7.6.2",
46
41
  "topojson-client": "^3.1.0"
47
42
  },
48
43
  "devDependencies": {
@@ -51,25 +46,30 @@
51
46
  "@babel/plugin-proposal-class-properties": "^7.5.5",
52
47
  "@babel/preset-env": "^7.5.5",
53
48
  "@babel/preset-typescript": "^7.9.0",
49
+ "@eslint/js": "^9.3.0",
54
50
  "@types/chroma-js": "^2.1.3",
55
- "@types/jest": "^26.0.10",
51
+ "@types/eslint__js": "^8.42.3",
52
+ "@types/jest": "^29.5.12",
56
53
  "@types/lodash": "^4.14.150",
57
- "@types/node": "^13.13.5",
54
+ "@types/lru-cache": "^5.1.0",
55
+ "@types/node": "^20.12.13",
58
56
  "@types/node-fetch": "^2.5.7",
59
57
  "@types/semver": "^7.1.0",
60
- "@typescript-eslint/eslint-plugin": "^2.33.0",
61
- "@typescript-eslint/parser": "^2.33.0",
62
- "babel-jest": "^26.3.0",
63
- "eslint": "^7.0.0",
64
- "eslint-config-prettier": "^6.11.0",
65
- "eslint-plugin-prettier": "^3.1.3",
66
- "husky": "^4.2.5",
67
- "jest": "^26.4.0",
68
- "maplibre-gl": "2.1.9",
69
- "node-fetch": "^2.6.1",
70
- "prettier": "^2.0.5",
71
- "ts-jest": "^26.2.0",
72
- "typescript": "4.6.3"
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"
73
73
  },
74
74
  "engines": {
75
75
  "node": ">=18 <=20"
package/src/ems_client.ts CHANGED
@@ -290,7 +290,11 @@ export class EMSClient {
290
290
  if (!response.ok) {
291
291
  throw new Error(response.statusText);
292
292
  }
293
- return response ? await response.json() : null;
293
+ if (response) {
294
+ return (await response.json()) as Promise<T>;
295
+ } else {
296
+ throw new Error('Response not found');
297
+ }
294
298
  } catch (e) {
295
299
  if (e instanceof Error) {
296
300
  throw e;
@@ -307,7 +311,7 @@ export class EMSClient {
307
311
  */
308
312
  addQueryParams(additionalQueryParams: { [key: string]: string }): void {
309
313
  for (const key in additionalQueryParams) {
310
- if (additionalQueryParams.hasOwnProperty(key)) {
314
+ if (Object.prototype.hasOwnProperty.call(additionalQueryParams, key)) {
311
315
  if (additionalQueryParams[key] !== this._queryParams[key]) {
312
316
  //changes detected.
313
317
  this._queryParams = _.assign({}, this._queryParams, additionalQueryParams);
@@ -169,9 +169,8 @@ export class TMSService extends AbstractEmsService {
169
169
  if (url) {
170
170
  const sourceUrl = this._proxyPath + this._getAbsoluteUrl(url);
171
171
  const extendedUrl = this._emsClient.extendUrlWithParams(sourceUrl);
172
- const sourceJson = await this._emsClient.getManifest<VectorSourceSpecification>(
173
- extendedUrl
174
- );
172
+ const sourceJson =
173
+ await this._emsClient.getManifest<VectorSourceSpecification>(extendedUrl);
175
174
  const tiles = sourceJson?.tiles?.map((tileUrl) => {
176
175
  const directUrl = this._proxyPath + this._getAbsoluteUrl(tileUrl);
177
176
  return this._emsClient.extendUrlWithParams(directUrl);
@@ -374,16 +373,20 @@ export class TMSService extends AbstractEmsService {
374
373
 
375
374
  async getMinZoom(format = 'vector'): Promise<number | undefined> {
376
375
  switch (format) {
377
- case 'vector':
376
+ case 'vector': {
378
377
  const { sources } = (await this._getVectorStyleJsonInlined()) || { sources: {} };
379
378
  return Math.min(
380
379
  ...Object.values(sources)
381
- .map(({ minzoom }) => minzoom)
380
+ .map((s) => {
381
+ return s && s instanceof Object && 'minzoom' in s ? s['minzoom'] : null;
382
+ })
382
383
  .filter((minzoom): minzoom is number => Number.isFinite(minzoom))
383
384
  );
384
- case 'raster':
385
+ }
386
+ case 'raster': {
385
387
  const { minzoom } = (await this._getRasterStyleJson()) || {};
386
388
  return minzoom;
389
+ }
387
390
  default:
388
391
  return;
389
392
  }
@@ -391,16 +394,20 @@ export class TMSService extends AbstractEmsService {
391
394
 
392
395
  async getMaxZoom(format = 'vector'): Promise<number | undefined> {
393
396
  switch (format) {
394
- case 'vector':
397
+ case 'vector': {
395
398
  const { sources } = (await this._getVectorStyleJsonInlined()) || { sources: {} };
396
399
  return Math.max(
397
400
  ...Object.values(sources)
398
- .map(({ maxzoom }) => maxzoom)
401
+ .map((s) => {
402
+ return s && s instanceof Object && 'maxzoom' in s ? s['maxzoom'] : null;
403
+ })
399
404
  .filter((maxzoom): maxzoom is number => Number.isFinite(maxzoom))
400
405
  );
401
- case 'raster':
406
+ }
407
+ case 'raster': {
402
408
  const { maxzoom } = (await this._getRasterStyleJson()) || {};
403
409
  return maxzoom;
410
+ }
404
411
  default:
405
412
  return;
406
413
  }
@@ -425,13 +432,12 @@ export class TMSService extends AbstractEmsService {
425
432
  vectorFormats = this._getFormats(formatType, this._emsClient.getDefaultLocale());
426
433
  }
427
434
  if (!vectorFormats.length) {
428
- // eslint-disable-next-line max-len
429
435
  throw new Error(
430
436
  `Cannot find ${formatType} tile layer for locale ${this._emsClient.getLocale()} or ${this._emsClient.getDefaultLocale()}`
431
437
  );
432
438
  }
433
439
  const defaultStyle = vectorFormats[0];
434
- if (defaultStyle && defaultStyle.hasOwnProperty('url')) {
440
+ if (defaultStyle && Object.prototype.hasOwnProperty.call(defaultStyle, 'url')) {
435
441
  return defaultStyle.url;
436
442
  }
437
443
  }
@@ -445,7 +451,7 @@ export class TMSService extends AbstractEmsService {
445
451
  private async _getSpriteSheetRootPath(): Promise<string> {
446
452
  const vectorStyleJson = await this._getVectorStyleJsonRaw();
447
453
  if (vectorStyleJson?.sprite) {
448
- return this._proxyPath + this._getAbsoluteUrl(vectorStyleJson.sprite);
454
+ return this._proxyPath + this._getAbsoluteUrl(vectorStyleJson.sprite.toString());
449
455
  } else {
450
456
  return '';
451
457
  }
@@ -2,10 +2,10 @@ import { TMSService } from './tms_service';
2
2
  import { EMSFormatType, FileLayer } from './file_layer';
3
3
  import { FeatureCollection } from 'geojson';
4
4
  export declare const LATEST_API_URL_PATH = "latest";
5
- declare type LocalizedStrings = {
5
+ type LocalizedStrings = {
6
6
  [key: string]: string;
7
7
  };
8
- declare type BaseClientConfig = {
8
+ type BaseClientConfig = {
9
9
  appName?: string;
10
10
  manifestServiceUrl?: string;
11
11
  tileApiUrl: string;
@@ -18,35 +18,35 @@ declare type BaseClientConfig = {
18
18
  proxyPath?: string;
19
19
  cacheSize?: number;
20
20
  };
21
- declare type DeprecatedClientConfig = BaseClientConfig & {
21
+ type DeprecatedClientConfig = BaseClientConfig & {
22
22
  kbnVersion: string;
23
23
  };
24
- declare type ClientConfig = BaseClientConfig & {
24
+ type ClientConfig = BaseClientConfig & {
25
25
  appVersion: string;
26
26
  };
27
- declare type EmsCatalogService = {
27
+ type EmsCatalogService = {
28
28
  id?: string;
29
29
  name?: string;
30
30
  manifest: string;
31
31
  type: string;
32
32
  };
33
- declare type EmsCatalogManifest = {
33
+ type EmsCatalogManifest = {
34
34
  version?: string;
35
35
  services: EmsCatalogService[];
36
36
  };
37
- declare type EmsTmsCatalog = {
37
+ type EmsTmsCatalog = {
38
38
  version?: string;
39
39
  services: TMSServiceConfig[];
40
40
  };
41
- export declare type EmsTmsFormat = {
41
+ export type EmsTmsFormat = {
42
42
  locale: string;
43
43
  format: string;
44
44
  url: string;
45
45
  };
46
- export declare type BaseEmsServiceConfig = {
46
+ export type BaseEmsServiceConfig = {
47
47
  attribution: EmsLayerAttribution[];
48
48
  };
49
- export declare type FileLayerConfig = BaseEmsServiceConfig & {
49
+ export type FileLayerConfig = BaseEmsServiceConfig & {
50
50
  layer_id: string;
51
51
  created_at: string;
52
52
  formats: (EmsFileLayerFormatGeoJson | EmsFileLayerFormatTopoJson)[];
@@ -54,7 +54,7 @@ export declare type FileLayerConfig = BaseEmsServiceConfig & {
54
54
  legacy_ids: string[];
55
55
  layer_name: LocalizedStrings;
56
56
  };
57
- export declare type FileLayerField = {
57
+ export type FileLayerField = {
58
58
  type: string;
59
59
  id: string;
60
60
  label: LocalizedStrings;
@@ -62,27 +62,27 @@ export declare type FileLayerField = {
62
62
  regex?: string;
63
63
  alias?: string[];
64
64
  };
65
- export declare type TMSServiceConfig = BaseEmsServiceConfig & {
65
+ export type TMSServiceConfig = BaseEmsServiceConfig & {
66
66
  id: string;
67
67
  name: {
68
68
  en: string;
69
69
  };
70
70
  formats: EmsTmsFormat[];
71
71
  };
72
- declare type EmsFileCatalog = {
72
+ type EmsFileCatalog = {
73
73
  version?: string;
74
74
  layers: FileLayerConfig[];
75
75
  };
76
- export declare type EmsLayerAttribution = {
76
+ export type EmsLayerAttribution = {
77
77
  label: LocalizedStrings;
78
78
  url: LocalizedStrings;
79
79
  };
80
- export declare type EmsFileLayerFormatGeoJson = {
80
+ export type EmsFileLayerFormatGeoJson = {
81
81
  type: EMSFormatType.geojson;
82
82
  url: string;
83
83
  legacy_default: boolean;
84
84
  };
85
- export declare type EmsFileLayerFormatTopoJson = {
85
+ export type EmsFileLayerFormatTopoJson = {
86
86
  type: EMSFormatType.topojson;
87
87
  url: string;
88
88
  legacy_default: boolean;
@@ -5,7 +5,7 @@ export declare enum EMSFormatType {
5
5
  geojson = "geojson",
6
6
  topojson = "topojson"
7
7
  }
8
- export declare type EMSFormatTypeStrings = keyof typeof EMSFormatType;
8
+ export type EMSFormatTypeStrings = keyof typeof EMSFormatType;
9
9
  export declare class FileLayer extends AbstractEmsService {
10
10
  protected readonly _config: FileLayerConfig;
11
11
  constructor(config: FileLayerConfig, emsClient: EMSClient, proxyPath: string);
@@ -14,15 +14,15 @@ var _minor = _interopRequireDefault(require("semver/functions/minor"));
14
14
  var _url = require("url");
15
15
  var _utils = require("./utils");
16
16
  var _lruCache = _interopRequireDefault(require("lru-cache"));
17
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
19
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
20
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } /*
21
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
22
- * or more contributor license agreements. Licensed under the Elastic License
23
- * 2.0; you may not use this file except in compliance with the Elastic License
24
- * 2.0.
25
- */
17
+ 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); } /*
21
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
22
+ * or more contributor license agreements. Licensed under the Elastic License
23
+ * 2.0; you may not use this file except in compliance with the Elastic License
24
+ * 2.0.
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
  /**
@@ -154,7 +154,11 @@ class EMSClient {
154
154
  if (!response.ok) {
155
155
  throw new Error(response.statusText);
156
156
  }
157
- return response ? await response.json() : null;
157
+ if (response) {
158
+ return await response.json();
159
+ } else {
160
+ throw new Error('Response not found');
161
+ }
158
162
  } catch (e) {
159
163
  if (e instanceof Error) {
160
164
  throw e;
@@ -171,7 +175,7 @@ class EMSClient {
171
175
  */
172
176
  addQueryParams(additionalQueryParams) {
173
177
  for (const key in additionalQueryParams) {
174
- if (additionalQueryParams.hasOwnProperty(key)) {
178
+ if (Object.prototype.hasOwnProperty.call(additionalQueryParams, key)) {
175
179
  if (additionalQueryParams[key] !== this._queryParams[key]) {
176
180
  //changes detected.
177
181
  this._queryParams = _lodash.default.assign({}, this._queryParams, additionalQueryParams);
@@ -5,14 +5,14 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.AbstractEmsService = void 0;
7
7
  var _utils = require("./utils");
8
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
9
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
10
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } /*
11
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
12
- * or more contributor license agreements. Licensed under the Elastic License
13
- * 2.0; you may not use this file except in compliance with the Elastic License
14
- * 2.0.
15
- */
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); } /*
11
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
12
+ * or more contributor license agreements. Licensed under the Elastic License
13
+ * 2.0; you may not use this file except in compliance with the Elastic License
14
+ * 2.0.
15
+ */
16
16
  class AbstractEmsService {
17
17
  constructor(config, emsClient, proxyPath) {
18
18
  _defineProperty(this, "_emsClient", void 0);
@@ -8,16 +8,16 @@ var _url = _interopRequireDefault(require("url"));
8
8
  var _ems_service = require("./ems_service");
9
9
  var topojson = _interopRequireWildcard(require("topojson-client"));
10
10
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
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 && Object.prototype.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; }
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
14
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
15
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } /*
16
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
17
- * or more contributor license agreements. Licensed under the Elastic License
18
- * 2.0; you may not use this file except in compliance with the Elastic License
19
- * 2.0.
20
- */
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; }
12
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
+ 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
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
15
+ 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); } /*
16
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
17
+ * or more contributor license agreements. Licensed under the Elastic License
18
+ * 2.0; you may not use this file except in compliance with the Elastic License
19
+ * 2.0.
20
+ */
21
21
  let EMSFormatType = exports.EMSFormatType = /*#__PURE__*/function (EMSFormatType) {
22
22
  EMSFormatType["geojson"] = "geojson";
23
23
  EMSFormatType["topojson"] = "topojson";