@elastic/ems-client 8.4.0 → 8.4.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 +5 -17
- package/.buildkite/build.sh +16 -0
- package/.buildkite/pipeline.yml +8 -0
- package/.buildkite/pull-requests.json +30 -0
- package/.nvmrc +1 -0
- package/CHANGELOG.md +6 -0
- package/CONTRIBUTING.md +18 -0
- package/catalog-info.yaml +68 -0
- package/package.json +5 -2
- package/target/node/ems_client.js +9 -5
- package/target/node/ems_service.js +9 -5
- package/target/node/file_layer.js +11 -7
- package/target/node/tms_service.js +15 -12
- package/target/node/utils.js +5 -0
- package/target/web/ems_client.js +252 -281
- package/target/web/ems_service.js +4 -5
- package/target/web/file_layer.js +51 -53
- package/target/web/tms_service.js +384 -416
- package/target/web/utils.js +6 -1
- package/.ci/jobs/defaults.yml +0 -67
- package/.ci/jobs/elastic+ems-client+master.yml +0 -18
- package/.ci/jobs/elastic+ems-client+pull-request.yml +0 -19
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
function _typeof(
|
|
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
2
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
3
3
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
4
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
5
5
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
6
6
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
7
7
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
8
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
9
|
-
function ownKeys(
|
|
10
|
-
function _objectSpread(
|
|
11
|
-
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 exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
8
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
9
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
10
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
11
|
+
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 new 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 new 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 new 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; }
|
|
12
12
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
13
13
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
14
14
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -37,17 +37,6 @@ import { colorizeColor } from './utils';
|
|
|
37
37
|
export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
|
|
38
38
|
_inherits(TMSService, _AbstractEmsService);
|
|
39
39
|
var _super = _createSuper(TMSService);
|
|
40
|
-
/*
|
|
41
|
-
List of supported languages with labels and OMT codes extracted
|
|
42
|
-
from https://openmaptiles.org/languages
|
|
43
|
-
Keys are values for i18.locale from Kibana settings
|
|
44
|
-
and OMT codes for the rest.
|
|
45
|
-
*/
|
|
46
|
-
|
|
47
|
-
/*
|
|
48
|
-
Suggested default operations for the different EMS styles
|
|
49
|
-
*/
|
|
50
|
-
|
|
51
40
|
function TMSService(config, emsClient, proxyPath) {
|
|
52
41
|
var _this;
|
|
53
42
|
_classCallCheck(this, TMSService);
|
|
@@ -56,134 +45,128 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
|
|
|
56
45
|
_defineProperty(_assertThisInitialized(_this), "_getRasterStyleJson", _.once( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
57
46
|
var rasterUrl, url;
|
|
58
47
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
59
|
-
while (1) {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
return _context.stop();
|
|
74
|
-
}
|
|
48
|
+
while (1) switch (_context.prev = _context.next) {
|
|
49
|
+
case 0:
|
|
50
|
+
rasterUrl = _this._getStyleUrlForLocale('raster');
|
|
51
|
+
if (!rasterUrl) {
|
|
52
|
+
_context.next = 6;
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
url = _this._proxyPath + _this._getAbsoluteUrl(rasterUrl);
|
|
56
|
+
return _context.abrupt("return", _this._emsClient.getManifest(_this._emsClient.extendUrlWithParams(url)));
|
|
57
|
+
case 6:
|
|
58
|
+
return _context.abrupt("return");
|
|
59
|
+
case 7:
|
|
60
|
+
case "end":
|
|
61
|
+
return _context.stop();
|
|
75
62
|
}
|
|
76
63
|
}, _callee);
|
|
77
64
|
}))));
|
|
78
65
|
_defineProperty(_assertThisInitialized(_this), "_getVectorStyleJsonRaw", _.once( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
79
66
|
var vectorUrl, url, vectorJson;
|
|
80
67
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
81
|
-
while (1) {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
return _context2.stop();
|
|
100
|
-
}
|
|
68
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
69
|
+
case 0:
|
|
70
|
+
vectorUrl = _this._getStyleUrlForLocale('vector');
|
|
71
|
+
if (!vectorUrl) {
|
|
72
|
+
_context2.next = 9;
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
url = _this._proxyPath + _this._getAbsoluteUrl(vectorUrl);
|
|
76
|
+
_context2.next = 5;
|
|
77
|
+
return _this._emsClient.getManifest(_this._emsClient.extendUrlWithParams(url));
|
|
78
|
+
case 5:
|
|
79
|
+
vectorJson = _context2.sent;
|
|
80
|
+
return _context2.abrupt("return", _objectSpread({}, vectorJson));
|
|
81
|
+
case 9:
|
|
82
|
+
return _context2.abrupt("return");
|
|
83
|
+
case 10:
|
|
84
|
+
case "end":
|
|
85
|
+
return _context2.stop();
|
|
101
86
|
}
|
|
102
87
|
}, _callee2);
|
|
103
88
|
}))));
|
|
104
89
|
_defineProperty(_assertThisInitialized(_this), "_getVectorStyleJsonInlined", _.once( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
105
90
|
var vectorJson, inlinedSources, sources, _iterator, _step, _sourceName, url, _sourceJson$tiles, sourceUrl, extendedUrl, sourceJson, tiles;
|
|
106
91
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
107
|
-
while (1) {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
_context3.next = 44;
|
|
116
|
-
break;
|
|
117
|
-
}
|
|
118
|
-
inlinedSources = {};
|
|
119
|
-
sources = vectorJson.sources;
|
|
120
|
-
_iterator = _createForOfIteratorHelper(Object.getOwnPropertyNames(sources));
|
|
121
|
-
_context3.prev = 7;
|
|
122
|
-
_iterator.s();
|
|
123
|
-
case 9:
|
|
124
|
-
if ((_step = _iterator.n()).done) {
|
|
125
|
-
_context3.next = 22;
|
|
126
|
-
break;
|
|
127
|
-
}
|
|
128
|
-
_sourceName = _step.value;
|
|
129
|
-
url = sources[_sourceName].url;
|
|
130
|
-
if (!url) {
|
|
131
|
-
_context3.next = 20;
|
|
132
|
-
break;
|
|
133
|
-
}
|
|
134
|
-
sourceUrl = _this._proxyPath + _this._getAbsoluteUrl(url);
|
|
135
|
-
extendedUrl = _this._emsClient.extendUrlWithParams(sourceUrl);
|
|
136
|
-
_context3.next = 17;
|
|
137
|
-
return _this._emsClient.getManifest(extendedUrl);
|
|
138
|
-
case 17:
|
|
139
|
-
sourceJson = _context3.sent;
|
|
140
|
-
tiles = sourceJson === null || sourceJson === void 0 ? void 0 : (_sourceJson$tiles = sourceJson.tiles) === null || _sourceJson$tiles === void 0 ? void 0 : _sourceJson$tiles.map(function (tileUrl) {
|
|
141
|
-
var directUrl = _this._proxyPath + _this._getAbsoluteUrl(tileUrl);
|
|
142
|
-
return _this._emsClient.extendUrlWithParams(directUrl);
|
|
143
|
-
});
|
|
144
|
-
inlinedSources[_sourceName] = _objectSpread(_objectSpread({}, sourceJson), {}, {
|
|
145
|
-
type: 'vector',
|
|
146
|
-
tiles: tiles
|
|
147
|
-
});
|
|
148
|
-
case 20:
|
|
149
|
-
_context3.next = 9;
|
|
92
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
93
|
+
case 0:
|
|
94
|
+
_context3.next = 2;
|
|
95
|
+
return _this._getVectorStyleJsonRaw();
|
|
96
|
+
case 2:
|
|
97
|
+
vectorJson = _context3.sent;
|
|
98
|
+
if (!vectorJson) {
|
|
99
|
+
_context3.next = 44;
|
|
150
100
|
break;
|
|
151
|
-
|
|
152
|
-
|
|
101
|
+
}
|
|
102
|
+
inlinedSources = {};
|
|
103
|
+
sources = vectorJson.sources;
|
|
104
|
+
_iterator = _createForOfIteratorHelper(Object.getOwnPropertyNames(sources));
|
|
105
|
+
_context3.prev = 7;
|
|
106
|
+
_iterator.s();
|
|
107
|
+
case 9:
|
|
108
|
+
if ((_step = _iterator.n()).done) {
|
|
109
|
+
_context3.next = 22;
|
|
153
110
|
break;
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
111
|
+
}
|
|
112
|
+
_sourceName = _step.value;
|
|
113
|
+
url = sources[_sourceName].url;
|
|
114
|
+
if (!url) {
|
|
115
|
+
_context3.next = 20;
|
|
116
|
+
break;
|
|
117
|
+
}
|
|
118
|
+
sourceUrl = _this._proxyPath + _this._getAbsoluteUrl(url);
|
|
119
|
+
extendedUrl = _this._emsClient.extendUrlWithParams(sourceUrl);
|
|
120
|
+
_context3.next = 17;
|
|
121
|
+
return _this._emsClient.getManifest(extendedUrl);
|
|
122
|
+
case 17:
|
|
123
|
+
sourceJson = _context3.sent;
|
|
124
|
+
tiles = sourceJson === null || sourceJson === void 0 || (_sourceJson$tiles = sourceJson.tiles) === null || _sourceJson$tiles === void 0 ? void 0 : _sourceJson$tiles.map(function (tileUrl) {
|
|
125
|
+
var directUrl = _this._proxyPath + _this._getAbsoluteUrl(tileUrl);
|
|
126
|
+
return _this._emsClient.extendUrlWithParams(directUrl);
|
|
127
|
+
});
|
|
128
|
+
inlinedSources[_sourceName] = _objectSpread(_objectSpread({}, sourceJson), {}, {
|
|
129
|
+
type: 'vector',
|
|
130
|
+
tiles: tiles
|
|
131
|
+
});
|
|
132
|
+
case 20:
|
|
133
|
+
_context3.next = 9;
|
|
134
|
+
break;
|
|
135
|
+
case 22:
|
|
136
|
+
_context3.next = 27;
|
|
137
|
+
break;
|
|
138
|
+
case 24:
|
|
139
|
+
_context3.prev = 24;
|
|
140
|
+
_context3.t0 = _context3["catch"](7);
|
|
141
|
+
_iterator.e(_context3.t0);
|
|
142
|
+
case 27:
|
|
143
|
+
_context3.prev = 27;
|
|
144
|
+
_iterator.f();
|
|
145
|
+
return _context3.finish(27);
|
|
146
|
+
case 30:
|
|
147
|
+
_context3.t1 = _objectSpread;
|
|
148
|
+
_context3.t2 = _objectSpread({}, vectorJson);
|
|
149
|
+
_context3.t3 = {};
|
|
150
|
+
_context3.t4 = inlinedSources;
|
|
151
|
+
_context3.next = 36;
|
|
152
|
+
return _this._getSpriteSheetRootPath();
|
|
153
|
+
case 36:
|
|
154
|
+
_context3.t5 = _context3.sent;
|
|
155
|
+
_context3.next = 39;
|
|
156
|
+
return _this._getUrlTemplateForGlyphs();
|
|
157
|
+
case 39:
|
|
158
|
+
_context3.t6 = _context3.sent;
|
|
159
|
+
_context3.t7 = {
|
|
160
|
+
sources: _context3.t4,
|
|
161
|
+
sprite: _context3.t5,
|
|
162
|
+
glyphs: _context3.t6
|
|
163
|
+
};
|
|
164
|
+
return _context3.abrupt("return", (0, _context3.t1)(_context3.t2, _context3.t3, _context3.t7));
|
|
165
|
+
case 44:
|
|
166
|
+
return _context3.abrupt("return");
|
|
167
|
+
case 45:
|
|
168
|
+
case "end":
|
|
169
|
+
return _context3.stop();
|
|
187
170
|
}
|
|
188
171
|
}, _callee3, null, [[7, 24, 27, 30]]);
|
|
189
172
|
}))));
|
|
@@ -202,29 +185,27 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
|
|
|
202
185
|
var _this2 = this;
|
|
203
186
|
var tileJson, tiles;
|
|
204
187
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
205
|
-
while (1) {
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
return _context4.stop();
|
|
227
|
-
}
|
|
188
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
189
|
+
case 0:
|
|
190
|
+
_context4.next = 2;
|
|
191
|
+
return this._getRasterStyleJson();
|
|
192
|
+
case 2:
|
|
193
|
+
tileJson = _context4.sent;
|
|
194
|
+
if (!tileJson) {
|
|
195
|
+
_context4.next = 8;
|
|
196
|
+
break;
|
|
197
|
+
}
|
|
198
|
+
tiles = tileJson.tiles.map(function (tile) {
|
|
199
|
+
return _this2._proxyPath + _this2._getAbsoluteUrl(tile);
|
|
200
|
+
});
|
|
201
|
+
return _context4.abrupt("return", _objectSpread(_objectSpread({}, tileJson), {
|
|
202
|
+
tiles: tiles
|
|
203
|
+
}));
|
|
204
|
+
case 8:
|
|
205
|
+
return _context4.abrupt("return");
|
|
206
|
+
case 9:
|
|
207
|
+
case "end":
|
|
208
|
+
return _context4.stop();
|
|
228
209
|
}
|
|
229
210
|
}, _callee4, this);
|
|
230
211
|
}));
|
|
@@ -239,25 +220,23 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
|
|
|
239
220
|
var _getUrlTemplate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
240
221
|
var tileJson, directUrl;
|
|
241
222
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
242
|
-
while (1) {
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
return _context5.stop();
|
|
260
|
-
}
|
|
223
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
224
|
+
case 0:
|
|
225
|
+
_context5.next = 2;
|
|
226
|
+
return this._getRasterStyleJson();
|
|
227
|
+
case 2:
|
|
228
|
+
tileJson = _context5.sent;
|
|
229
|
+
if (!tileJson) {
|
|
230
|
+
_context5.next = 8;
|
|
231
|
+
break;
|
|
232
|
+
}
|
|
233
|
+
directUrl = this._proxyPath + this._getAbsoluteUrl(tileJson.tiles[0]);
|
|
234
|
+
return _context5.abrupt("return", this._emsClient.extendUrlWithParams(directUrl));
|
|
235
|
+
case 8:
|
|
236
|
+
return _context5.abrupt("return", '');
|
|
237
|
+
case 9:
|
|
238
|
+
case "end":
|
|
239
|
+
return _context5.stop();
|
|
261
240
|
}
|
|
262
241
|
}, _callee5, this);
|
|
263
242
|
}));
|
|
@@ -270,29 +249,27 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
|
|
|
270
249
|
key: "getUrlTemplateForVector",
|
|
271
250
|
value: function () {
|
|
272
251
|
var _getUrlTemplateForVector = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(sourceId) {
|
|
273
|
-
var _tileJson$sources$sou
|
|
252
|
+
var _tileJson$sources$sou;
|
|
274
253
|
var tileJson, url, directUrl;
|
|
275
254
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
276
|
-
while (1) {
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
return _context6.stop();
|
|
295
|
-
}
|
|
255
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
256
|
+
case 0:
|
|
257
|
+
_context6.next = 2;
|
|
258
|
+
return this._getVectorStyleJsonInlined();
|
|
259
|
+
case 2:
|
|
260
|
+
tileJson = _context6.sent;
|
|
261
|
+
url = tileJson === null || tileJson === void 0 || (_tileJson$sources$sou = tileJson.sources[sourceId]) === null || _tileJson$sources$sou === void 0 || (_tileJson$sources$sou = _tileJson$sources$sou.tiles) === null || _tileJson$sources$sou === void 0 ? void 0 : _tileJson$sources$sou.pop();
|
|
262
|
+
if (!url) {
|
|
263
|
+
_context6.next = 9;
|
|
264
|
+
break;
|
|
265
|
+
}
|
|
266
|
+
directUrl = this._proxyPath + this._getAbsoluteUrl(url);
|
|
267
|
+
return _context6.abrupt("return", this._emsClient.extendUrlWithParams(directUrl));
|
|
268
|
+
case 9:
|
|
269
|
+
return _context6.abrupt("return", '');
|
|
270
|
+
case 10:
|
|
271
|
+
case "end":
|
|
272
|
+
return _context6.stop();
|
|
296
273
|
}
|
|
297
274
|
}, _callee6, this);
|
|
298
275
|
}));
|
|
@@ -306,17 +283,15 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
|
|
|
306
283
|
value: function () {
|
|
307
284
|
var _getVectorStyleSheet = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
|
|
308
285
|
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
309
|
-
while (1) {
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
return _context7.stop();
|
|
319
|
-
}
|
|
286
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
287
|
+
case 0:
|
|
288
|
+
_context7.next = 2;
|
|
289
|
+
return this._getVectorStyleJsonInlined();
|
|
290
|
+
case 2:
|
|
291
|
+
return _context7.abrupt("return", _context7.sent);
|
|
292
|
+
case 3:
|
|
293
|
+
case "end":
|
|
294
|
+
return _context7.stop();
|
|
320
295
|
}
|
|
321
296
|
}, _callee7, this);
|
|
322
297
|
}));
|
|
@@ -330,17 +305,15 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
|
|
|
330
305
|
value: function () {
|
|
331
306
|
var _getVectorStyleSheetRaw = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
|
332
307
|
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
333
|
-
while (1) {
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
return _context8.stop();
|
|
343
|
-
}
|
|
308
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
309
|
+
case 0:
|
|
310
|
+
_context8.next = 2;
|
|
311
|
+
return this._getVectorStyleJsonRaw();
|
|
312
|
+
case 2:
|
|
313
|
+
return _context8.abrupt("return", _context8.sent);
|
|
314
|
+
case 3:
|
|
315
|
+
case "end":
|
|
316
|
+
return _context8.stop();
|
|
344
317
|
}
|
|
345
318
|
}, _callee8, this);
|
|
346
319
|
}));
|
|
@@ -360,37 +333,35 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
|
|
|
360
333
|
jsonMeta,
|
|
361
334
|
_args9 = arguments;
|
|
362
335
|
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
363
|
-
while (1) {
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
return _context9.stop();
|
|
393
|
-
}
|
|
336
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
337
|
+
case 0:
|
|
338
|
+
isRetina = _args9.length > 0 && _args9[0] !== undefined ? _args9[0] : false;
|
|
339
|
+
_context9.next = 3;
|
|
340
|
+
return this.getSpriteSheetJsonPath(isRetina);
|
|
341
|
+
case 3:
|
|
342
|
+
metaUrl = _context9.sent;
|
|
343
|
+
_context9.next = 6;
|
|
344
|
+
return this.getSpriteSheetPngPath(isRetina);
|
|
345
|
+
case 6:
|
|
346
|
+
spritePngs = _context9.sent;
|
|
347
|
+
if (!(metaUrl && spritePngs)) {
|
|
348
|
+
_context9.next = 15;
|
|
349
|
+
break;
|
|
350
|
+
}
|
|
351
|
+
metaUrlExtended = this._emsClient.extendUrlWithParams(metaUrl);
|
|
352
|
+
_context9.next = 11;
|
|
353
|
+
return this._emsClient.getManifest(metaUrlExtended);
|
|
354
|
+
case 11:
|
|
355
|
+
jsonMeta = _context9.sent;
|
|
356
|
+
return _context9.abrupt("return", {
|
|
357
|
+
png: spritePngs,
|
|
358
|
+
json: jsonMeta
|
|
359
|
+
});
|
|
360
|
+
case 15:
|
|
361
|
+
return _context9.abrupt("return");
|
|
362
|
+
case 16:
|
|
363
|
+
case "end":
|
|
364
|
+
return _context9.stop();
|
|
394
365
|
}
|
|
395
366
|
}, _callee9, this);
|
|
396
367
|
}));
|
|
@@ -408,26 +379,24 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
|
|
|
408
379
|
suffix,
|
|
409
380
|
_args10 = arguments;
|
|
410
381
|
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
411
|
-
while (1) {
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
return _context10.stop();
|
|
430
|
-
}
|
|
382
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
383
|
+
case 0:
|
|
384
|
+
isRetina = _args10.length > 0 && _args10[0] !== undefined ? _args10[0] : false;
|
|
385
|
+
_context10.next = 3;
|
|
386
|
+
return this._getSpriteSheetRootPath();
|
|
387
|
+
case 3:
|
|
388
|
+
spriteSheetRootPath = _context10.sent;
|
|
389
|
+
if (!spriteSheetRootPath) {
|
|
390
|
+
_context10.next = 9;
|
|
391
|
+
break;
|
|
392
|
+
}
|
|
393
|
+
suffix = isRetina ? '@2x' : '';
|
|
394
|
+
return _context10.abrupt("return", spriteSheetRootPath + suffix + '.json');
|
|
395
|
+
case 9:
|
|
396
|
+
return _context10.abrupt("return", '');
|
|
397
|
+
case 10:
|
|
398
|
+
case "end":
|
|
399
|
+
return _context10.stop();
|
|
431
400
|
}
|
|
432
401
|
}, _callee10, this);
|
|
433
402
|
}));
|
|
@@ -445,26 +414,24 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
|
|
|
445
414
|
suffix,
|
|
446
415
|
_args11 = arguments;
|
|
447
416
|
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
448
|
-
while (1) {
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
return _context11.stop();
|
|
467
|
-
}
|
|
417
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
418
|
+
case 0:
|
|
419
|
+
isRetina = _args11.length > 0 && _args11[0] !== undefined ? _args11[0] : false;
|
|
420
|
+
_context11.next = 3;
|
|
421
|
+
return this._getSpriteSheetRootPath();
|
|
422
|
+
case 3:
|
|
423
|
+
spriteSheetRootPath = _context11.sent;
|
|
424
|
+
if (!spriteSheetRootPath) {
|
|
425
|
+
_context11.next = 9;
|
|
426
|
+
break;
|
|
427
|
+
}
|
|
428
|
+
suffix = isRetina ? '@2x' : '';
|
|
429
|
+
return _context11.abrupt("return", spriteSheetRootPath + suffix + '.png');
|
|
430
|
+
case 9:
|
|
431
|
+
return _context11.abrupt("return", '');
|
|
432
|
+
case 10:
|
|
433
|
+
case "end":
|
|
434
|
+
return _context11.stop();
|
|
468
435
|
}
|
|
469
436
|
}, _callee11, this);
|
|
470
437
|
}));
|
|
@@ -489,54 +456,52 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
|
|
|
489
456
|
minzoom,
|
|
490
457
|
_args12 = arguments;
|
|
491
458
|
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
492
|
-
while (1) {
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
459
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
460
|
+
case 0:
|
|
461
|
+
format = _args12.length > 0 && _args12[0] !== undefined ? _args12[0] : 'vector';
|
|
462
|
+
_context12.t0 = format;
|
|
463
|
+
_context12.next = _context12.t0 === 'vector' ? 4 : _context12.t0 === 'raster' ? 12 : 20;
|
|
464
|
+
break;
|
|
465
|
+
case 4:
|
|
466
|
+
_context12.next = 6;
|
|
467
|
+
return this._getVectorStyleJsonInlined();
|
|
468
|
+
case 6:
|
|
469
|
+
_context12.t1 = _context12.sent;
|
|
470
|
+
if (_context12.t1) {
|
|
471
|
+
_context12.next = 9;
|
|
498
472
|
break;
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
_ref6 = _context12.t2;
|
|
532
|
-
minzoom = _ref6.minzoom;
|
|
533
|
-
return _context12.abrupt("return", minzoom);
|
|
534
|
-
case 20:
|
|
535
|
-
return _context12.abrupt("return");
|
|
536
|
-
case 21:
|
|
537
|
-
case "end":
|
|
538
|
-
return _context12.stop();
|
|
539
|
-
}
|
|
473
|
+
}
|
|
474
|
+
_context12.t1 = {
|
|
475
|
+
sources: {}
|
|
476
|
+
};
|
|
477
|
+
case 9:
|
|
478
|
+
_ref4 = _context12.t1;
|
|
479
|
+
sources = _ref4.sources;
|
|
480
|
+
return _context12.abrupt("return", Math.min.apply(Math, _toConsumableArray(Object.values(sources).map(function (_ref5) {
|
|
481
|
+
var minzoom = _ref5.minzoom;
|
|
482
|
+
return minzoom;
|
|
483
|
+
}).filter(function (minzoom) {
|
|
484
|
+
return Number.isFinite(minzoom);
|
|
485
|
+
}))));
|
|
486
|
+
case 12:
|
|
487
|
+
_context12.next = 14;
|
|
488
|
+
return this._getRasterStyleJson();
|
|
489
|
+
case 14:
|
|
490
|
+
_context12.t2 = _context12.sent;
|
|
491
|
+
if (_context12.t2) {
|
|
492
|
+
_context12.next = 17;
|
|
493
|
+
break;
|
|
494
|
+
}
|
|
495
|
+
_context12.t2 = {};
|
|
496
|
+
case 17:
|
|
497
|
+
_ref6 = _context12.t2;
|
|
498
|
+
minzoom = _ref6.minzoom;
|
|
499
|
+
return _context12.abrupt("return", minzoom);
|
|
500
|
+
case 20:
|
|
501
|
+
return _context12.abrupt("return");
|
|
502
|
+
case 21:
|
|
503
|
+
case "end":
|
|
504
|
+
return _context12.stop();
|
|
540
505
|
}
|
|
541
506
|
}, _callee12, this);
|
|
542
507
|
}));
|
|
@@ -556,54 +521,52 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
|
|
|
556
521
|
maxzoom,
|
|
557
522
|
_args13 = arguments;
|
|
558
523
|
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
559
|
-
while (1) {
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
524
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
525
|
+
case 0:
|
|
526
|
+
format = _args13.length > 0 && _args13[0] !== undefined ? _args13[0] : 'vector';
|
|
527
|
+
_context13.t0 = format;
|
|
528
|
+
_context13.next = _context13.t0 === 'vector' ? 4 : _context13.t0 === 'raster' ? 12 : 20;
|
|
529
|
+
break;
|
|
530
|
+
case 4:
|
|
531
|
+
_context13.next = 6;
|
|
532
|
+
return this._getVectorStyleJsonInlined();
|
|
533
|
+
case 6:
|
|
534
|
+
_context13.t1 = _context13.sent;
|
|
535
|
+
if (_context13.t1) {
|
|
536
|
+
_context13.next = 9;
|
|
565
537
|
break;
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
_ref9 = _context13.t2;
|
|
599
|
-
maxzoom = _ref9.maxzoom;
|
|
600
|
-
return _context13.abrupt("return", maxzoom);
|
|
601
|
-
case 20:
|
|
602
|
-
return _context13.abrupt("return");
|
|
603
|
-
case 21:
|
|
604
|
-
case "end":
|
|
605
|
-
return _context13.stop();
|
|
606
|
-
}
|
|
538
|
+
}
|
|
539
|
+
_context13.t1 = {
|
|
540
|
+
sources: {}
|
|
541
|
+
};
|
|
542
|
+
case 9:
|
|
543
|
+
_ref7 = _context13.t1;
|
|
544
|
+
sources = _ref7.sources;
|
|
545
|
+
return _context13.abrupt("return", Math.max.apply(Math, _toConsumableArray(Object.values(sources).map(function (_ref8) {
|
|
546
|
+
var maxzoom = _ref8.maxzoom;
|
|
547
|
+
return maxzoom;
|
|
548
|
+
}).filter(function (maxzoom) {
|
|
549
|
+
return Number.isFinite(maxzoom);
|
|
550
|
+
}))));
|
|
551
|
+
case 12:
|
|
552
|
+
_context13.next = 14;
|
|
553
|
+
return this._getRasterStyleJson();
|
|
554
|
+
case 14:
|
|
555
|
+
_context13.t2 = _context13.sent;
|
|
556
|
+
if (_context13.t2) {
|
|
557
|
+
_context13.next = 17;
|
|
558
|
+
break;
|
|
559
|
+
}
|
|
560
|
+
_context13.t2 = {};
|
|
561
|
+
case 17:
|
|
562
|
+
_ref9 = _context13.t2;
|
|
563
|
+
maxzoom = _ref9.maxzoom;
|
|
564
|
+
return _context13.abrupt("return", maxzoom);
|
|
565
|
+
case 20:
|
|
566
|
+
return _context13.abrupt("return");
|
|
567
|
+
case 21:
|
|
568
|
+
case "end":
|
|
569
|
+
return _context13.stop();
|
|
607
570
|
}
|
|
608
571
|
}, _callee13, this);
|
|
609
572
|
}));
|
|
@@ -657,24 +620,22 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
|
|
|
657
620
|
var _getSpriteSheetRootPath2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
|
|
658
621
|
var vectorStyleJson;
|
|
659
622
|
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
660
|
-
while (1) {
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
return _context14.stop();
|
|
677
|
-
}
|
|
623
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
624
|
+
case 0:
|
|
625
|
+
_context14.next = 2;
|
|
626
|
+
return this._getVectorStyleJsonRaw();
|
|
627
|
+
case 2:
|
|
628
|
+
vectorStyleJson = _context14.sent;
|
|
629
|
+
if (!(vectorStyleJson !== null && vectorStyleJson !== void 0 && vectorStyleJson.sprite)) {
|
|
630
|
+
_context14.next = 7;
|
|
631
|
+
break;
|
|
632
|
+
}
|
|
633
|
+
return _context14.abrupt("return", this._proxyPath + this._getAbsoluteUrl(vectorStyleJson.sprite));
|
|
634
|
+
case 7:
|
|
635
|
+
return _context14.abrupt("return", '');
|
|
636
|
+
case 8:
|
|
637
|
+
case "end":
|
|
638
|
+
return _context14.stop();
|
|
678
639
|
}
|
|
679
640
|
}, _callee14, this);
|
|
680
641
|
}));
|
|
@@ -689,24 +650,22 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
|
|
|
689
650
|
var _getUrlTemplateForGlyphs2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
|
|
690
651
|
var vectorStyleJson;
|
|
691
652
|
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
692
|
-
while (1) {
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
return _context15.stop();
|
|
709
|
-
}
|
|
653
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
654
|
+
case 0:
|
|
655
|
+
_context15.next = 2;
|
|
656
|
+
return this._getVectorStyleJsonRaw();
|
|
657
|
+
case 2:
|
|
658
|
+
vectorStyleJson = _context15.sent;
|
|
659
|
+
if (!(vectorStyleJson !== null && vectorStyleJson !== void 0 && vectorStyleJson.glyphs)) {
|
|
660
|
+
_context15.next = 7;
|
|
661
|
+
break;
|
|
662
|
+
}
|
|
663
|
+
return _context15.abrupt("return", this._proxyPath + this._getAbsoluteUrl(vectorStyleJson.glyphs));
|
|
664
|
+
case 7:
|
|
665
|
+
return _context15.abrupt("return", '');
|
|
666
|
+
case 8:
|
|
667
|
+
case "end":
|
|
668
|
+
return _context15.stop();
|
|
710
669
|
}
|
|
711
670
|
}, _callee15, this);
|
|
712
671
|
}));
|
|
@@ -776,6 +735,12 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
|
|
|
776
735
|
}]);
|
|
777
736
|
return TMSService;
|
|
778
737
|
}(AbstractEmsService);
|
|
738
|
+
/*
|
|
739
|
+
List of supported languages with labels and OMT codes extracted
|
|
740
|
+
from https://openmaptiles.org/languages
|
|
741
|
+
Keys are values for i18.locale from Kibana settings
|
|
742
|
+
and OMT codes for the rest.
|
|
743
|
+
*/
|
|
779
744
|
_defineProperty(TMSService, "SupportedLanguages", [{
|
|
780
745
|
key: 'ar',
|
|
781
746
|
omt: 'ar'
|
|
@@ -954,6 +919,9 @@ _defineProperty(TMSService, "SupportedLanguages", [{
|
|
|
954
919
|
key: 'zh-cn',
|
|
955
920
|
omt: 'zh'
|
|
956
921
|
}]);
|
|
922
|
+
/*
|
|
923
|
+
Suggested default operations for the different EMS styles
|
|
924
|
+
*/
|
|
957
925
|
_defineProperty(TMSService, "colorOperationDefaults", [{
|
|
958
926
|
style: 'road_map',
|
|
959
927
|
operation: 'mix',
|