@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.
@@ -1,5 +1,6 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
2
+ function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
3
+ function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
3
4
  function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
4
5
  function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
5
6
  function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
@@ -23,7 +24,7 @@ import semverMajor from 'semver/functions/major';
23
24
  import semverMinor from 'semver/functions/minor';
24
25
  import { format as formatUrl, parse as parseUrl } from 'url';
25
26
  import { toAbsoluteUrl } from './utils';
26
- import LRUCache from 'lru-cache';
27
+ import { LRUCache } from 'lru-cache';
27
28
  var REST_API_REGEX = /\d{4}-\d{2}-\d{2}/;
28
29
  export var LATEST_API_URL_PATH = 'latest';
29
30
  /**
@@ -164,53 +165,54 @@ export var EMSClient = /*#__PURE__*/function () {
164
165
  }, {
165
166
  key: "getManifest",
166
167
  value: (function () {
167
- var _getManifest = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(endpointUrl) {
168
- var url, response;
169
- return _regeneratorRuntime().wrap(function _callee$(_context) {
170
- while (1) switch (_context.prev = _context.next) {
168
+ var _getManifest = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(endpointUrl) {
169
+ var url, response, _t;
170
+ return _regenerator().w(function (_context) {
171
+ while (1) switch (_context.p = _context.n) {
171
172
  case 0:
172
- _context.prev = 0;
173
+ _context.p = 0;
173
174
  url = extendUrl(endpointUrl, {
174
175
  query: this._queryParams
175
176
  });
176
- _context.next = 4;
177
+ _context.n = 1;
177
178
  return this._fetchWithTimeout(url);
178
- case 4:
179
- response = _context.sent;
179
+ case 1:
180
+ response = _context.v;
180
181
  if (response.ok) {
181
- _context.next = 7;
182
+ _context.n = 2;
182
183
  break;
183
184
  }
184
185
  throw new Error(response.statusText);
185
- case 7:
186
+ case 2:
186
187
  if (!response) {
187
- _context.next = 13;
188
+ _context.n = 4;
188
189
  break;
189
190
  }
190
- _context.next = 10;
191
+ _context.n = 3;
191
192
  return response.json();
192
- case 10:
193
- return _context.abrupt("return", _context.sent);
194
- case 13:
193
+ case 3:
194
+ return _context.a(2, _context.v);
195
+ case 4:
195
196
  throw new Error('Response not found');
196
- case 14:
197
- _context.next = 23;
197
+ case 5:
198
+ _context.n = 8;
198
199
  break;
199
- case 16:
200
- _context.prev = 16;
201
- _context.t0 = _context["catch"](0);
202
- if (!(_context.t0 instanceof Error)) {
203
- _context.next = 22;
200
+ case 6:
201
+ _context.p = 6;
202
+ _t = _context.v;
203
+ if (!(_t instanceof Error)) {
204
+ _context.n = 7;
204
205
  break;
205
206
  }
206
- throw _context.t0;
207
- case 22:
208
- throw new Error('Unknown error');
209
- case 23:
210
- case "end":
211
- return _context.stop();
207
+ throw _t;
208
+ case 7:
209
+ throw new Error('Unknown error', {
210
+ cause: _t
211
+ });
212
+ case 8:
213
+ return _context.a(2);
212
214
  }
213
- }, _callee, this, [[0, 16]]);
215
+ }, _callee, this, [[0, 6]]);
214
216
  }));
215
217
  function getManifest(_x) {
216
218
  return _getManifest.apply(this, arguments);
@@ -240,17 +242,14 @@ export var EMSClient = /*#__PURE__*/function () {
240
242
  }, {
241
243
  key: "getMainManifest",
242
244
  value: function () {
243
- var _getMainManifest = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
244
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
245
- while (1) switch (_context2.prev = _context2.next) {
245
+ var _getMainManifest = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
246
+ return _regenerator().w(function (_context2) {
247
+ while (1) switch (_context2.n) {
246
248
  case 0:
247
- _context2.next = 2;
249
+ _context2.n = 1;
248
250
  return this._getMainCatalog();
249
- case 2:
250
- return _context2.abrupt("return", _context2.sent);
251
- case 3:
252
- case "end":
253
- return _context2.stop();
251
+ case 1:
252
+ return _context2.a(2, _context2.v);
254
253
  }
255
254
  }, _callee2, this);
256
255
  }));
@@ -262,17 +261,14 @@ export var EMSClient = /*#__PURE__*/function () {
262
261
  }, {
263
262
  key: "getDefaultFileManifest",
264
263
  value: function () {
265
- var _getDefaultFileManifest = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
266
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
267
- while (1) switch (_context3.prev = _context3.next) {
264
+ var _getDefaultFileManifest = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {
265
+ return _regenerator().w(function (_context3) {
266
+ while (1) switch (_context3.n) {
268
267
  case 0:
269
- _context3.next = 2;
268
+ _context3.n = 1;
270
269
  return this._getDefaultFileCatalog();
271
- case 2:
272
- return _context3.abrupt("return", _context3.sent);
273
- case 3:
274
- case "end":
275
- return _context3.stop();
270
+ case 1:
271
+ return _context3.a(2, _context3.v);
276
272
  }
277
273
  }, _callee3, this);
278
274
  }));
@@ -284,17 +280,14 @@ export var EMSClient = /*#__PURE__*/function () {
284
280
  }, {
285
281
  key: "getDefaultTMSManifest",
286
282
  value: function () {
287
- var _getDefaultTMSManifest = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
288
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
289
- while (1) switch (_context4.prev = _context4.next) {
283
+ var _getDefaultTMSManifest = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4() {
284
+ return _regenerator().w(function (_context4) {
285
+ while (1) switch (_context4.n) {
290
286
  case 0:
291
- _context4.next = 2;
287
+ _context4.n = 1;
292
288
  return this._getDefaultTMSCatalog();
293
- case 2:
294
- return _context4.abrupt("return", _context4.sent);
295
- case 3:
296
- case "end":
297
- return _context4.stop();
289
+ case 1:
290
+ return _context4.a(2, _context4.v);
298
291
  }
299
292
  }, _callee4, this);
300
293
  }));
@@ -306,17 +299,14 @@ export var EMSClient = /*#__PURE__*/function () {
306
299
  }, {
307
300
  key: "getFileLayers",
308
301
  value: function () {
309
- var _getFileLayers = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
310
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
311
- while (1) switch (_context5.prev = _context5.next) {
302
+ var _getFileLayers = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5() {
303
+ return _regenerator().w(function (_context5) {
304
+ while (1) switch (_context5.n) {
312
305
  case 0:
313
- _context5.next = 2;
306
+ _context5.n = 1;
314
307
  return this._loadFileLayers();
315
- case 2:
316
- return _context5.abrupt("return", _context5.sent);
317
- case 3:
318
- case "end":
319
- return _context5.stop();
308
+ case 1:
309
+ return _context5.a(2, _context5.v);
320
310
  }
321
311
  }, _callee5, this);
322
312
  }));
@@ -328,17 +318,14 @@ export var EMSClient = /*#__PURE__*/function () {
328
318
  }, {
329
319
  key: "getTMSServices",
330
320
  value: function () {
331
- var _getTMSServices = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
332
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
333
- while (1) switch (_context6.prev = _context6.next) {
321
+ var _getTMSServices = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6() {
322
+ return _regenerator().w(function (_context6) {
323
+ while (1) switch (_context6.n) {
334
324
  case 0:
335
- _context6.next = 2;
325
+ _context6.n = 1;
336
326
  return this._loadTMSServices();
337
- case 2:
338
- return _context6.abrupt("return", _context6.sent);
339
- case 3:
340
- case "end":
341
- return _context6.stop();
327
+ case 1:
328
+ return _context6.a(2, _context6.v);
342
329
  }
343
330
  }, _callee6, this);
344
331
  }));
@@ -393,33 +380,32 @@ export var EMSClient = /*#__PURE__*/function () {
393
380
  }, {
394
381
  key: "findFileLayerById",
395
382
  value: function () {
396
- var _findFileLayerById = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(id) {
383
+ var _findFileLayerById = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7(id) {
397
384
  var fileLayers, i;
398
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
399
- while (1) switch (_context7.prev = _context7.next) {
385
+ return _regenerator().w(function (_context7) {
386
+ while (1) switch (_context7.n) {
400
387
  case 0:
401
- _context7.next = 2;
388
+ _context7.n = 1;
402
389
  return this.getFileLayers();
403
- case 2:
404
- fileLayers = _context7.sent;
390
+ case 1:
391
+ fileLayers = _context7.v;
405
392
  i = 0;
406
- case 4:
393
+ case 2:
407
394
  if (!(i < fileLayers.length)) {
408
- _context7.next = 10;
395
+ _context7.n = 4;
409
396
  break;
410
397
  }
411
398
  if (!fileLayers[i].hasId(id)) {
412
- _context7.next = 7;
399
+ _context7.n = 3;
413
400
  break;
414
401
  }
415
- return _context7.abrupt("return", fileLayers[i]);
416
- case 7:
402
+ return _context7.a(2, fileLayers[i]);
403
+ case 3:
417
404
  i++;
418
- _context7.next = 4;
405
+ _context7.n = 2;
419
406
  break;
420
- case 10:
421
- case "end":
422
- return _context7.stop();
407
+ case 4:
408
+ return _context7.a(2);
423
409
  }
424
410
  }, _callee7, this);
425
411
  }));
@@ -431,33 +417,32 @@ export var EMSClient = /*#__PURE__*/function () {
431
417
  }, {
432
418
  key: "findTMSServiceById",
433
419
  value: function () {
434
- var _findTMSServiceById = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(id) {
420
+ var _findTMSServiceById = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8(id) {
435
421
  var tmsServices, i;
436
- return _regeneratorRuntime().wrap(function _callee8$(_context8) {
437
- while (1) switch (_context8.prev = _context8.next) {
422
+ return _regenerator().w(function (_context8) {
423
+ while (1) switch (_context8.n) {
438
424
  case 0:
439
- _context8.next = 2;
425
+ _context8.n = 1;
440
426
  return this.getTMSServices();
441
- case 2:
442
- tmsServices = _context8.sent;
427
+ case 1:
428
+ tmsServices = _context8.v;
443
429
  i = 0;
444
- case 4:
430
+ case 2:
445
431
  if (!(i < tmsServices.length)) {
446
- _context8.next = 10;
432
+ _context8.n = 4;
447
433
  break;
448
434
  }
449
435
  if (!tmsServices[i].hasId(id)) {
450
- _context8.next = 7;
436
+ _context8.n = 3;
451
437
  break;
452
438
  }
453
- return _context8.abrupt("return", tmsServices[i]);
454
- case 7:
439
+ return _context8.a(2, tmsServices[i]);
440
+ case 3:
455
441
  i++;
456
- _context8.next = 4;
442
+ _context8.n = 2;
457
443
  break;
458
- case 10:
459
- case "end":
460
- return _context8.stop();
444
+ case 4:
445
+ return _context8.a(2);
461
446
  }
462
447
  }, _callee8, this);
463
448
  }));
@@ -500,11 +485,11 @@ export var EMSClient = /*#__PURE__*/function () {
500
485
  key: "_invalidateSettings",
501
486
  value: function _invalidateSettings() {
502
487
  var _this2 = this;
503
- this._cache.reset();
504
- this._getMainCatalog = _.once(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
488
+ this._cache.clear();
489
+ this._getMainCatalog = _.once(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9() {
505
490
  var services, version, _version;
506
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
507
- while (1) switch (_context9.prev = _context9.next) {
491
+ return _regenerator().w(function (_context9) {
492
+ while (1) switch (_context9.n) {
508
493
  case 0:
509
494
  services = [];
510
495
  if (_this2._tileApiUrl) {
@@ -521,114 +506,99 @@ export var EMSClient = /*#__PURE__*/function () {
521
506
  manifest: toAbsoluteUrl(_this2._fileApiUrl, "".concat(_version, "/manifest"))
522
507
  });
523
508
  }
524
- return _context9.abrupt("return", {
509
+ return _context9.a(2, {
525
510
  services: services
526
511
  });
527
- case 4:
528
- case "end":
529
- return _context9.stop();
530
512
  }
531
513
  }, _callee9);
532
514
  })));
533
- this._getDefaultTMSCatalog = _.once(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
515
+ this._getDefaultTMSCatalog = _.once(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0() {
534
516
  var catalogue, firstService, url;
535
- return _regeneratorRuntime().wrap(function _callee10$(_context10) {
536
- while (1) switch (_context10.prev = _context10.next) {
517
+ return _regenerator().w(function (_context0) {
518
+ while (1) switch (_context0.n) {
537
519
  case 0:
538
- _context10.next = 2;
520
+ _context0.n = 1;
539
521
  return _this2._getMainCatalog();
540
- case 2:
541
- catalogue = _context10.sent;
522
+ case 1:
523
+ catalogue = _context0.v;
542
524
  firstService = catalogue.services.find(function (service) {
543
525
  return service.type === 'tms';
544
526
  });
545
527
  if (firstService) {
546
- _context10.next = 6;
528
+ _context0.n = 2;
547
529
  break;
548
530
  }
549
- return _context10.abrupt("return", {
531
+ return _context0.a(2, {
550
532
  services: []
551
533
  });
552
- case 6:
534
+ case 2:
553
535
  url = _this2._proxyPath + firstService.manifest;
554
- _context10.next = 9;
536
+ _context0.n = 3;
555
537
  return _this2.getManifest(url);
556
- case 9:
557
- return _context10.abrupt("return", _context10.sent);
558
- case 10:
559
- case "end":
560
- return _context10.stop();
538
+ case 3:
539
+ return _context0.a(2, _context0.v);
561
540
  }
562
- }, _callee10);
541
+ }, _callee0);
563
542
  })));
564
- this._getDefaultFileCatalog = _.once(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
543
+ this._getDefaultFileCatalog = _.once(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee1() {
565
544
  var catalogue, firstService, url;
566
- return _regeneratorRuntime().wrap(function _callee11$(_context11) {
567
- while (1) switch (_context11.prev = _context11.next) {
545
+ return _regenerator().w(function (_context1) {
546
+ while (1) switch (_context1.n) {
568
547
  case 0:
569
- _context11.next = 2;
548
+ _context1.n = 1;
570
549
  return _this2._getMainCatalog();
571
- case 2:
572
- catalogue = _context11.sent;
550
+ case 1:
551
+ catalogue = _context1.v;
573
552
  firstService = catalogue.services.find(function (service) {
574
553
  return service.type === 'file';
575
554
  });
576
555
  if (firstService) {
577
- _context11.next = 6;
556
+ _context1.n = 2;
578
557
  break;
579
558
  }
580
- return _context11.abrupt("return", {
559
+ return _context1.a(2, {
581
560
  layers: []
582
561
  });
583
- case 6:
562
+ case 2:
584
563
  url = _this2._proxyPath + firstService.manifest;
585
- _context11.next = 9;
564
+ _context1.n = 3;
586
565
  return _this2.getManifest(url);
587
- case 9:
588
- return _context11.abrupt("return", _context11.sent);
589
- case 10:
590
- case "end":
591
- return _context11.stop();
566
+ case 3:
567
+ return _context1.a(2, _context1.v);
592
568
  }
593
- }, _callee11);
569
+ }, _callee1);
594
570
  })));
595
571
 
596
572
  //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() {
573
+ this._loadTMSServices = _.once(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee10() {
598
574
  var tmsManifest;
599
- return _regeneratorRuntime().wrap(function _callee12$(_context12) {
600
- while (1) switch (_context12.prev = _context12.next) {
575
+ return _regenerator().w(function (_context10) {
576
+ while (1) switch (_context10.n) {
601
577
  case 0:
602
- _context12.next = 2;
578
+ _context10.n = 1;
603
579
  return _this2._getDefaultTMSCatalog();
604
- case 2:
605
- tmsManifest = _context12.sent;
606
- return _context12.abrupt("return", tmsManifest.services.map(function (serviceConfig) {
580
+ case 1:
581
+ tmsManifest = _context10.v;
582
+ return _context10.a(2, tmsManifest.services.map(function (serviceConfig) {
607
583
  return new TMSService(serviceConfig, _this2, _this2._proxyPath);
608
584
  }));
609
- case 4:
610
- case "end":
611
- return _context12.stop();
612
585
  }
613
- }, _callee12);
586
+ }, _callee10);
614
587
  })));
615
- this._loadFileLayers = _.once(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
588
+ this._loadFileLayers = _.once(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee11() {
616
589
  var fileManifest;
617
- return _regeneratorRuntime().wrap(function _callee13$(_context13) {
618
- while (1) switch (_context13.prev = _context13.next) {
590
+ return _regenerator().w(function (_context11) {
591
+ while (1) switch (_context11.n) {
619
592
  case 0:
620
- _context13.next = 2;
593
+ _context11.n = 1;
621
594
  return _this2._getDefaultFileCatalog();
622
- case 2:
623
- fileManifest = _context13.sent;
624
- return _context13.abrupt("return", fileManifest.layers.map(function (layerConfig) {
595
+ case 1:
596
+ fileManifest = _context11.v;
597
+ return _context11.a(2, fileManifest.layers.map(function (layerConfig) {
625
598
  return new FileLayer(layerConfig, _this2, _this2._proxyPath);
626
599
  }));
627
- case 4:
628
- case "end":
629
- return _context13.stop();
630
600
  }
631
- }, _callee13);
601
+ }, _callee11);
632
602
  })));
633
603
  }
634
604
  }]);