backendless 6.7.1 → 7.0.0
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 +20992 -23948
- package/dist/backendless.js.map +1 -1
- package/dist/backendless.min.js +2 -2
- package/es/bl/constants.js +0 -2
- package/es/bl/custom-services.js +40 -65
- package/es/bl/events.js +30 -52
- package/es/bl/index.js +3 -9
- package/es/cache/index.js +125 -189
- package/es/commerce/index.js +78 -119
- package/es/counters/counter.js +0 -8
- package/es/counters/index.js +171 -258
- package/es/data/data-query-builder.js +2 -39
- package/es/data/geo/geo-constructor.js +5 -26
- package/es/data/geo/geo-json-parser.js +0 -7
- package/es/data/geo/geometry.js +4 -13
- package/es/data/geo/linestring.js +4 -21
- package/es/data/geo/point.js +4 -22
- package/es/data/geo/polygon.js +4 -30
- package/es/data/geo/spatial-reference-system.js +1 -7
- package/es/data/geo/wkt-parser.js +0 -10
- package/es/data/geo/wkt-to-geojson.js +4 -44
- package/es/data/group-query-builder.js +0 -23
- package/es/data/index.js +17 -54
- package/es/data/json-update-builder.js +0 -18
- package/es/data/load-relations-query-builder.js +0 -16
- package/es/data/persmission.js +0 -16
- package/es/data/rt-handlers.js +1 -46
- package/es/data/store.js +314 -518
- package/es/decorators/deprecated.js +2 -5
- package/es/decorators/index.js +0 -2
- package/es/device/index.js +3 -8
- package/es/expression.js +0 -8
- package/es/files/index.js +354 -493
- package/es/files/persmission.js +0 -15
- package/es/files/utils.js +32 -55
- package/es/hive/index.js +1 -13
- package/es/hive/stores/base-store.js +14 -50
- package/es/hive/stores/index.js +0 -10
- package/es/hive/stores/key-value.js +4 -37
- package/es/hive/stores/list.js +0 -32
- package/es/hive/stores/map.js +0 -34
- package/es/hive/stores/set.js +0 -29
- package/es/hive/stores/sorted-set.js +19 -94
- package/es/hive/utils.js +0 -2
- package/es/index.js +53 -72
- package/es/local-cache/index.js +0 -10
- package/es/local-cache/local-storage.js +1 -9
- package/es/local-cache/virtual-storage.js +0 -6
- package/es/logging/index.js +48 -49
- package/es/logging/logger.js +33 -12
- package/es/management/data.js +0 -8
- package/es/management/index.js +3 -7
- package/es/messaging/channel/index.js +0 -27
- package/es/messaging/helpers/body-parts.js +3 -6
- package/es/messaging/helpers/delivery-options.js +3 -6
- package/es/messaging/helpers/email-envelope.js +13 -25
- package/es/messaging/helpers/index.js +10 -16
- package/es/messaging/helpers/publish-options.js +3 -6
- package/es/messaging/index.js +213 -317
- package/es/persmission.js +7 -16
- package/es/request/index.js +2 -16
- package/es/rso/connection.js +3 -34
- package/es/rso/index.js +0 -7
- package/es/rt.js +21 -52
- package/es/unit-of-work/constants.js +1 -1
- package/es/unit-of-work/index.js +27 -145
- package/es/unit-of-work/json-adapter.js +14 -35
- package/es/unit-of-work/op-result-value-reference.js +1 -11
- package/es/unit-of-work/op-result.js +2 -13
- package/es/urls.js +23 -15
- package/es/user-agent.js +0 -7
- package/es/users/index.js +345 -552
- package/es/users/roles.js +79 -128
- package/es/users/social/container.js +0 -16
- package/es/users/social/index.js +166 -250
- package/es/users/user.js +2 -9
- package/es/users/utils.js +0 -3
- package/es/utils.js +0 -17
- package/lib/bl/constants.js +0 -2
- package/lib/bl/custom-services.js +40 -65
- package/lib/bl/events.js +30 -52
- package/lib/bl/index.js +3 -9
- package/lib/cache/index.js +125 -189
- package/lib/commerce/index.js +78 -119
- package/lib/counters/counter.js +0 -8
- package/lib/counters/index.js +171 -258
- package/lib/data/data-query-builder.js +2 -39
- package/lib/data/geo/geo-constructor.js +5 -26
- package/lib/data/geo/geo-json-parser.js +0 -7
- package/lib/data/geo/geometry.js +4 -13
- package/lib/data/geo/linestring.js +4 -21
- package/lib/data/geo/point.js +4 -22
- package/lib/data/geo/polygon.js +4 -30
- package/lib/data/geo/spatial-reference-system.js +1 -7
- package/lib/data/geo/wkt-parser.js +0 -10
- package/lib/data/geo/wkt-to-geojson.js +4 -44
- package/lib/data/group-query-builder.js +0 -23
- package/lib/data/index.js +17 -54
- package/lib/data/json-update-builder.js +0 -18
- package/lib/data/load-relations-query-builder.js +0 -16
- package/lib/data/persmission.js +0 -16
- package/lib/data/rt-handlers.js +1 -46
- package/lib/data/store.js +314 -518
- package/lib/decorators/deprecated.js +2 -5
- package/lib/decorators/index.js +0 -2
- package/lib/device/index.js +3 -8
- package/lib/expression.js +0 -8
- package/lib/files/index.js +354 -493
- package/lib/files/persmission.js +0 -15
- package/lib/files/utils.js +32 -55
- package/lib/hive/index.js +1 -13
- package/lib/hive/stores/base-store.js +14 -50
- package/lib/hive/stores/index.js +0 -10
- package/lib/hive/stores/key-value.js +4 -37
- package/lib/hive/stores/list.js +0 -32
- package/lib/hive/stores/map.js +0 -34
- package/lib/hive/stores/set.js +0 -29
- package/lib/hive/stores/sorted-set.js +19 -94
- package/lib/hive/utils.js +0 -2
- package/lib/index.js +53 -72
- package/lib/local-cache/index.js +0 -10
- package/lib/local-cache/local-storage.js +1 -9
- package/lib/local-cache/virtual-storage.js +0 -6
- package/lib/logging/index.js +48 -49
- package/lib/logging/logger.js +33 -12
- package/lib/management/data.js +0 -8
- package/lib/management/index.js +3 -7
- package/lib/messaging/channel/index.js +0 -27
- package/lib/messaging/helpers/body-parts.js +3 -6
- package/lib/messaging/helpers/delivery-options.js +3 -6
- package/lib/messaging/helpers/email-envelope.js +13 -25
- package/lib/messaging/helpers/index.js +10 -16
- package/lib/messaging/helpers/publish-options.js +3 -6
- package/lib/messaging/index.js +213 -317
- package/lib/persmission.js +7 -16
- package/lib/request/index.js +2 -16
- package/lib/rso/connection.js +3 -34
- package/lib/rso/index.js +0 -7
- package/lib/rt.js +21 -52
- package/lib/unit-of-work/constants.js +1 -1
- package/lib/unit-of-work/index.js +27 -145
- package/lib/unit-of-work/json-adapter.js +14 -35
- package/lib/unit-of-work/op-result-value-reference.js +1 -11
- package/lib/unit-of-work/op-result.js +2 -13
- package/lib/urls.js +23 -15
- package/lib/user-agent.js +0 -7
- package/lib/users/index.js +345 -552
- package/lib/users/roles.js +79 -128
- package/lib/users/social/container.js +0 -16
- package/lib/users/social/index.js +166 -250
- package/lib/users/user.js +2 -9
- package/lib/users/utils.js +0 -3
- package/lib/utils.js +0 -17
- package/package.json +16 -16
- package/src/files/utils.js +1 -1
- package/src/index.js +5 -0
- package/src/logging/index.js +24 -0
- package/src/logging/logger.js +35 -6
- package/src/urls.js +4 -0
package/lib/index.js
CHANGED
|
@@ -1,34 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports["default"] = void 0;
|
|
9
|
-
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
10
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
|
-
|
|
14
11
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
15
|
-
|
|
16
12
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
17
|
-
|
|
18
13
|
var _backendlessRequest = _interopRequireDefault(require("backendless-request"));
|
|
19
|
-
|
|
20
14
|
var _request = _interopRequireDefault(require("./request"));
|
|
21
|
-
|
|
22
15
|
var _urls = _interopRequireDefault(require("./urls"));
|
|
23
|
-
|
|
24
16
|
var _utils = _interopRequireDefault(require("./utils"));
|
|
25
|
-
|
|
26
17
|
var _expression = _interopRequireDefault(require("./expression"));
|
|
27
|
-
|
|
28
|
-
function
|
|
29
|
-
|
|
30
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
31
|
-
|
|
18
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
19
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
32
20
|
var DEFAULT_PROPS = {
|
|
33
21
|
appId: null,
|
|
34
22
|
apiKey: null,
|
|
@@ -42,43 +30,37 @@ var DEFAULT_PROPS = {
|
|
|
42
30
|
var STATELESS_PROPS = ['appId', 'apiKey', 'domain'];
|
|
43
31
|
var root = (typeof self === "undefined" ? "undefined" : (0, _typeof2["default"])(self)) === 'object' && self.self === self && self || (typeof global === "undefined" ? "undefined" : (0, _typeof2["default"])(global)) === 'object' && global.global === global && global;
|
|
44
32
|
var previousBackendless = root && root.Backendless;
|
|
45
|
-
|
|
46
33
|
var showLegacyDataWarning = function showLegacyDataWarning() {
|
|
47
34
|
if (!showLegacyDataWarning.isShown) {
|
|
48
35
|
// eslint-disable-next-line no-console
|
|
49
36
|
console.warn('Backendless.Persistence is deprecated namespace, use Backendless.Data instead');
|
|
50
37
|
showLegacyDataWarning.isShown = true;
|
|
51
38
|
}
|
|
52
|
-
};
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
// Backendless supports three signatures for the initApp method
|
|
53
42
|
// two args - applicationId {String} and secretKey {String}
|
|
54
43
|
// one argument - domain {String}
|
|
55
44
|
// one argument - whole set of options {Object}
|
|
56
|
-
|
|
57
|
-
|
|
58
45
|
var parseInitConfig = function parseInitConfig() {
|
|
59
46
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
60
47
|
args[_key] = arguments[_key];
|
|
61
48
|
}
|
|
62
|
-
|
|
63
49
|
var appId = args[0],
|
|
64
|
-
|
|
65
|
-
|
|
50
|
+
apiKey = args[1];
|
|
66
51
|
if (appId && (0, _typeof2["default"])(appId) === 'object') {
|
|
67
52
|
return appId;
|
|
68
53
|
}
|
|
69
|
-
|
|
70
54
|
if (typeof appId === 'string' && !apiKey) {
|
|
71
55
|
return {
|
|
72
56
|
domain: appId
|
|
73
57
|
};
|
|
74
58
|
}
|
|
75
|
-
|
|
76
59
|
return {
|
|
77
60
|
appId: appId,
|
|
78
61
|
apiKey: apiKey
|
|
79
62
|
};
|
|
80
63
|
};
|
|
81
|
-
|
|
82
64
|
var validateConfig = function validateConfig(config) {
|
|
83
65
|
if (config.domain) {
|
|
84
66
|
if (!config.domain.startsWith('https://') && !config.domain.startsWith('http://')) {
|
|
@@ -86,7 +68,6 @@ var validateConfig = function validateConfig(config) {
|
|
|
86
68
|
}
|
|
87
69
|
}
|
|
88
70
|
};
|
|
89
|
-
|
|
90
71
|
var SERVICES = {
|
|
91
72
|
'Logging': function Logging() {
|
|
92
73
|
return require('./logging')["default"];
|
|
@@ -134,7 +115,6 @@ var SERVICES = {
|
|
|
134
115
|
return require('./management')["default"];
|
|
135
116
|
}
|
|
136
117
|
};
|
|
137
|
-
|
|
138
118
|
var Backendless = /*#__PURE__*/function () {
|
|
139
119
|
function Backendless(props) {
|
|
140
120
|
(0, _classCallCheck2["default"])(this, Backendless);
|
|
@@ -143,40 +123,35 @@ var Backendless = /*#__PURE__*/function () {
|
|
|
143
123
|
this.request = new _request["default"](this);
|
|
144
124
|
this.urls = new _urls["default"](this);
|
|
145
125
|
}
|
|
126
|
+
|
|
146
127
|
/**
|
|
147
128
|
* @param {Object} config
|
|
148
129
|
*/
|
|
149
|
-
|
|
150
|
-
|
|
151
130
|
(0, _createClass2["default"])(Backendless, [{
|
|
152
131
|
key: "initConfig",
|
|
153
132
|
value: function initConfig(config) {
|
|
154
133
|
config = _objectSpread({}, config);
|
|
155
|
-
|
|
156
134
|
if (config.domain) {
|
|
157
135
|
delete config.appId;
|
|
158
136
|
delete config.apiKey;
|
|
159
137
|
}
|
|
160
|
-
|
|
161
138
|
for (var key in DEFAULT_PROPS) {
|
|
162
139
|
if (DEFAULT_PROPS.hasOwnProperty(key)) {
|
|
163
140
|
var privateKey = "__".concat(key);
|
|
164
|
-
|
|
165
141
|
if (STATELESS_PROPS.includes(key)) {
|
|
166
142
|
delete this[privateKey];
|
|
167
143
|
}
|
|
168
|
-
|
|
169
144
|
var defaultValue = this[privateKey] === undefined ? DEFAULT_PROPS[key] : this[privateKey];
|
|
170
145
|
this[privateKey] = config[key] === undefined ? defaultValue : config[key];
|
|
171
146
|
}
|
|
172
147
|
}
|
|
173
148
|
}
|
|
149
|
+
|
|
174
150
|
/**
|
|
175
151
|
* @param {string|Object} appId|domain|config
|
|
176
152
|
* @param {string} [apiKey]
|
|
177
153
|
* @returns {Backendless}
|
|
178
154
|
*/
|
|
179
|
-
|
|
180
155
|
}, {
|
|
181
156
|
key: "initApp",
|
|
182
157
|
value: function initApp() {
|
|
@@ -185,18 +160,21 @@ var Backendless = /*#__PURE__*/function () {
|
|
|
185
160
|
var app = config.standalone ? new Backendless(this) : this;
|
|
186
161
|
app.initConfig(config);
|
|
187
162
|
app.resetRT();
|
|
188
|
-
|
|
189
163
|
app.__removeService('LocalCache');
|
|
190
|
-
|
|
164
|
+
var loggingConfig = (0, _extends2["default"])({
|
|
165
|
+
loadLevels: true,
|
|
166
|
+
defaultLevel: 'all',
|
|
167
|
+
levels: {}
|
|
168
|
+
}, config.logging);
|
|
191
169
|
if (app.__hasService('Logging')) {
|
|
192
170
|
app.Logging.reset();
|
|
171
|
+
app.Logging.setConfig(loggingConfig);
|
|
193
172
|
}
|
|
194
|
-
|
|
195
173
|
if (app.__hasService('Users')) {
|
|
196
174
|
app.Users.currentUser = null;
|
|
197
175
|
}
|
|
198
|
-
|
|
199
176
|
delete this.__device;
|
|
177
|
+
app.loggingConfig = loggingConfig;
|
|
200
178
|
return app;
|
|
201
179
|
}
|
|
202
180
|
}, {
|
|
@@ -213,16 +191,16 @@ var Backendless = /*#__PURE__*/function () {
|
|
|
213
191
|
key: "__getService",
|
|
214
192
|
value: function __getService(name) {
|
|
215
193
|
var privateName = "__".concat(name);
|
|
216
|
-
|
|
217
194
|
if (!this[privateName]) {
|
|
218
195
|
var Service = SERVICES[name]();
|
|
219
196
|
this[privateName] = new Service(this);
|
|
220
197
|
}
|
|
221
|
-
|
|
222
198
|
return this[privateName];
|
|
223
|
-
}
|
|
224
|
-
///--------standalone-------///
|
|
199
|
+
}
|
|
225
200
|
|
|
201
|
+
///--------SETTERS/GETTERS-------///
|
|
202
|
+
|
|
203
|
+
///--------standalone-------///
|
|
226
204
|
}, {
|
|
227
205
|
key: "standalone",
|
|
228
206
|
get: function get() {
|
|
@@ -246,8 +224,9 @@ var Backendless = /*#__PURE__*/function () {
|
|
|
246
224
|
},
|
|
247
225
|
set: function set(apiKey) {
|
|
248
226
|
throw new Error("Setting '".concat(apiKey, "' value to Backendless.apiKey directly is not possible, ") + "instead you must use Backendless.initApp(APP_ID, '".concat(apiKey, "')"));
|
|
249
|
-
}
|
|
227
|
+
}
|
|
250
228
|
|
|
229
|
+
///--------serverURL-------///
|
|
251
230
|
}, {
|
|
252
231
|
key: "serverURL",
|
|
253
232
|
get: function get() {
|
|
@@ -255,8 +234,9 @@ var Backendless = /*#__PURE__*/function () {
|
|
|
255
234
|
},
|
|
256
235
|
set: function set(serverURL) {
|
|
257
236
|
this.__serverURL = serverURL;
|
|
258
|
-
}
|
|
237
|
+
}
|
|
259
238
|
|
|
239
|
+
///--------domain-------///
|
|
260
240
|
}, {
|
|
261
241
|
key: "domain",
|
|
262
242
|
get: function get() {
|
|
@@ -264,8 +244,9 @@ var Backendless = /*#__PURE__*/function () {
|
|
|
264
244
|
},
|
|
265
245
|
set: function set(domain) {
|
|
266
246
|
this.__domain = domain;
|
|
267
|
-
}
|
|
247
|
+
}
|
|
268
248
|
|
|
249
|
+
///--------apiURI-------///
|
|
269
250
|
}, {
|
|
270
251
|
key: "apiURI",
|
|
271
252
|
get: function get() {
|
|
@@ -273,21 +254,22 @@ var Backendless = /*#__PURE__*/function () {
|
|
|
273
254
|
},
|
|
274
255
|
set: function set(apiURI) {
|
|
275
256
|
this.__apiURI = apiURI;
|
|
276
|
-
}
|
|
257
|
+
}
|
|
277
258
|
|
|
259
|
+
///--------appPath-------///
|
|
278
260
|
}, {
|
|
279
261
|
key: "appPath",
|
|
280
262
|
get: function get() {
|
|
281
263
|
if (this.domain) {
|
|
282
264
|
return this.domain + this.apiURI;
|
|
283
265
|
}
|
|
284
|
-
|
|
285
266
|
return [this.serverURL, this.appId, this.apiKey].join('/');
|
|
286
267
|
},
|
|
287
268
|
set: function set(appPath) {
|
|
288
269
|
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');
|
|
289
|
-
}
|
|
270
|
+
}
|
|
290
271
|
|
|
272
|
+
///--------debugMode-------///
|
|
291
273
|
}, {
|
|
292
274
|
key: "debugMode",
|
|
293
275
|
get: function get() {
|
|
@@ -295,16 +277,15 @@ var Backendless = /*#__PURE__*/function () {
|
|
|
295
277
|
},
|
|
296
278
|
set: function set(debugMode) {
|
|
297
279
|
debugMode = !!debugMode;
|
|
298
|
-
|
|
299
280
|
if (this.__debugMode !== debugMode) {
|
|
300
281
|
this.__debugMode = debugMode;
|
|
301
|
-
|
|
302
282
|
if (this.__RT) {
|
|
303
283
|
this.RT.setDebugMode(debugMode);
|
|
304
284
|
}
|
|
305
285
|
}
|
|
306
|
-
}
|
|
286
|
+
}
|
|
307
287
|
|
|
288
|
+
///--------XMLHttpRequestMode-------///
|
|
308
289
|
}, {
|
|
309
290
|
key: "XMLHttpRequest",
|
|
310
291
|
get: function get() {
|
|
@@ -312,15 +293,15 @@ var Backendless = /*#__PURE__*/function () {
|
|
|
312
293
|
},
|
|
313
294
|
set: function set(XMLHttpRequest) {
|
|
314
295
|
this.__XMLHttpRequest = XMLHttpRequest;
|
|
315
|
-
}
|
|
296
|
+
}
|
|
316
297
|
|
|
298
|
+
///--------device-------///
|
|
317
299
|
}, {
|
|
318
300
|
key: "device",
|
|
319
301
|
get: function get() {
|
|
320
302
|
if (!this.__device) {
|
|
321
303
|
throw new Error('Device is not defined. Please, run the Backendless.setupDevice');
|
|
322
304
|
}
|
|
323
|
-
|
|
324
305
|
return this.__device;
|
|
325
306
|
},
|
|
326
307
|
set: function set(props) {
|
|
@@ -330,10 +311,10 @@ var Backendless = /*#__PURE__*/function () {
|
|
|
330
311
|
key: "setupDevice",
|
|
331
312
|
value: function setupDevice(device) {
|
|
332
313
|
var Device = require('./device')["default"];
|
|
333
|
-
|
|
334
314
|
this.__device = new Device(device);
|
|
335
|
-
}
|
|
315
|
+
}
|
|
336
316
|
|
|
317
|
+
///----------UTIL METHODS--------///
|
|
337
318
|
}, {
|
|
338
319
|
key: "Utils",
|
|
339
320
|
get: function get() {
|
|
@@ -360,11 +341,11 @@ var Backendless = /*#__PURE__*/function () {
|
|
|
360
341
|
if (root) {
|
|
361
342
|
root.Backendless = previousBackendless;
|
|
362
343
|
}
|
|
363
|
-
|
|
364
344
|
return this;
|
|
365
|
-
}
|
|
366
|
-
///-------------- SERVICES -------------///
|
|
345
|
+
}
|
|
367
346
|
|
|
347
|
+
///-------------------------------------///
|
|
348
|
+
///-------------- SERVICES -------------///
|
|
368
349
|
}, {
|
|
369
350
|
key: "Logging",
|
|
370
351
|
get: function get() {
|
|
@@ -450,7 +431,6 @@ var Backendless = /*#__PURE__*/function () {
|
|
|
450
431
|
value: function resetRT() {
|
|
451
432
|
if (this.__RT) {
|
|
452
433
|
this.__RT.terminate();
|
|
453
|
-
|
|
454
434
|
delete this.__RT;
|
|
455
435
|
}
|
|
456
436
|
}
|
|
@@ -473,30 +453,33 @@ var Backendless = /*#__PURE__*/function () {
|
|
|
473
453
|
key: "Management",
|
|
474
454
|
get: function get() {
|
|
475
455
|
return this.__getService('Management');
|
|
476
|
-
}
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
///-------------- SERVICES -------------///
|
|
477
459
|
///-------------------------------------///
|
|
460
|
+
|
|
478
461
|
///-------------------------------------///
|
|
479
462
|
///--------BACKWARD COMPATIBILITY-------///
|
|
480
463
|
|
|
481
464
|
/** @deprecated */
|
|
482
|
-
|
|
483
465
|
}, {
|
|
484
466
|
key: "applicationId",
|
|
485
467
|
get: function get() {
|
|
486
468
|
// eslint-disable-next-line no-console
|
|
487
469
|
// temporary comment it because it breaks JS-CodeRunner version less than 6.3.0
|
|
488
470
|
// console.warn('getter/setter for Backendless.applicationId is deprecated, instead use Backendless.appId')
|
|
471
|
+
|
|
489
472
|
return this.appId;
|
|
490
473
|
}
|
|
491
|
-
|
|
492
|
-
|
|
474
|
+
|
|
475
|
+
/** @deprecated */,
|
|
493
476
|
set: function set(appId) {
|
|
494
477
|
// eslint-disable-next-line no-console
|
|
495
478
|
console.warn('getter/setter for Backendless.applicationId is deprecated, instead use Backendless.appId');
|
|
496
479
|
this.appId = appId;
|
|
497
480
|
}
|
|
498
|
-
/** @deprecated */
|
|
499
481
|
|
|
482
|
+
/** @deprecated */
|
|
500
483
|
}, {
|
|
501
484
|
key: "secretKey",
|
|
502
485
|
get: function get() {
|
|
@@ -504,15 +487,15 @@ var Backendless = /*#__PURE__*/function () {
|
|
|
504
487
|
console.warn('getter/setter for Backendless.secretKey is deprecated, instead use Backendless.apiKey');
|
|
505
488
|
return this.apiKey;
|
|
506
489
|
}
|
|
507
|
-
|
|
508
|
-
|
|
490
|
+
|
|
491
|
+
/** @deprecated */,
|
|
509
492
|
set: function set(apiKey) {
|
|
510
493
|
// eslint-disable-next-line no-console
|
|
511
494
|
console.warn('getter/setter for Backendless.secretKey is deprecated, instead use Backendless.apiKey');
|
|
512
495
|
this.apiKey = apiKey;
|
|
513
496
|
}
|
|
514
|
-
/** @deprecated */
|
|
515
497
|
|
|
498
|
+
/** @deprecated */
|
|
516
499
|
}, {
|
|
517
500
|
key: "Persistence",
|
|
518
501
|
get: function get() {
|
|
@@ -568,19 +551,17 @@ var Backendless = /*#__PURE__*/function () {
|
|
|
568
551
|
key: "Expression",
|
|
569
552
|
get: function get() {
|
|
570
553
|
return _expression["default"];
|
|
571
|
-
}
|
|
572
|
-
///-------------------------------------///
|
|
554
|
+
}
|
|
573
555
|
|
|
556
|
+
///--------BACKWARD COMPATIBILITY-------///
|
|
557
|
+
///-------------------------------------///
|
|
574
558
|
}]);
|
|
575
559
|
return Backendless;
|
|
576
560
|
}();
|
|
577
|
-
|
|
578
561
|
var backendless = new Backendless(DEFAULT_PROPS);
|
|
579
|
-
|
|
580
562
|
if (root) {
|
|
581
563
|
root.Backendless = backendless;
|
|
582
564
|
}
|
|
583
|
-
|
|
584
565
|
exports = module.exports = backendless;
|
|
585
566
|
var _default = backendless;
|
|
586
567
|
exports["default"] = _default;
|
package/lib/local-cache/index.js
CHANGED
|
@@ -1,24 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports["default"] = void 0;
|
|
9
|
-
|
|
10
8
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
|
|
12
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
-
|
|
14
10
|
var _utils = _interopRequireDefault(require("../utils"));
|
|
15
|
-
|
|
16
11
|
var _virtualStorage = _interopRequireDefault(require("./virtual-storage"));
|
|
17
|
-
|
|
18
12
|
var _localStorage = _interopRequireDefault(require("./local-storage"));
|
|
19
|
-
|
|
20
13
|
var STORAGE_KEY_NAMESPACE = 'Backendless';
|
|
21
|
-
|
|
22
14
|
var LocalCache = /*#__PURE__*/function () {
|
|
23
15
|
function LocalCache(app) {
|
|
24
16
|
(0, _classCallCheck2["default"])(this, LocalCache);
|
|
@@ -32,7 +24,6 @@ var LocalCache = /*#__PURE__*/function () {
|
|
|
32
24
|
STAY_LOGGED_IN: 'stayLoggedIn'
|
|
33
25
|
};
|
|
34
26
|
}
|
|
35
|
-
|
|
36
27
|
(0, _createClass2["default"])(LocalCache, [{
|
|
37
28
|
key: "setStorage",
|
|
38
29
|
value: function setStorage(Storage) {
|
|
@@ -56,5 +47,4 @@ var LocalCache = /*#__PURE__*/function () {
|
|
|
56
47
|
}]);
|
|
57
48
|
return LocalCache;
|
|
58
49
|
}();
|
|
59
|
-
|
|
60
50
|
exports["default"] = LocalCache;
|
|
@@ -1,35 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports["default"] = void 0;
|
|
9
|
-
|
|
10
8
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
|
|
12
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
-
|
|
14
10
|
function migrateLegacyStorageData(storage, legacyStorageName) {
|
|
15
11
|
//TODO: this will be removed in the nearest release
|
|
12
|
+
|
|
16
13
|
if (!localStorage.getItem(storage.storageName)) {
|
|
17
14
|
var legacyStorageData = localStorage.getItem(legacyStorageName);
|
|
18
|
-
|
|
19
15
|
if (legacyStorageData) {
|
|
20
16
|
localStorage.setItem(storage.storageName, legacyStorageData);
|
|
21
17
|
localStorage.removeItem(legacyStorageName);
|
|
22
18
|
}
|
|
23
19
|
}
|
|
24
20
|
}
|
|
25
|
-
|
|
26
21
|
var LocalStorage = /*#__PURE__*/function () {
|
|
27
22
|
function LocalStorage(storageName, legacyStorageName) {
|
|
28
23
|
(0, _classCallCheck2["default"])(this, LocalStorage);
|
|
29
24
|
this.storageName = storageName;
|
|
30
25
|
migrateLegacyStorageData(this, legacyStorageName);
|
|
31
26
|
}
|
|
32
|
-
|
|
33
27
|
(0, _createClass2["default"])(LocalStorage, [{
|
|
34
28
|
key: "getStore",
|
|
35
29
|
value: function getStore() {
|
|
@@ -39,7 +33,6 @@ var LocalStorage = /*#__PURE__*/function () {
|
|
|
39
33
|
// eslint-disable-next-line no-console
|
|
40
34
|
console.warn('Could not parse data from LocalStorage', e);
|
|
41
35
|
}
|
|
42
|
-
|
|
43
36
|
return {};
|
|
44
37
|
}
|
|
45
38
|
}, {
|
|
@@ -69,5 +62,4 @@ var LocalStorage = /*#__PURE__*/function () {
|
|
|
69
62
|
}]);
|
|
70
63
|
return LocalStorage;
|
|
71
64
|
}();
|
|
72
|
-
|
|
73
65
|
exports["default"] = LocalStorage;
|
|
@@ -1,22 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports["default"] = void 0;
|
|
9
|
-
|
|
10
8
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
|
|
12
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
-
|
|
14
10
|
var VirtualStorage = /*#__PURE__*/function () {
|
|
15
11
|
function VirtualStorage() {
|
|
16
12
|
(0, _classCallCheck2["default"])(this, VirtualStorage);
|
|
17
13
|
this.data = {};
|
|
18
14
|
}
|
|
19
|
-
|
|
20
15
|
(0, _createClass2["default"])(VirtualStorage, [{
|
|
21
16
|
key: "get",
|
|
22
17
|
value: function get(key) {
|
|
@@ -35,5 +30,4 @@ var VirtualStorage = /*#__PURE__*/function () {
|
|
|
35
30
|
}]);
|
|
36
31
|
return VirtualStorage;
|
|
37
32
|
}();
|
|
38
|
-
|
|
39
33
|
exports["default"] = VirtualStorage;
|