backendless
Advanced tools
Comparing version 7.3.7 to 7.4.0
@@ -0,1 +1,3 @@ | ||
/*! ../globalThis */ | ||
/*! ../helpers/regeneratorRuntime */ | ||
@@ -45,2 +47,6 @@ | ||
/*! ./toPrimitive.js */ | ||
/*! ./toPropertyKey.js */ | ||
/*! ./transport */ | ||
@@ -60,2 +66,4 @@ | ||
/*! ./xmlhttprequest */ | ||
/*! @babel/runtime/helpers/applyDecoratedDescriptor */ | ||
@@ -135,4 +143,2 @@ | ||
/*! xmlhttprequest-ssl */ | ||
/*! yeast */ | ||
@@ -328,5 +334,5 @@ | ||
/*!*************************************************************!*\ | ||
!*** ./node_modules/engine.io-client/lib/xmlhttprequest.js ***! | ||
\*************************************************************/ | ||
/*!************************************************************!*\ | ||
!*** ./node_modules/@babel/runtime/helpers/toPrimitive.js ***! | ||
\************************************************************/ | ||
@@ -337,2 +343,6 @@ /*!**************************************************************!*\ | ||
/*!**************************************************************!*\ | ||
!*** ./node_modules/@babel/runtime/helpers/toPropertyKey.js ***! | ||
\**************************************************************/ | ||
/*!***************************************************************!*\ | ||
@@ -363,2 +373,6 @@ !*** ./node_modules/@babel/runtime/helpers/classCallCheck.js ***! | ||
/*!*****************************************************************!*\ | ||
!*** ./node_modules/engine.io-client/lib/globalThis.browser.js ***! | ||
\*****************************************************************/ | ||
/*!*****************************************************************!*\ | ||
!*** ./node_modules/engine.io-client/lib/transports/polling.js ***! | ||
@@ -406,1 +420,5 @@ \*****************************************************************/ | ||
\**************************************************************************/ | ||
/*!********************************************************************************!*\ | ||
!*** ./node_modules/engine.io-client/lib/transports/xmlhttprequest.browser.js ***! | ||
\********************************************************************************/ |
@@ -168,2 +168,3 @@ "use strict"; | ||
app.__removeService('LocalCache'); | ||
app.appInfoPromise(); | ||
var loggingConfig = (0, _extends2["default"])({ | ||
@@ -186,2 +187,15 @@ loadLevels: true, | ||
}, { | ||
key: "appInfoPromise", | ||
value: function appInfoPromise(reset) { | ||
var _this = this; | ||
if (reset || !this.__appInfoPromise) { | ||
this.__appInfoPromise = new Promise(function (resolve, reject) { | ||
_this.request.get({ | ||
url: _this.urls.appInfo() | ||
}).then(resolve)["catch"](reject); | ||
}); | ||
} | ||
return this.__appInfoPromise; | ||
} | ||
}, { | ||
key: "__hasService", | ||
@@ -188,0 +202,0 @@ value: function __hasService(name) { |
@@ -52,5 +52,4 @@ "use strict"; | ||
var _this = this; | ||
this.app.request.get({ | ||
url: this.app.urls.loggingLevels() | ||
}).then(function (loggersList) { | ||
this.app.appInfoPromise().then(function (appInfo) { | ||
var loggersList = appInfo.loggers; | ||
var loggers = {}; | ||
@@ -57,0 +56,0 @@ loggersList.forEach(function (logger) { |
15
es/rt.js
@@ -15,3 +15,2 @@ "use strict"; | ||
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf")); | ||
var _backendlessRequest = _interopRequireDefault(require("backendless-request")); | ||
var _backendlessRtClient = _interopRequireDefault(require("backendless-rt-client")); | ||
@@ -25,5 +24,2 @@ var _utils = _interopRequireDefault(require("./utils")); | ||
exports.RTScopeConnector = RTScopeConnector; | ||
function loadAppInfo(appPath) { | ||
return _backendlessRequest["default"].get("".concat(appPath, "/info")); | ||
} | ||
var RT = /*#__PURE__*/function (_BackendlessRTClient) { | ||
@@ -37,9 +33,6 @@ (0, _inherits2["default"])(RT, _BackendlessRTClient); | ||
apiKey = app.apiKey, | ||
appPath = app.appPath, | ||
debugMode = app.debugMode; | ||
var clientId = _utils["default"].uuid(); | ||
var lookupPath = "".concat(appPath, "/rt/lookup"); | ||
_this = _super.call(this, { | ||
appId: appId || undefined, | ||
lookupPath: lookupPath, | ||
debugMode: debugMode, | ||
@@ -54,2 +47,8 @@ connectQuery: function connectQuery() { | ||
}, | ||
hostResolver: function hostResolver() { | ||
return app.appInfoPromise().then(function (_ref) { | ||
var rtURL = _ref.rtURL; | ||
return rtURL; | ||
}); | ||
}, | ||
socketConfigTransform: function () { | ||
@@ -66,3 +65,3 @@ var _socketConfigTransform = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(socketConfig) { | ||
_context.next = 3; | ||
return loadAppInfo(appPath); | ||
return app.appInfoPromise(); | ||
case 3: | ||
@@ -69,0 +68,0 @@ appInfo = _context.sent; |
@@ -21,2 +21,9 @@ "use strict"; | ||
// app info | ||
}, { | ||
key: "appInfo", | ||
value: function appInfo() { | ||
return "".concat(this.root(), "/info"); | ||
} | ||
//automations | ||
@@ -23,0 +30,0 @@ }, { |
@@ -168,2 +168,3 @@ "use strict"; | ||
app.__removeService('LocalCache'); | ||
app.appInfoPromise(); | ||
var loggingConfig = (0, _extends2["default"])({ | ||
@@ -186,2 +187,15 @@ loadLevels: true, | ||
}, { | ||
key: "appInfoPromise", | ||
value: function appInfoPromise(reset) { | ||
var _this = this; | ||
if (reset || !this.__appInfoPromise) { | ||
this.__appInfoPromise = new Promise(function (resolve, reject) { | ||
_this.request.get({ | ||
url: _this.urls.appInfo() | ||
}).then(resolve)["catch"](reject); | ||
}); | ||
} | ||
return this.__appInfoPromise; | ||
} | ||
}, { | ||
key: "__hasService", | ||
@@ -188,0 +202,0 @@ value: function __hasService(name) { |
@@ -52,5 +52,4 @@ "use strict"; | ||
var _this = this; | ||
this.app.request.get({ | ||
url: this.app.urls.loggingLevels() | ||
}).then(function (loggersList) { | ||
this.app.appInfoPromise().then(function (appInfo) { | ||
var loggersList = appInfo.loggers; | ||
var loggers = {}; | ||
@@ -57,0 +56,0 @@ loggersList.forEach(function (logger) { |
@@ -15,3 +15,2 @@ "use strict"; | ||
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf")); | ||
var _backendlessRequest = _interopRequireDefault(require("backendless-request")); | ||
var _backendlessRtClient = _interopRequireDefault(require("backendless-rt-client")); | ||
@@ -25,5 +24,2 @@ var _utils = _interopRequireDefault(require("./utils")); | ||
exports.RTScopeConnector = RTScopeConnector; | ||
function loadAppInfo(appPath) { | ||
return _backendlessRequest["default"].get("".concat(appPath, "/info")); | ||
} | ||
var RT = /*#__PURE__*/function (_BackendlessRTClient) { | ||
@@ -37,9 +33,6 @@ (0, _inherits2["default"])(RT, _BackendlessRTClient); | ||
apiKey = app.apiKey, | ||
appPath = app.appPath, | ||
debugMode = app.debugMode; | ||
var clientId = _utils["default"].uuid(); | ||
var lookupPath = "".concat(appPath, "/rt/lookup"); | ||
_this = _super.call(this, { | ||
appId: appId || undefined, | ||
lookupPath: lookupPath, | ||
debugMode: debugMode, | ||
@@ -54,2 +47,8 @@ connectQuery: function connectQuery() { | ||
}, | ||
hostResolver: function hostResolver() { | ||
return app.appInfoPromise().then(function (_ref) { | ||
var rtURL = _ref.rtURL; | ||
return rtURL; | ||
}); | ||
}, | ||
socketConfigTransform: function () { | ||
@@ -66,3 +65,3 @@ var _socketConfigTransform = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(socketConfig) { | ||
_context.next = 3; | ||
return loadAppInfo(appPath); | ||
return app.appInfoPromise(); | ||
case 3: | ||
@@ -69,0 +68,0 @@ appInfo = _context.sent; |
@@ -21,2 +21,9 @@ "use strict"; | ||
// app info | ||
}, { | ||
key: "appInfo", | ||
value: function appInfo() { | ||
return "".concat(this.root(), "/info"); | ||
} | ||
//automations | ||
@@ -23,0 +30,0 @@ }, { |
{ | ||
"name": "backendless", | ||
"version": "7.3.7", | ||
"version": "7.4.0", | ||
"description": "Backendless JavaScript SDK for Node.js and the browser", | ||
@@ -84,3 +84,3 @@ "browser": "dist/backendless.js", | ||
"rimraf": "^3.0.2", | ||
"socket.io": "^2.3.0", | ||
"socket.io": "^2.5.1", | ||
"terser-webpack-plugin": "^2.3.8", | ||
@@ -94,6 +94,6 @@ "typescript": "^4.5.4", | ||
"dependencies": { | ||
"@babel/runtime": "^7.21.5", | ||
"backendless-request": "^0.7.9", | ||
"backendless-rt-client": "0.3.0" | ||
"@babel/runtime": "^7.26.7", | ||
"backendless-request": "^0.8.0", | ||
"backendless-rt-client": "0.5.0" | ||
} | ||
} |
@@ -151,2 +151,4 @@ import Request from 'backendless-request' | ||
app.appInfoPromise() | ||
const loggingConfig = Object.assign({ loadLevels: true, globalLevel: 'all', levels: {} }, config.logging) | ||
@@ -170,2 +172,14 @@ | ||
appInfoPromise(reset) { | ||
if (reset || !this.__appInfoPromise) { | ||
this.__appInfoPromise = new Promise((resolve, reject) => { | ||
this.request.get({ url: this.urls.appInfo() }) | ||
.then(resolve) | ||
.catch(reject) | ||
}) | ||
} | ||
return this.__appInfoPromise | ||
} | ||
__hasService(name) { | ||
@@ -172,0 +186,0 @@ return !!this[`__${name}`] |
@@ -42,5 +42,5 @@ import Logger from './logger' | ||
loadLoggingLevels() { | ||
this.app.request | ||
.get({ url: this.app.urls.loggingLevels() }) | ||
.then(loggersList => { | ||
this.app.appInfoPromise() | ||
.then(appInfo => { | ||
const { loggers: loggersList } = appInfo | ||
const loggers = {} | ||
@@ -47,0 +47,0 @@ |
@@ -1,2 +0,1 @@ | ||
import Request from 'backendless-request' | ||
import BackendlessRTClient from 'backendless-rt-client' | ||
@@ -9,16 +8,10 @@ | ||
function loadAppInfo(appPath) { | ||
return Request.get(`${appPath}/info`) | ||
} | ||
export default class RT extends BackendlessRTClient { | ||
constructor(app) { | ||
const { appId, apiKey, appPath, debugMode } = app | ||
const { appId, apiKey, debugMode } = app | ||
const clientId = Utils.uuid() | ||
const lookupPath = `${appPath}/rt/lookup` | ||
super({ | ||
appId: appId || undefined, | ||
lookupPath, | ||
debugMode, | ||
@@ -35,6 +28,9 @@ connectQuery() { | ||
hostResolver(){ | ||
return app.appInfoPromise().then(({ rtURL }) => rtURL) | ||
}, | ||
socketConfigTransform: async socketConfig => { | ||
if (!appId) { | ||
const appInfo = await loadAppInfo(appPath) | ||
const appInfo = await app.appInfoPromise() | ||
socketConfig.url = `${socketConfig.host}/${appInfo.appId}` | ||
@@ -41,0 +37,0 @@ socketConfig.options.path = `/${appInfo.appId}` |
@@ -10,2 +10,8 @@ export default class Urls { | ||
// app info | ||
appInfo() { | ||
return `${this.root()}/info` | ||
} | ||
//automations | ||
@@ -12,0 +18,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
3477857
54008
+ Addedbackendless-request@0.8.1(transitive)
+ Addedbackendless-rt-client@0.5.0(transitive)
- Removedbackendless-request@0.4.30.7.9(transitive)
- Removedbackendless-rt-client@0.3.0(transitive)
Updated@babel/runtime@^7.26.7
Updatedbackendless-request@^0.8.0
Updatedbackendless-rt-client@0.5.0