roboto-js 1.8.4 → 1.8.6
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/.last-build +1 -1
- package/BUILD_NOTES.md +30 -0
- package/babel.config.json +13 -0
- package/dist/cjs/cookie_storage_adaptor.cjs +38 -84
- package/dist/cjs/index.cjs +21 -14
- package/dist/cjs/rbt_api.cjs +34 -97
- package/dist/cjs/rbt_object.cjs +5 -14
- package/dist/cjs/rbt_user.cjs +1 -3
- package/dist/cookie_storage_adaptor.js +415 -0
- package/dist/esm/cookie_storage_adaptor.js +354 -197
- package/dist/esm/index.js +604 -182
- package/dist/esm/rbt_api.js +1976 -1172
- package/dist/esm/rbt_file.js +222 -126
- package/dist/esm/rbt_metrics_api.js +166 -71
- package/dist/esm/rbt_object.js +1014 -708
- package/dist/esm/rbt_user.js +209 -138
- package/dist/index.js +594 -0
- package/dist/rbt_api.js +2115 -0
- package/dist/rbt_file.js +223 -0
- package/dist/rbt_metrics_api.js +200 -0
- package/dist/rbt_object.js +1110 -0
- package/dist/rbt_user.js +235 -0
- package/package.json +4 -3
- package/src/index.js +21 -11
- package/src/rbt_api.js +9 -0
package/dist/esm/index.js
CHANGED
|
@@ -1,91 +1,139 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "CookieStorageAdaptor", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _cookie_storage_adaptor["default"];
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "RbtApi", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _rbt_api["default"];
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "RbtFile", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function get() {
|
|
21
|
+
return _rbt_file["default"];
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "RbtObject", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function get() {
|
|
27
|
+
return _rbt_object["default"];
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
exports["default"] = void 0;
|
|
31
|
+
var _rbt_api = _interopRequireDefault(require("./rbt_api.js"));
|
|
32
|
+
var _rbt_object = _interopRequireDefault(require("./rbt_object.js"));
|
|
33
|
+
var _rbt_file = _interopRequireDefault(require("./rbt_file.js"));
|
|
34
|
+
var _rbt_metrics_api = _interopRequireDefault(require("./rbt_metrics_api.js"));
|
|
35
|
+
var _cookie_storage_adaptor = _interopRequireDefault(require("./cookie_storage_adaptor.js"));
|
|
36
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
37
|
+
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); }
|
|
38
|
+
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; }
|
|
39
|
+
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); } }
|
|
40
|
+
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); }); }; }
|
|
41
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
42
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
43
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
44
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
45
|
+
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); }
|
|
46
|
+
var Roboto = exports["default"] = /*#__PURE__*/function () {
|
|
47
|
+
function Roboto(_ref) {
|
|
48
|
+
var _this = this;
|
|
49
|
+
var host = _ref.host,
|
|
50
|
+
accessKey = _ref.accessKey,
|
|
51
|
+
apiKey = _ref.apiKey,
|
|
52
|
+
authToken = _ref.authToken,
|
|
53
|
+
localStorageAdaptor = _ref.localStorageAdaptor,
|
|
54
|
+
_ref$disableWebSocket = _ref.disableWebSocket,
|
|
55
|
+
disableWebSocket = _ref$disableWebSocket === void 0 ? false : _ref$disableWebSocket,
|
|
56
|
+
metricsHost = _ref.metricsHost,
|
|
57
|
+
_ref$useCookies = _ref.useCookies,
|
|
58
|
+
useCookies = _ref$useCookies === void 0 ? true : _ref$useCookies;
|
|
59
|
+
var proxyReq = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
60
|
+
_classCallCheck(this, Roboto);
|
|
22
61
|
if (Roboto.instance && !proxyReq) {
|
|
23
62
|
// if on client, there can only be one instance
|
|
24
63
|
// on server, with proxyReq, each request has its own instance
|
|
25
64
|
return Roboto.instance;
|
|
26
65
|
}
|
|
27
|
-
|
|
66
|
+
var isBrowser = typeof window !== "undefined";
|
|
28
67
|
this.data = {};
|
|
29
68
|
|
|
30
69
|
// Auto-configure storage adaptor
|
|
31
|
-
|
|
70
|
+
var storageAdaptor = localStorageAdaptor;
|
|
32
71
|
if (!storageAdaptor && isBrowser && useCookies) {
|
|
33
72
|
// Use cookies by default in browser for better server-side compatibility
|
|
34
|
-
storageAdaptor = new
|
|
73
|
+
storageAdaptor = new _cookie_storage_adaptor["default"]({
|
|
35
74
|
secure: window.location.protocol === 'https:',
|
|
36
75
|
sameSite: 'Lax',
|
|
37
76
|
maxAge: 24 * 60 * 60 // 24 hours
|
|
38
77
|
});
|
|
39
|
-
console.log('[Roboto] Using CookieStorageAdaptor for authentication tokens');
|
|
40
|
-
|
|
41
78
|
// Set accessKey for server-side authentication (handled automatically by adapter)
|
|
42
79
|
if (accessKey) {
|
|
43
|
-
storageAdaptor.setItem('accessKey', accessKey)
|
|
80
|
+
storageAdaptor.setItem('accessKey', accessKey)["catch"](function (e) {
|
|
81
|
+
return void 0;
|
|
82
|
+
});
|
|
44
83
|
}
|
|
45
84
|
}
|
|
46
85
|
this.config = {
|
|
47
|
-
|
|
86
|
+
accesskey: accessKey,
|
|
48
87
|
// Use passed accessKey
|
|
49
|
-
baseUrl:
|
|
88
|
+
baseUrl: "https://".concat(host),
|
|
50
89
|
// Use passed host
|
|
51
90
|
localStorageAdaptor: storageAdaptor
|
|
52
91
|
};
|
|
53
92
|
|
|
93
|
+
// Add apikey and authtoken if provided directly
|
|
94
|
+
if (apiKey) {
|
|
95
|
+
this.config.apikey = apiKey;
|
|
96
|
+
}
|
|
97
|
+
if (authToken) {
|
|
98
|
+
this.config.authtoken = authToken;
|
|
99
|
+
}
|
|
100
|
+
|
|
54
101
|
// DEVELOPMENT
|
|
55
102
|
this.config.baseUrl = this._stripHttpsForDomains(this.config.baseUrl, ['localhost']);
|
|
56
103
|
|
|
57
104
|
// Check if a request object is provided
|
|
58
105
|
if (proxyReq && proxyReq.headers) {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
106
|
+
var header_authtoken = proxyReq.headers.authtoken;
|
|
107
|
+
var header_accesskey = proxyReq.headers.accesskey;
|
|
108
|
+
var header_apikey = proxyReq.headers.apikey;
|
|
62
109
|
// Optionally add more headers as needed
|
|
63
|
-
if (
|
|
64
|
-
this.config.authtoken =
|
|
110
|
+
if (header_authtoken) {
|
|
111
|
+
this.config.authtoken = header_authtoken; // Set the authtoken in the config
|
|
65
112
|
}
|
|
66
|
-
if (
|
|
67
|
-
this.config.apikey =
|
|
113
|
+
if (header_apikey) {
|
|
114
|
+
this.config.apikey = header_apikey; // Set the authtoken in the config
|
|
68
115
|
}
|
|
69
|
-
if (
|
|
70
|
-
this.config.accesskey =
|
|
116
|
+
if (header_accesskey) {
|
|
117
|
+
this.config.accesskey = header_accesskey; // Set the accesskey in the config
|
|
71
118
|
}
|
|
72
119
|
}
|
|
73
|
-
this.api = new
|
|
120
|
+
this.api = new _rbt_api["default"](this.config);
|
|
74
121
|
if (isBrowser) {
|
|
75
122
|
this.api.initLocalDb();
|
|
76
123
|
|
|
77
124
|
// Add global debug method for cookie storage adapter
|
|
78
125
|
if (this.config.localStorageAdaptor && this.config.localStorageAdaptor.debugState) {
|
|
79
|
-
window.debugRobotoCookies = ()
|
|
80
|
-
|
|
126
|
+
window.debugRobotoCookies = function () {
|
|
127
|
+
return _this.config.localStorageAdaptor.debugState();
|
|
128
|
+
};
|
|
81
129
|
}
|
|
82
130
|
}
|
|
83
131
|
|
|
84
132
|
// METRICS API instance (separate host or same)
|
|
85
133
|
if (metricsHost && metricsHost !== host) {
|
|
86
|
-
|
|
134
|
+
var metricsUrl = metricsHost.startsWith('http') ? metricsHost : "https://".concat(metricsHost);
|
|
87
135
|
// You can customize headers if needed
|
|
88
|
-
this.metrics = new
|
|
136
|
+
this.metrics = new _rbt_metrics_api["default"]({
|
|
89
137
|
config: {
|
|
90
138
|
baseURL: this._stripHttpsForDomains(metricsUrl, ['localhost']),
|
|
91
139
|
headers: {
|
|
@@ -95,153 +143,527 @@ export default class Roboto {
|
|
|
95
143
|
});
|
|
96
144
|
} else {
|
|
97
145
|
// Use the same axios instance as main API
|
|
98
|
-
this.metrics = new
|
|
146
|
+
this.metrics = new _rbt_metrics_api["default"]({
|
|
99
147
|
axiosInstance: this.api.axios
|
|
100
148
|
});
|
|
101
149
|
}
|
|
102
150
|
Roboto.instance = this;
|
|
103
151
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
152
|
+
_createClass(Roboto, [{
|
|
153
|
+
key: "getVersion",
|
|
154
|
+
value: function getVersion() {
|
|
155
|
+
return '1.7.3';
|
|
156
|
+
}
|
|
157
|
+
}, {
|
|
158
|
+
key: "setSiteEnv",
|
|
159
|
+
value: function setSiteEnv(siteEnv) {
|
|
160
|
+
this.api.setSiteEnv(siteEnv);
|
|
161
|
+
}
|
|
162
|
+
}, {
|
|
163
|
+
key: "getSiteEnv",
|
|
164
|
+
value: function getSiteEnv() {
|
|
165
|
+
var key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
166
|
+
return this.api.getSiteEnv(key);
|
|
167
|
+
}
|
|
168
|
+
}, {
|
|
169
|
+
key: "setItem",
|
|
170
|
+
value: function setItem(key, value) {
|
|
171
|
+
this.data[key] = value;
|
|
172
|
+
}
|
|
173
|
+
}, {
|
|
174
|
+
key: "getItem",
|
|
175
|
+
value: function getItem(key) {
|
|
176
|
+
return this.data[key];
|
|
177
|
+
}
|
|
178
|
+
}, {
|
|
179
|
+
key: "setAppServiceHost",
|
|
180
|
+
value: function setAppServiceHost(host) {
|
|
181
|
+
// DEVELOPMENT
|
|
182
|
+
host = this._stripHttpsForDomains(host, ['localhost']);
|
|
183
|
+
this.api.setAppServiceHost(host);
|
|
184
|
+
}
|
|
185
|
+
}, {
|
|
186
|
+
key: "setMetricsHost",
|
|
187
|
+
value: function setMetricsHost(host) {
|
|
188
|
+
this.metricsHost = host;
|
|
189
|
+
var metricsUrl = host.startsWith('http') ? host : "https://".concat(host);
|
|
190
|
+
this.metrics = new _rbt_metrics_api["default"]({
|
|
191
|
+
config: {
|
|
192
|
+
baseURL: this._stripHttpsForDomains(metricsUrl, ['localhost']),
|
|
193
|
+
headers: {
|
|
194
|
+
accesskey: this.config.accessKey
|
|
195
|
+
}
|
|
129
196
|
}
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
}, {
|
|
200
|
+
key: "registerTypedefs",
|
|
201
|
+
value: function registerTypedefs(typedefs) {
|
|
202
|
+
this.api.registerTypedefs(typedefs);
|
|
203
|
+
}
|
|
204
|
+
}, {
|
|
205
|
+
key: "setErrorHandler",
|
|
206
|
+
value: function setErrorHandler(customErrorHandler) {
|
|
207
|
+
if (this.api) {
|
|
208
|
+
this.api.setErrorHandler(customErrorHandler);
|
|
130
209
|
}
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
registerTypedefs(typedefs) {
|
|
134
|
-
this.api.registerTypedefs(typedefs);
|
|
135
|
-
}
|
|
136
|
-
setErrorHandler(customErrorHandler) {
|
|
137
|
-
if (this.api) {
|
|
138
|
-
this.api.setErrorHandler(customErrorHandler);
|
|
139
210
|
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
async login(params) {
|
|
152
|
-
return this.api.login(params);
|
|
153
|
-
}
|
|
154
|
-
async loginWithOauth(params) {
|
|
155
|
-
return this.api.loginWithOauth(params);
|
|
156
|
-
}
|
|
157
|
-
async logout() {
|
|
158
|
-
const result = await this.api.logout();
|
|
159
|
-
|
|
160
|
-
// Clear accessKey and authtoken using standard localStorage interface
|
|
161
|
-
if (this.config.localStorageAdaptor) {
|
|
162
|
-
await this.config.localStorageAdaptor.removeItem('accessKey');
|
|
163
|
-
await this.config.localStorageAdaptor.removeItem('authtoken');
|
|
211
|
+
}, {
|
|
212
|
+
key: "recordToInstance",
|
|
213
|
+
value: function recordToInstance(recordHash) {
|
|
214
|
+
return new _rbt_object["default"](recordHash, this.api.axios);
|
|
215
|
+
}
|
|
216
|
+
}, {
|
|
217
|
+
key: "_stripHttpsForDomains",
|
|
218
|
+
value: function _stripHttpsForDomains(baseUrl, domains) {
|
|
219
|
+
return baseUrl.replace(new RegExp("^https://(".concat(domains.map(function (domain) {
|
|
220
|
+
return domain.replace(/\./g, '\\.');
|
|
221
|
+
}).join('|'), ")")), 'http://$1');
|
|
164
222
|
}
|
|
165
|
-
return result;
|
|
166
|
-
}
|
|
167
|
-
async refreshAuthToken() {
|
|
168
|
-
return this.api.refreshAuthToken(this.config.authtoken);
|
|
169
|
-
}
|
|
170
|
-
async registerUser(params) {
|
|
171
|
-
// TODO - need to
|
|
172
|
-
|
|
173
|
-
return this.api.registerUser(params);
|
|
174
|
-
}
|
|
175
|
-
async loadUser(params) {
|
|
176
|
-
return this.api.loadUser(params);
|
|
177
|
-
}
|
|
178
|
-
async loadCurrentUser() {
|
|
179
|
-
return this.api.loadCurrentUser();
|
|
180
|
-
}
|
|
181
|
-
async loadCurrentUserExtended() {
|
|
182
|
-
return this.api.loadCurrentUserExtended();
|
|
183
|
-
}
|
|
184
|
-
async getCurrentUser() {
|
|
185
|
-
return this.api.getCurrentUser();
|
|
186
|
-
}
|
|
187
|
-
async confirmUserEmail(params) {
|
|
188
|
-
return this.api.confirmUserEmail(params);
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
//
|
|
192
|
-
// create and upload files
|
|
193
|
-
//
|
|
194
|
-
async createFile(data = {}) {
|
|
195
|
-
return this.api.createFile(data);
|
|
196
|
-
}
|
|
197
|
-
async loadFile(id) {
|
|
198
|
-
return this.api.loadFile(id);
|
|
199
|
-
}
|
|
200
|
-
async loadFiles(ids) {
|
|
201
|
-
return this.api.loadFiles(ids);
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
//
|
|
205
|
-
//
|
|
206
|
-
//
|
|
207
|
-
async create(params, data = {}) {
|
|
208
|
-
return this.api.create(params, data);
|
|
209
|
-
}
|
|
210
|
-
async load(type, ids, options) {
|
|
211
|
-
return this.api.load(type, ids, options);
|
|
212
|
-
}
|
|
213
|
-
async query(type, params) {
|
|
214
|
-
return this.api.query(type, params);
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
// WebSocket methods
|
|
218
|
-
getWebSocketClient() {
|
|
219
|
-
return this.api.getWebSocketClient();
|
|
220
|
-
}
|
|
221
|
-
closeWebSocket() {
|
|
222
|
-
return this.api.closeWebSocket();
|
|
223
|
-
}
|
|
224
223
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
224
|
+
//
|
|
225
|
+
// User register, login, and refresh token
|
|
226
|
+
//
|
|
227
|
+
}, {
|
|
228
|
+
key: "login",
|
|
229
|
+
value: function () {
|
|
230
|
+
var _login = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(params) {
|
|
231
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
232
|
+
while (1) switch (_context.prev = _context.next) {
|
|
233
|
+
case 0:
|
|
234
|
+
return _context.abrupt("return", this.api.login(params));
|
|
235
|
+
case 1:
|
|
236
|
+
case "end":
|
|
237
|
+
return _context.stop();
|
|
238
|
+
}
|
|
239
|
+
}, _callee, this);
|
|
240
|
+
}));
|
|
241
|
+
function login(_x) {
|
|
242
|
+
return _login.apply(this, arguments);
|
|
243
|
+
}
|
|
244
|
+
return login;
|
|
245
|
+
}()
|
|
246
|
+
}, {
|
|
247
|
+
key: "loginWithOauth",
|
|
248
|
+
value: function () {
|
|
249
|
+
var _loginWithOauth = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
|
|
250
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
251
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
252
|
+
case 0:
|
|
253
|
+
return _context2.abrupt("return", this.api.loginWithOauth(params));
|
|
254
|
+
case 1:
|
|
255
|
+
case "end":
|
|
256
|
+
return _context2.stop();
|
|
257
|
+
}
|
|
258
|
+
}, _callee2, this);
|
|
259
|
+
}));
|
|
260
|
+
function loginWithOauth(_x2) {
|
|
261
|
+
return _loginWithOauth.apply(this, arguments);
|
|
262
|
+
}
|
|
263
|
+
return loginWithOauth;
|
|
264
|
+
}()
|
|
265
|
+
}, {
|
|
266
|
+
key: "logout",
|
|
267
|
+
value: function () {
|
|
268
|
+
var _logout = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
269
|
+
var result;
|
|
270
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
271
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
272
|
+
case 0:
|
|
273
|
+
_context3.next = 2;
|
|
274
|
+
return this.api.logout();
|
|
275
|
+
case 2:
|
|
276
|
+
result = _context3.sent;
|
|
277
|
+
if (!this.config.localStorageAdaptor) {
|
|
278
|
+
_context3.next = 8;
|
|
279
|
+
break;
|
|
280
|
+
}
|
|
281
|
+
_context3.next = 6;
|
|
282
|
+
return this.config.localStorageAdaptor.removeItem('accessKey');
|
|
283
|
+
case 6:
|
|
284
|
+
_context3.next = 8;
|
|
285
|
+
return this.config.localStorageAdaptor.removeItem('authtoken');
|
|
286
|
+
case 8:
|
|
287
|
+
return _context3.abrupt("return", result);
|
|
288
|
+
case 9:
|
|
289
|
+
case "end":
|
|
290
|
+
return _context3.stop();
|
|
291
|
+
}
|
|
292
|
+
}, _callee3, this);
|
|
293
|
+
}));
|
|
294
|
+
function logout() {
|
|
295
|
+
return _logout.apply(this, arguments);
|
|
296
|
+
}
|
|
297
|
+
return logout;
|
|
298
|
+
}()
|
|
299
|
+
}, {
|
|
300
|
+
key: "refreshAuthToken",
|
|
301
|
+
value: function () {
|
|
302
|
+
var _refreshAuthToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
303
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
304
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
305
|
+
case 0:
|
|
306
|
+
return _context4.abrupt("return", this.api.refreshAuthToken(this.config.authtoken));
|
|
307
|
+
case 1:
|
|
308
|
+
case "end":
|
|
309
|
+
return _context4.stop();
|
|
310
|
+
}
|
|
311
|
+
}, _callee4, this);
|
|
312
|
+
}));
|
|
313
|
+
function refreshAuthToken() {
|
|
314
|
+
return _refreshAuthToken.apply(this, arguments);
|
|
315
|
+
}
|
|
316
|
+
return refreshAuthToken;
|
|
317
|
+
}()
|
|
318
|
+
}, {
|
|
319
|
+
key: "registerUser",
|
|
320
|
+
value: function () {
|
|
321
|
+
var _registerUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(params) {
|
|
322
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
323
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
324
|
+
case 0:
|
|
325
|
+
return _context5.abrupt("return", this.api.registerUser(params));
|
|
326
|
+
case 1:
|
|
327
|
+
case "end":
|
|
328
|
+
return _context5.stop();
|
|
329
|
+
}
|
|
330
|
+
}, _callee5, this);
|
|
331
|
+
}));
|
|
332
|
+
function registerUser(_x3) {
|
|
333
|
+
return _registerUser.apply(this, arguments);
|
|
334
|
+
}
|
|
335
|
+
return registerUser;
|
|
336
|
+
}()
|
|
337
|
+
}, {
|
|
338
|
+
key: "loadUser",
|
|
339
|
+
value: function () {
|
|
340
|
+
var _loadUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(params) {
|
|
341
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
342
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
343
|
+
case 0:
|
|
344
|
+
return _context6.abrupt("return", this.api.loadUser(params));
|
|
345
|
+
case 1:
|
|
346
|
+
case "end":
|
|
347
|
+
return _context6.stop();
|
|
348
|
+
}
|
|
349
|
+
}, _callee6, this);
|
|
350
|
+
}));
|
|
351
|
+
function loadUser(_x4) {
|
|
352
|
+
return _loadUser.apply(this, arguments);
|
|
353
|
+
}
|
|
354
|
+
return loadUser;
|
|
355
|
+
}()
|
|
356
|
+
}, {
|
|
357
|
+
key: "loadCurrentUser",
|
|
358
|
+
value: function () {
|
|
359
|
+
var _loadCurrentUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
|
|
360
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
361
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
362
|
+
case 0:
|
|
363
|
+
return _context7.abrupt("return", this.api.loadCurrentUser());
|
|
364
|
+
case 1:
|
|
365
|
+
case "end":
|
|
366
|
+
return _context7.stop();
|
|
367
|
+
}
|
|
368
|
+
}, _callee7, this);
|
|
369
|
+
}));
|
|
370
|
+
function loadCurrentUser() {
|
|
371
|
+
return _loadCurrentUser.apply(this, arguments);
|
|
372
|
+
}
|
|
373
|
+
return loadCurrentUser;
|
|
374
|
+
}()
|
|
375
|
+
}, {
|
|
376
|
+
key: "loadCurrentUserExtended",
|
|
377
|
+
value: function () {
|
|
378
|
+
var _loadCurrentUserExtended = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
|
379
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
380
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
381
|
+
case 0:
|
|
382
|
+
return _context8.abrupt("return", this.api.loadCurrentUserExtended());
|
|
383
|
+
case 1:
|
|
384
|
+
case "end":
|
|
385
|
+
return _context8.stop();
|
|
386
|
+
}
|
|
387
|
+
}, _callee8, this);
|
|
388
|
+
}));
|
|
389
|
+
function loadCurrentUserExtended() {
|
|
390
|
+
return _loadCurrentUserExtended.apply(this, arguments);
|
|
391
|
+
}
|
|
392
|
+
return loadCurrentUserExtended;
|
|
393
|
+
}()
|
|
394
|
+
}, {
|
|
395
|
+
key: "getCurrentUser",
|
|
396
|
+
value: function () {
|
|
397
|
+
var _getCurrentUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
|
|
398
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
399
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
400
|
+
case 0:
|
|
401
|
+
return _context9.abrupt("return", this.api.getCurrentUser());
|
|
402
|
+
case 1:
|
|
403
|
+
case "end":
|
|
404
|
+
return _context9.stop();
|
|
405
|
+
}
|
|
406
|
+
}, _callee9, this);
|
|
407
|
+
}));
|
|
408
|
+
function getCurrentUser() {
|
|
409
|
+
return _getCurrentUser.apply(this, arguments);
|
|
410
|
+
}
|
|
411
|
+
return getCurrentUser;
|
|
412
|
+
}()
|
|
413
|
+
}, {
|
|
414
|
+
key: "confirmUserEmail",
|
|
415
|
+
value: function () {
|
|
416
|
+
var _confirmUserEmail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(params) {
|
|
417
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
418
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
419
|
+
case 0:
|
|
420
|
+
return _context10.abrupt("return", this.api.confirmUserEmail(params));
|
|
421
|
+
case 1:
|
|
422
|
+
case "end":
|
|
423
|
+
return _context10.stop();
|
|
424
|
+
}
|
|
425
|
+
}, _callee10, this);
|
|
426
|
+
}));
|
|
427
|
+
function confirmUserEmail(_x5) {
|
|
428
|
+
return _confirmUserEmail.apply(this, arguments);
|
|
429
|
+
}
|
|
430
|
+
return confirmUserEmail;
|
|
431
|
+
}() //
|
|
432
|
+
// create and upload files
|
|
433
|
+
//
|
|
434
|
+
}, {
|
|
435
|
+
key: "createFile",
|
|
436
|
+
value: function () {
|
|
437
|
+
var _createFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
|
|
438
|
+
var data,
|
|
439
|
+
_args11 = arguments;
|
|
440
|
+
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
441
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
442
|
+
case 0:
|
|
443
|
+
data = _args11.length > 0 && _args11[0] !== undefined ? _args11[0] : {};
|
|
444
|
+
return _context11.abrupt("return", this.api.createFile(data));
|
|
445
|
+
case 2:
|
|
446
|
+
case "end":
|
|
447
|
+
return _context11.stop();
|
|
448
|
+
}
|
|
449
|
+
}, _callee11, this);
|
|
450
|
+
}));
|
|
451
|
+
function createFile() {
|
|
452
|
+
return _createFile.apply(this, arguments);
|
|
453
|
+
}
|
|
454
|
+
return createFile;
|
|
455
|
+
}()
|
|
456
|
+
}, {
|
|
457
|
+
key: "loadFile",
|
|
458
|
+
value: function () {
|
|
459
|
+
var _loadFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(id) {
|
|
460
|
+
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
461
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
462
|
+
case 0:
|
|
463
|
+
return _context12.abrupt("return", this.api.loadFile(id));
|
|
464
|
+
case 1:
|
|
465
|
+
case "end":
|
|
466
|
+
return _context12.stop();
|
|
467
|
+
}
|
|
468
|
+
}, _callee12, this);
|
|
469
|
+
}));
|
|
470
|
+
function loadFile(_x6) {
|
|
471
|
+
return _loadFile.apply(this, arguments);
|
|
472
|
+
}
|
|
473
|
+
return loadFile;
|
|
474
|
+
}()
|
|
475
|
+
}, {
|
|
476
|
+
key: "loadFiles",
|
|
477
|
+
value: function () {
|
|
478
|
+
var _loadFiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(ids) {
|
|
479
|
+
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
480
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
481
|
+
case 0:
|
|
482
|
+
return _context13.abrupt("return", this.api.loadFiles(ids));
|
|
483
|
+
case 1:
|
|
484
|
+
case "end":
|
|
485
|
+
return _context13.stop();
|
|
486
|
+
}
|
|
487
|
+
}, _callee13, this);
|
|
488
|
+
}));
|
|
489
|
+
function loadFiles(_x7) {
|
|
490
|
+
return _loadFiles.apply(this, arguments);
|
|
491
|
+
}
|
|
492
|
+
return loadFiles;
|
|
493
|
+
}() //
|
|
494
|
+
//
|
|
495
|
+
//
|
|
496
|
+
}, {
|
|
497
|
+
key: "create",
|
|
498
|
+
value: function () {
|
|
499
|
+
var _create = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(params) {
|
|
500
|
+
var data,
|
|
501
|
+
_args14 = arguments;
|
|
502
|
+
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
503
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
504
|
+
case 0:
|
|
505
|
+
data = _args14.length > 1 && _args14[1] !== undefined ? _args14[1] : {};
|
|
506
|
+
return _context14.abrupt("return", this.api.create(params, data));
|
|
507
|
+
case 2:
|
|
508
|
+
case "end":
|
|
509
|
+
return _context14.stop();
|
|
510
|
+
}
|
|
511
|
+
}, _callee14, this);
|
|
512
|
+
}));
|
|
513
|
+
function create(_x8) {
|
|
514
|
+
return _create.apply(this, arguments);
|
|
515
|
+
}
|
|
516
|
+
return create;
|
|
517
|
+
}()
|
|
518
|
+
}, {
|
|
519
|
+
key: "load",
|
|
520
|
+
value: function () {
|
|
521
|
+
var _load = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(type, ids, options) {
|
|
522
|
+
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
523
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
524
|
+
case 0:
|
|
525
|
+
return _context15.abrupt("return", this.api.load(type, ids, options));
|
|
526
|
+
case 1:
|
|
527
|
+
case "end":
|
|
528
|
+
return _context15.stop();
|
|
529
|
+
}
|
|
530
|
+
}, _callee15, this);
|
|
531
|
+
}));
|
|
532
|
+
function load(_x9, _x10, _x11) {
|
|
533
|
+
return _load.apply(this, arguments);
|
|
534
|
+
}
|
|
535
|
+
return load;
|
|
536
|
+
}()
|
|
537
|
+
}, {
|
|
538
|
+
key: "query",
|
|
539
|
+
value: function () {
|
|
540
|
+
var _query = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(type, params) {
|
|
541
|
+
return _regeneratorRuntime().wrap(function _callee16$(_context16) {
|
|
542
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
543
|
+
case 0:
|
|
544
|
+
return _context16.abrupt("return", this.api.query(type, params));
|
|
545
|
+
case 1:
|
|
546
|
+
case "end":
|
|
547
|
+
return _context16.stop();
|
|
548
|
+
}
|
|
549
|
+
}, _callee16, this);
|
|
550
|
+
}));
|
|
551
|
+
function query(_x12, _x13) {
|
|
552
|
+
return _query.apply(this, arguments);
|
|
553
|
+
}
|
|
554
|
+
return query;
|
|
555
|
+
}() // WebSocket methods
|
|
556
|
+
}, {
|
|
557
|
+
key: "getWebSocketClient",
|
|
558
|
+
value: function getWebSocketClient() {
|
|
559
|
+
return this.api.getWebSocketClient();
|
|
560
|
+
}
|
|
561
|
+
}, {
|
|
562
|
+
key: "closeWebSocket",
|
|
563
|
+
value: function closeWebSocket() {
|
|
564
|
+
return this.api.closeWebSocket();
|
|
565
|
+
}
|
|
237
566
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
567
|
+
//
|
|
568
|
+
//
|
|
569
|
+
//
|
|
570
|
+
}, {
|
|
571
|
+
key: "runTask",
|
|
572
|
+
value: function () {
|
|
573
|
+
var _runTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(params, callbacks) {
|
|
574
|
+
return _regeneratorRuntime().wrap(function _callee17$(_context17) {
|
|
575
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
576
|
+
case 0:
|
|
577
|
+
return _context17.abrupt("return", this.api.runTask(params, callbacks));
|
|
578
|
+
case 1:
|
|
579
|
+
case "end":
|
|
580
|
+
return _context17.stop();
|
|
581
|
+
}
|
|
582
|
+
}, _callee17, this);
|
|
583
|
+
}));
|
|
584
|
+
function runTask(_x14, _x15) {
|
|
585
|
+
return _runTask.apply(this, arguments);
|
|
586
|
+
}
|
|
587
|
+
return runTask;
|
|
588
|
+
}()
|
|
589
|
+
}, {
|
|
590
|
+
key: "stopJob",
|
|
591
|
+
value: function () {
|
|
592
|
+
var _stopJob = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(params, callbacks) {
|
|
593
|
+
return _regeneratorRuntime().wrap(function _callee18$(_context18) {
|
|
594
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
595
|
+
case 0:
|
|
596
|
+
return _context18.abrupt("return", this.api.stopJob(params, callbacks));
|
|
597
|
+
case 1:
|
|
598
|
+
case "end":
|
|
599
|
+
return _context18.stop();
|
|
600
|
+
}
|
|
601
|
+
}, _callee18, this);
|
|
602
|
+
}));
|
|
603
|
+
function stopJob(_x16, _x17) {
|
|
604
|
+
return _stopJob.apply(this, arguments);
|
|
605
|
+
}
|
|
606
|
+
return stopJob;
|
|
607
|
+
}()
|
|
608
|
+
}, {
|
|
609
|
+
key: "pollTaskProgress",
|
|
610
|
+
value: function () {
|
|
611
|
+
var _pollTaskProgress = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(params) {
|
|
612
|
+
return _regeneratorRuntime().wrap(function _callee19$(_context19) {
|
|
613
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
614
|
+
case 0:
|
|
615
|
+
return _context19.abrupt("return", this.api.pollTaskProgress(params));
|
|
616
|
+
case 1:
|
|
617
|
+
case "end":
|
|
618
|
+
return _context19.stop();
|
|
619
|
+
}
|
|
620
|
+
}, _callee19, this);
|
|
621
|
+
}));
|
|
622
|
+
function pollTaskProgress(_x18) {
|
|
623
|
+
return _pollTaskProgress.apply(this, arguments);
|
|
624
|
+
}
|
|
625
|
+
return pollTaskProgress;
|
|
626
|
+
}() //
|
|
627
|
+
// Get/Post to endpoint with Roboto authtoken
|
|
628
|
+
//
|
|
629
|
+
}, {
|
|
630
|
+
key: "get",
|
|
631
|
+
value: function () {
|
|
632
|
+
var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(endpoint, params) {
|
|
633
|
+
return _regeneratorRuntime().wrap(function _callee20$(_context20) {
|
|
634
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
635
|
+
case 0:
|
|
636
|
+
return _context20.abrupt("return", this.api.get(endpoint, params));
|
|
637
|
+
case 1:
|
|
638
|
+
case "end":
|
|
639
|
+
return _context20.stop();
|
|
640
|
+
}
|
|
641
|
+
}, _callee20, this);
|
|
642
|
+
}));
|
|
643
|
+
function get(_x19, _x20) {
|
|
644
|
+
return _get.apply(this, arguments);
|
|
645
|
+
}
|
|
646
|
+
return get;
|
|
647
|
+
}()
|
|
648
|
+
}, {
|
|
649
|
+
key: "post",
|
|
650
|
+
value: function () {
|
|
651
|
+
var _post = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(endpoint, data) {
|
|
652
|
+
return _regeneratorRuntime().wrap(function _callee21$(_context21) {
|
|
653
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
654
|
+
case 0:
|
|
655
|
+
return _context21.abrupt("return", this.api.post(endpoint, data));
|
|
656
|
+
case 1:
|
|
657
|
+
case "end":
|
|
658
|
+
return _context21.stop();
|
|
659
|
+
}
|
|
660
|
+
}, _callee21, this);
|
|
661
|
+
}));
|
|
662
|
+
function post(_x21, _x22) {
|
|
663
|
+
return _post.apply(this, arguments);
|
|
664
|
+
}
|
|
665
|
+
return post;
|
|
666
|
+
}()
|
|
667
|
+
}]);
|
|
668
|
+
return Roboto;
|
|
669
|
+
}();
|