roboto-js 1.2.2 → 1.3.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/dist/cjs/index.cjs +8 -8
- package/dist/esm/index.js +8 -7
- package/package.json +1 -1
- package/src/index.js +7 -12
package/dist/cjs/index.cjs
CHANGED
|
@@ -36,10 +36,12 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
36
36
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
37
37
|
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); }
|
|
38
38
|
var Roboto = exports["default"] = /*#__PURE__*/function () {
|
|
39
|
-
function Roboto() {
|
|
40
|
-
var proxyReq =
|
|
39
|
+
function Roboto(_ref) {
|
|
40
|
+
var _ref$proxyReq = _ref.proxyReq,
|
|
41
|
+
proxyReq = _ref$proxyReq === void 0 ? null : _ref$proxyReq,
|
|
42
|
+
host = _ref.host,
|
|
43
|
+
apiKey = _ref.apiKey;
|
|
41
44
|
_classCallCheck(this, Roboto);
|
|
42
|
-
debugger;
|
|
43
45
|
if (Roboto.instance && !proxyReq) {
|
|
44
46
|
// if on client, there can only be one instance
|
|
45
47
|
// on server, with proxyReq, each request has its own instance
|
|
@@ -47,8 +49,9 @@ var Roboto = exports["default"] = /*#__PURE__*/function () {
|
|
|
47
49
|
}
|
|
48
50
|
var isBrowser = typeof window !== "undefined";
|
|
49
51
|
this.config = {
|
|
50
|
-
apiKey:
|
|
51
|
-
|
|
52
|
+
apiKey: apiKey,
|
|
53
|
+
// Use passed apiKey
|
|
54
|
+
baseUrl: "https://".concat(host) // Use passed host
|
|
52
55
|
};
|
|
53
56
|
|
|
54
57
|
// DEVELOPMENT
|
|
@@ -66,9 +69,6 @@ var Roboto = exports["default"] = /*#__PURE__*/function () {
|
|
|
66
69
|
this.config.accesskey = accesskey; // Set the accesskey in the config
|
|
67
70
|
}
|
|
68
71
|
}
|
|
69
|
-
http:
|
|
70
|
-
//localhost:3002
|
|
71
|
-
|
|
72
72
|
this.api = new _rbt_api["default"](this.config);
|
|
73
73
|
if (isBrowser) {
|
|
74
74
|
this.api.initLocalDb();
|
package/dist/esm/index.js
CHANGED
|
@@ -6,8 +6,11 @@ export { RbtApi, RbtObject, RbtFile
|
|
|
6
6
|
//Site
|
|
7
7
|
};
|
|
8
8
|
export default class Roboto {
|
|
9
|
-
constructor(
|
|
10
|
-
|
|
9
|
+
constructor({
|
|
10
|
+
proxyReq = null,
|
|
11
|
+
host,
|
|
12
|
+
apiKey
|
|
13
|
+
}) {
|
|
11
14
|
if (Roboto.instance && !proxyReq) {
|
|
12
15
|
// if on client, there can only be one instance
|
|
13
16
|
// on server, with proxyReq, each request has its own instance
|
|
@@ -15,8 +18,9 @@ export default class Roboto {
|
|
|
15
18
|
}
|
|
16
19
|
const isBrowser = typeof window !== "undefined";
|
|
17
20
|
this.config = {
|
|
18
|
-
apiKey:
|
|
19
|
-
|
|
21
|
+
apiKey: apiKey,
|
|
22
|
+
// Use passed apiKey
|
|
23
|
+
baseUrl: `https://${host}` // Use passed host
|
|
20
24
|
};
|
|
21
25
|
|
|
22
26
|
// DEVELOPMENT
|
|
@@ -34,9 +38,6 @@ export default class Roboto {
|
|
|
34
38
|
this.config.accesskey = accesskey; // Set the accesskey in the config
|
|
35
39
|
}
|
|
36
40
|
}
|
|
37
|
-
http:
|
|
38
|
-
//localhost:3002
|
|
39
|
-
|
|
40
41
|
this.api = new RbtApi(this.config);
|
|
41
42
|
if (isBrowser) {
|
|
42
43
|
this.api.initLocalDb();
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -13,11 +13,9 @@ export {
|
|
|
13
13
|
|
|
14
14
|
export default class Roboto{
|
|
15
15
|
|
|
16
|
-
constructor(proxyReq = null) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
if(Roboto.instance && !proxyReq){
|
|
16
|
+
constructor({ proxyReq = null, host, apiKey }) {
|
|
17
|
+
|
|
18
|
+
if (Roboto.instance && !proxyReq) {
|
|
21
19
|
// if on client, there can only be one instance
|
|
22
20
|
// on server, with proxyReq, each request has its own instance
|
|
23
21
|
return Roboto.instance;
|
|
@@ -26,13 +24,12 @@ export default class Roboto{
|
|
|
26
24
|
const isBrowser = typeof window !== "undefined";
|
|
27
25
|
|
|
28
26
|
this.config = {
|
|
29
|
-
apiKey:
|
|
30
|
-
baseUrl:
|
|
27
|
+
apiKey: apiKey, // Use passed apiKey
|
|
28
|
+
baseUrl: `https://${host}` // Use passed host
|
|
31
29
|
};
|
|
32
30
|
|
|
33
31
|
// DEVELOPMENT
|
|
34
|
-
this.config.baseUrl = this._stripHttpsForDomains(this.config.baseUrl, ['localhost','rbt.dorfio.com']);
|
|
35
|
-
|
|
32
|
+
this.config.baseUrl = this._stripHttpsForDomains(this.config.baseUrl, ['localhost', 'rbt.dorfio.com']);
|
|
36
33
|
|
|
37
34
|
// Check if a request object is provided
|
|
38
35
|
if (proxyReq && proxyReq.headers) {
|
|
@@ -46,15 +43,13 @@ export default class Roboto{
|
|
|
46
43
|
this.config.accesskey = accesskey; // Set the accesskey in the config
|
|
47
44
|
}
|
|
48
45
|
}
|
|
49
|
-
http://localhost:3002
|
|
50
46
|
|
|
51
47
|
this.api = new RbtApi(this.config);
|
|
52
|
-
if(isBrowser){
|
|
48
|
+
if (isBrowser) {
|
|
53
49
|
this.api.initLocalDb();
|
|
54
50
|
}
|
|
55
51
|
|
|
56
52
|
Roboto.instance = this;
|
|
57
|
-
|
|
58
53
|
}
|
|
59
54
|
|
|
60
55
|
setAppServiceHost(host){
|