backendless 7.4.4 → 7.4.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/dist/backendless.js +32 -14
- package/dist/backendless.js.map +1 -1
- package/dist/backendless.min.js +2 -2
- package/es/index.js +4 -1
- package/es/logging/index.js +17 -9
- package/es/urls.js +3 -0
- package/lib/index.js +4 -1
- package/lib/logging/index.js +17 -9
- package/lib/urls.js +3 -0
- package/package.json +2 -2
- package/src/index.js +5 -1
- package/src/logging/index.js +25 -12
- package/src/urls.js +7 -0
package/dist/backendless.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* ********************************************************************************************************************
|
|
3
|
-
* Backendless SDK for JavaScript. Version: 7.4.
|
|
3
|
+
* Backendless SDK for JavaScript. Version: 7.4.6
|
|
4
4
|
*
|
|
5
5
|
* Copyright 2012-2023 BACKENDLESS.COM. All Rights Reserved.
|
|
6
6
|
*
|
|
@@ -6789,7 +6789,10 @@ var Backendless = /*#__PURE__*/function () {
|
|
|
6789
6789
|
if (this.domain) {
|
|
6790
6790
|
return this.domain + this.apiURI;
|
|
6791
6791
|
}
|
|
6792
|
-
|
|
6792
|
+
if (this.appId && this.apiKey) {
|
|
6793
|
+
return [this.serverURL, this.appId, this.apiKey].join('/');
|
|
6794
|
+
}
|
|
6795
|
+
return null;
|
|
6793
6796
|
},
|
|
6794
6797
|
set: function set(appPath) {
|
|
6795
6798
|
throw new Error("Setting '".concat(appPath, "' value to Backendless.appPath directly is not possible, ") + 'instead you must use Backendless.initApp(APP_ID, API_KEY) for setup the value');
|
|
@@ -7386,13 +7389,15 @@ var Logging = /*#__PURE__*/function () {
|
|
|
7386
7389
|
this.stopFlushInterval();
|
|
7387
7390
|
messages = (0, _toConsumableArray2["default"])(this.messages);
|
|
7388
7391
|
this.messages = [];
|
|
7389
|
-
this.flushRequest =
|
|
7390
|
-
|
|
7391
|
-
|
|
7392
|
-
|
|
7393
|
-
|
|
7394
|
-
|
|
7395
|
-
|
|
7392
|
+
this.flushRequest = Promise.resolve().then(function () {
|
|
7393
|
+
return _this2.app.request.put({
|
|
7394
|
+
url: _this2.app.urls.logging(),
|
|
7395
|
+
data: messages
|
|
7396
|
+
})["catch"](function (error) {
|
|
7397
|
+
_this2.messages = [].concat((0, _toConsumableArray2["default"])(messages), (0, _toConsumableArray2["default"])(_this2.messages));
|
|
7398
|
+
_this2.checkMessagesLimit();
|
|
7399
|
+
throw error;
|
|
7400
|
+
});
|
|
7396
7401
|
})["finally"](function () {
|
|
7397
7402
|
return delete _this2.flushRequest;
|
|
7398
7403
|
});
|
|
@@ -7430,7 +7435,10 @@ var Logging = /*#__PURE__*/function () {
|
|
|
7430
7435
|
}
|
|
7431
7436
|
this.checkMessagesLenTimer = setTimeout(function () {
|
|
7432
7437
|
if (_this3.messages.length >= _this3.numOfMessages) {
|
|
7433
|
-
_this3.flush()
|
|
7438
|
+
_this3.flush()["catch"](function (error) {
|
|
7439
|
+
// eslint-disable-next-line no-console
|
|
7440
|
+
console.error('Could not flush log messages immediately: ', error);
|
|
7441
|
+
});
|
|
7434
7442
|
} else {
|
|
7435
7443
|
_this3.startFlushInterval();
|
|
7436
7444
|
}
|
|
@@ -7449,7 +7457,10 @@ var Logging = /*#__PURE__*/function () {
|
|
|
7449
7457
|
var _this4 = this;
|
|
7450
7458
|
if (!this.flushInterval) {
|
|
7451
7459
|
this.flushInterval = setTimeout(function () {
|
|
7452
|
-
|
|
7460
|
+
_this4.flush()["catch"](function (error) {
|
|
7461
|
+
// eslint-disable-next-line no-console
|
|
7462
|
+
console.error('Could not flush log messages with timer: ', error);
|
|
7463
|
+
});
|
|
7453
7464
|
}, this.timeFrequency * 1000);
|
|
7454
7465
|
}
|
|
7455
7466
|
}
|
|
@@ -10369,6 +10380,9 @@ var Urls = /*#__PURE__*/function () {
|
|
|
10369
10380
|
(0, _createClass2["default"])(Urls, [{
|
|
10370
10381
|
key: "root",
|
|
10371
10382
|
value: function root() {
|
|
10383
|
+
if (!this.app.appPath) {
|
|
10384
|
+
throw new Error('Backendless API is not configured, make sure you run Backendless.initApp(...) ' + 'before the operation');
|
|
10385
|
+
}
|
|
10372
10386
|
return this.app.appPath;
|
|
10373
10387
|
}
|
|
10374
10388
|
|
|
@@ -12658,7 +12672,7 @@ function getFormData() {
|
|
|
12658
12672
|
function setFormData(value) {
|
|
12659
12673
|
CustomFormData = value;
|
|
12660
12674
|
}
|
|
12661
|
-
var SAFE_CHAR_CODES = ['%40', '%3A', '%2F'];
|
|
12675
|
+
var SAFE_CHAR_CODES = ['%40', '%3A', '%2F', '%23'];
|
|
12662
12676
|
function safeEscape(str, charCodes) {
|
|
12663
12677
|
var _char = charCodes[0];
|
|
12664
12678
|
if (_char) {
|
|
@@ -12671,7 +12685,7 @@ function safeEscape(str, charCodes) {
|
|
|
12671
12685
|
}
|
|
12672
12686
|
function ensureComponentEncoding(uriComponent) {
|
|
12673
12687
|
if (uriComponent === decodeURI(uriComponent)) {
|
|
12674
|
-
return safeEscape(uriComponent, SAFE_CHAR_CODES);
|
|
12688
|
+
return safeEscape(uriComponent, [].concat(SAFE_CHAR_CODES));
|
|
12675
12689
|
}
|
|
12676
12690
|
return uriComponent;
|
|
12677
12691
|
}
|
|
@@ -12990,7 +13004,11 @@ var Request = exports.Request = /*#__PURE__*/function (_EventEmitter) {
|
|
|
12990
13004
|
console.log(this.method.toUpperCase(), decodeURIComponent(path), body, this.headers);
|
|
12991
13005
|
}
|
|
12992
13006
|
var withCredentials = typeof this.withCredentials === 'boolean' ? this.withCredentials : Request.withCredentials;
|
|
12993
|
-
var
|
|
13007
|
+
var syncError = new Error();
|
|
13008
|
+
var request = Request.send(path, this.method.toUpperCase(), this.headers, body, this.encoding, this.timeout, withCredentials).then(parseBody).then(checkStatus).then(unwrapBody).then(cacheResponse).then(flushCache)["catch"](function (error) {
|
|
13009
|
+
error.stack = "".concat(error.stack).concat(syncError.stack);
|
|
13010
|
+
throw error;
|
|
13011
|
+
});
|
|
12994
13012
|
request.then(function (result) {
|
|
12995
13013
|
_this2.emit(RESPONSE_EVENT, result);
|
|
12996
13014
|
_this2.emit(DONE_EVENT, null, result);
|