roboto-js 1.1.14 → 1.1.15
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 +10 -6
- package/dist/esm/index.js +6 -4
- package/package.json +1 -1
- package/src/index.js +8 -4
package/dist/cjs/index.cjs
CHANGED
|
@@ -52,12 +52,7 @@ var Roboto = exports["default"] = /*#__PURE__*/function () {
|
|
|
52
52
|
};
|
|
53
53
|
|
|
54
54
|
// DEVELOPMENT
|
|
55
|
-
|
|
56
|
-
return baseUrl.replace(new RegExp("^https://(".concat(domains.map(function (domain) {
|
|
57
|
-
return domain.replace(/\./g, '\\.');
|
|
58
|
-
}).join('|'), ")")), 'http://$1');
|
|
59
|
-
}
|
|
60
|
-
this.config.baseUrl = stripHttpsForDomains(this.config.baseUrl, ['localhost', 'rbt.dorfio.com']);
|
|
55
|
+
this.config.baseUrl = this._stripHttpsForDomains(this.config.baseUrl, ['localhost', 'rbt.dorfio.com']);
|
|
61
56
|
|
|
62
57
|
// Check if a request object is provided
|
|
63
58
|
if (proxyReq && proxyReq.headers) {
|
|
@@ -83,6 +78,8 @@ var Roboto = exports["default"] = /*#__PURE__*/function () {
|
|
|
83
78
|
_createClass(Roboto, [{
|
|
84
79
|
key: "setAppServiceHost",
|
|
85
80
|
value: function setAppServiceHost(host) {
|
|
81
|
+
// DEVELOPMENT
|
|
82
|
+
host = this._stripHttpsForDomains(host, ['localhost', 'rbt.dorfio.com']);
|
|
86
83
|
this.api.setAppServiceHost(host);
|
|
87
84
|
}
|
|
88
85
|
}, {
|
|
@@ -92,6 +89,13 @@ var Roboto = exports["default"] = /*#__PURE__*/function () {
|
|
|
92
89
|
this.api.setErrorHandler(customErrorHandler);
|
|
93
90
|
}
|
|
94
91
|
}
|
|
92
|
+
}, {
|
|
93
|
+
key: "_stripHttpsForDomains",
|
|
94
|
+
value: function _stripHttpsForDomains(baseUrl, domains) {
|
|
95
|
+
return baseUrl.replace(new RegExp("^https://(".concat(domains.map(function (domain) {
|
|
96
|
+
return domain.replace(/\./g, '\\.');
|
|
97
|
+
}).join('|'), ")")), 'http://$1');
|
|
98
|
+
}
|
|
95
99
|
|
|
96
100
|
//
|
|
97
101
|
// User register, login, and refresh token
|
package/dist/esm/index.js
CHANGED
|
@@ -20,10 +20,7 @@ export default class Roboto {
|
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
// DEVELOPMENT
|
|
23
|
-
|
|
24
|
-
return baseUrl.replace(new RegExp(`^https://(${domains.map(domain => domain.replace(/\./g, '\\.')).join('|')})`), 'http://$1');
|
|
25
|
-
}
|
|
26
|
-
this.config.baseUrl = stripHttpsForDomains(this.config.baseUrl, ['localhost', 'rbt.dorfio.com']);
|
|
23
|
+
this.config.baseUrl = this._stripHttpsForDomains(this.config.baseUrl, ['localhost', 'rbt.dorfio.com']);
|
|
27
24
|
|
|
28
25
|
// Check if a request object is provided
|
|
29
26
|
if (proxyReq && proxyReq.headers) {
|
|
@@ -47,6 +44,8 @@ export default class Roboto {
|
|
|
47
44
|
Roboto.instance = this;
|
|
48
45
|
}
|
|
49
46
|
setAppServiceHost(host) {
|
|
47
|
+
// DEVELOPMENT
|
|
48
|
+
host = this._stripHttpsForDomains(host, ['localhost', 'rbt.dorfio.com']);
|
|
50
49
|
this.api.setAppServiceHost(host);
|
|
51
50
|
}
|
|
52
51
|
setErrorHandler(customErrorHandler) {
|
|
@@ -54,6 +53,9 @@ export default class Roboto {
|
|
|
54
53
|
this.api.setErrorHandler(customErrorHandler);
|
|
55
54
|
}
|
|
56
55
|
}
|
|
56
|
+
_stripHttpsForDomains(baseUrl, domains) {
|
|
57
|
+
return baseUrl.replace(new RegExp(`^https://(${domains.map(domain => domain.replace(/\./g, '\\.')).join('|')})`), 'http://$1');
|
|
58
|
+
}
|
|
57
59
|
|
|
58
60
|
//
|
|
59
61
|
// User register, login, and refresh token
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -31,10 +31,7 @@ export default class Roboto{
|
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
// DEVELOPMENT
|
|
34
|
-
|
|
35
|
-
return baseUrl.replace(new RegExp(`^https://(${domains.map(domain => domain.replace(/\./g, '\\.')).join('|')})`), 'http://$1');
|
|
36
|
-
}
|
|
37
|
-
this.config.baseUrl = stripHttpsForDomains(this.config.baseUrl, ['localhost','rbt.dorfio.com']);
|
|
34
|
+
this.config.baseUrl = this._stripHttpsForDomains(this.config.baseUrl, ['localhost','rbt.dorfio.com']);
|
|
38
35
|
|
|
39
36
|
|
|
40
37
|
// Check if a request object is provided
|
|
@@ -62,6 +59,9 @@ export default class Roboto{
|
|
|
62
59
|
|
|
63
60
|
setAppServiceHost(host){
|
|
64
61
|
|
|
62
|
+
// DEVELOPMENT
|
|
63
|
+
host = this._stripHttpsForDomains(host, ['localhost','rbt.dorfio.com']);
|
|
64
|
+
|
|
65
65
|
this.api.setAppServiceHost(host);
|
|
66
66
|
|
|
67
67
|
}
|
|
@@ -72,6 +72,10 @@ export default class Roboto{
|
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
+
_stripHttpsForDomains(baseUrl, domains) {
|
|
76
|
+
return baseUrl.replace(new RegExp(`^https://(${domains.map(domain => domain.replace(/\./g, '\\.')).join('|')})`), 'http://$1');
|
|
77
|
+
}
|
|
78
|
+
|
|
75
79
|
//
|
|
76
80
|
// User register, login, and refresh token
|
|
77
81
|
//
|