backendless 6.7.0 → 6.7.1-dev.2

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.
Files changed (159) hide show
  1. package/backendless.d.ts +5 -0
  2. package/dist/backendless.js +20966 -23929
  3. package/dist/backendless.js.map +1 -1
  4. package/dist/backendless.min.js +2 -2
  5. package/es/bl/constants.js +0 -2
  6. package/es/bl/custom-services.js +40 -65
  7. package/es/bl/events.js +30 -52
  8. package/es/bl/index.js +3 -9
  9. package/es/cache/index.js +125 -189
  10. package/es/commerce/index.js +78 -119
  11. package/es/counters/counter.js +0 -8
  12. package/es/counters/index.js +171 -258
  13. package/es/data/data-query-builder.js +2 -39
  14. package/es/data/geo/geo-constructor.js +5 -26
  15. package/es/data/geo/geo-json-parser.js +0 -7
  16. package/es/data/geo/geometry.js +4 -13
  17. package/es/data/geo/linestring.js +4 -21
  18. package/es/data/geo/point.js +4 -22
  19. package/es/data/geo/polygon.js +4 -30
  20. package/es/data/geo/spatial-reference-system.js +1 -7
  21. package/es/data/geo/wkt-parser.js +0 -10
  22. package/es/data/geo/wkt-to-geojson.js +4 -44
  23. package/es/data/group-query-builder.js +0 -23
  24. package/es/data/index.js +17 -54
  25. package/es/data/json-update-builder.js +0 -18
  26. package/es/data/load-relations-query-builder.js +0 -16
  27. package/es/data/persmission.js +0 -16
  28. package/es/data/rt-handlers.js +1 -46
  29. package/es/data/store.js +316 -518
  30. package/es/decorators/deprecated.js +2 -5
  31. package/es/decorators/index.js +0 -2
  32. package/es/device/index.js +3 -8
  33. package/es/expression.js +29 -0
  34. package/es/files/index.js +354 -493
  35. package/es/files/persmission.js +0 -15
  36. package/es/files/utils.js +32 -55
  37. package/es/hive/index.js +1 -13
  38. package/es/hive/stores/base-store.js +14 -50
  39. package/es/hive/stores/index.js +0 -10
  40. package/es/hive/stores/key-value.js +4 -37
  41. package/es/hive/stores/list.js +0 -32
  42. package/es/hive/stores/map.js +0 -34
  43. package/es/hive/stores/set.js +0 -29
  44. package/es/hive/stores/sorted-set.js +19 -94
  45. package/es/hive/utils.js +0 -2
  46. package/es/index.js +51 -71
  47. package/es/local-cache/index.js +0 -10
  48. package/es/local-cache/local-storage.js +1 -9
  49. package/es/local-cache/virtual-storage.js +0 -6
  50. package/es/logging/index.js +21 -46
  51. package/es/logging/logger.js +0 -6
  52. package/es/management/data.js +0 -8
  53. package/es/management/index.js +3 -7
  54. package/es/messaging/channel/index.js +0 -27
  55. package/es/messaging/helpers/body-parts.js +3 -6
  56. package/es/messaging/helpers/delivery-options.js +3 -6
  57. package/es/messaging/helpers/email-envelope.js +13 -25
  58. package/es/messaging/helpers/index.js +10 -16
  59. package/es/messaging/helpers/publish-options.js +3 -6
  60. package/es/messaging/index.js +213 -317
  61. package/es/persmission.js +7 -16
  62. package/es/request/index.js +2 -16
  63. package/es/rso/connection.js +3 -34
  64. package/es/rso/index.js +0 -7
  65. package/es/rt.js +21 -52
  66. package/es/unit-of-work/constants.js +1 -1
  67. package/es/unit-of-work/index.js +27 -145
  68. package/es/unit-of-work/json-adapter.js +14 -35
  69. package/es/unit-of-work/op-result-value-reference.js +1 -11
  70. package/es/unit-of-work/op-result.js +2 -13
  71. package/es/urls.js +18 -15
  72. package/es/user-agent.js +0 -7
  73. package/es/users/index.js +345 -552
  74. package/es/users/roles.js +79 -128
  75. package/es/users/social/container.js +0 -16
  76. package/es/users/social/index.js +166 -250
  77. package/es/users/user.js +2 -9
  78. package/es/users/utils.js +0 -3
  79. package/es/utils.js +0 -17
  80. package/lib/bl/constants.js +0 -2
  81. package/lib/bl/custom-services.js +40 -65
  82. package/lib/bl/events.js +30 -52
  83. package/lib/bl/index.js +3 -9
  84. package/lib/cache/index.js +125 -189
  85. package/lib/commerce/index.js +78 -119
  86. package/lib/counters/counter.js +0 -8
  87. package/lib/counters/index.js +171 -258
  88. package/lib/data/data-query-builder.js +2 -39
  89. package/lib/data/geo/geo-constructor.js +5 -26
  90. package/lib/data/geo/geo-json-parser.js +0 -7
  91. package/lib/data/geo/geometry.js +4 -13
  92. package/lib/data/geo/linestring.js +4 -21
  93. package/lib/data/geo/point.js +4 -22
  94. package/lib/data/geo/polygon.js +4 -30
  95. package/lib/data/geo/spatial-reference-system.js +1 -7
  96. package/lib/data/geo/wkt-parser.js +0 -10
  97. package/lib/data/geo/wkt-to-geojson.js +4 -44
  98. package/lib/data/group-query-builder.js +0 -23
  99. package/lib/data/index.js +17 -54
  100. package/lib/data/json-update-builder.js +0 -18
  101. package/lib/data/load-relations-query-builder.js +0 -16
  102. package/lib/data/persmission.js +0 -16
  103. package/lib/data/rt-handlers.js +1 -46
  104. package/lib/data/store.js +316 -518
  105. package/lib/decorators/deprecated.js +2 -5
  106. package/lib/decorators/index.js +0 -2
  107. package/lib/device/index.js +3 -8
  108. package/lib/expression.js +29 -0
  109. package/lib/files/index.js +354 -493
  110. package/lib/files/persmission.js +0 -15
  111. package/lib/files/utils.js +32 -55
  112. package/lib/hive/index.js +1 -13
  113. package/lib/hive/stores/base-store.js +14 -50
  114. package/lib/hive/stores/index.js +0 -10
  115. package/lib/hive/stores/key-value.js +4 -37
  116. package/lib/hive/stores/list.js +0 -32
  117. package/lib/hive/stores/map.js +0 -34
  118. package/lib/hive/stores/set.js +0 -29
  119. package/lib/hive/stores/sorted-set.js +19 -94
  120. package/lib/hive/utils.js +0 -2
  121. package/lib/index.js +51 -71
  122. package/lib/local-cache/index.js +0 -10
  123. package/lib/local-cache/local-storage.js +1 -9
  124. package/lib/local-cache/virtual-storage.js +0 -6
  125. package/lib/logging/index.js +21 -46
  126. package/lib/logging/logger.js +0 -6
  127. package/lib/management/data.js +0 -8
  128. package/lib/management/index.js +3 -7
  129. package/lib/messaging/channel/index.js +0 -27
  130. package/lib/messaging/helpers/body-parts.js +3 -6
  131. package/lib/messaging/helpers/delivery-options.js +3 -6
  132. package/lib/messaging/helpers/email-envelope.js +13 -25
  133. package/lib/messaging/helpers/index.js +10 -16
  134. package/lib/messaging/helpers/publish-options.js +3 -6
  135. package/lib/messaging/index.js +213 -317
  136. package/lib/persmission.js +7 -16
  137. package/lib/request/index.js +2 -16
  138. package/lib/rso/connection.js +3 -34
  139. package/lib/rso/index.js +0 -7
  140. package/lib/rt.js +21 -52
  141. package/lib/unit-of-work/constants.js +1 -1
  142. package/lib/unit-of-work/index.js +27 -145
  143. package/lib/unit-of-work/json-adapter.js +14 -35
  144. package/lib/unit-of-work/op-result-value-reference.js +1 -11
  145. package/lib/unit-of-work/op-result.js +2 -13
  146. package/lib/urls.js +18 -15
  147. package/lib/user-agent.js +0 -7
  148. package/lib/users/index.js +345 -552
  149. package/lib/users/roles.js +79 -128
  150. package/lib/users/social/container.js +0 -16
  151. package/lib/users/social/index.js +166 -250
  152. package/lib/users/user.js +2 -9
  153. package/lib/users/utils.js +0 -3
  154. package/lib/utils.js +0 -17
  155. package/package.json +16 -16
  156. package/src/data/store.js +3 -1
  157. package/src/expression.js +16 -0
  158. package/src/files/utils.js +1 -1
  159. package/src/index.js +5 -0
@@ -1,95 +1,71 @@
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 _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
11
-
12
9
  var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
13
-
14
10
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
15
-
16
11
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
17
-
18
12
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
19
-
20
13
  var _dataQueryBuilder = _interopRequireDefault(require("../data/data-query-builder"));
21
-
22
14
  var UsersRoles = /*#__PURE__*/function () {
23
15
  function UsersRoles(users) {
24
16
  (0, _classCallCheck2["default"])(this, UsersRoles);
25
17
  this.users = users;
26
18
  this.app = users.app;
27
19
  }
28
-
29
20
  (0, _createClass2["default"])(UsersRoles, [{
30
21
  key: "findByRole",
31
22
  value: function () {
32
23
  var _findByRole = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(roleName, loadRoles, query) {
33
24
  var _this = this;
34
-
35
25
  var queryStringTokens;
36
26
  return _regenerator["default"].wrap(function _callee$(_context) {
37
- while (1) {
38
- switch (_context.prev = _context.next) {
39
- case 0:
40
- if (!(!roleName || typeof roleName !== 'string')) {
41
- _context.next = 2;
42
- break;
43
- }
44
-
45
- throw new Error('Role Name must be a string and can not be empty');
46
-
47
- case 2:
48
- if (!(loadRoles !== null && loadRoles !== undefined && typeof loadRoles !== 'boolean')) {
49
- _context.next = 4;
50
- break;
51
- }
52
-
53
- throw new Error('The second argument "loadRoles" can be a boolean only');
54
-
55
- case 4:
56
- if (!(query !== null && query !== undefined && (Array.isArray(query) || (0, _typeof2["default"])(query) !== 'object'))) {
57
- _context.next = 6;
58
- break;
59
- }
60
-
61
- throw new Error('The third argument "query" can be an instance of DataQueryBuilder or a plain object only');
62
-
63
- case 6:
64
- queryStringTokens = [];
65
-
66
- if (typeof loadRoles === 'boolean') {
67
- queryStringTokens.push("loadRoles=".concat(loadRoles));
68
- }
69
-
70
- if (query) {
71
- queryStringTokens.push(_dataQueryBuilder["default"].toQueryString(query));
72
- }
73
-
74
- return _context.abrupt("return", this.app.request.get({
75
- url: this.app.urls.usersRole(roleName),
76
- queryString: queryStringTokens.join('&')
77
- }).then(function (result) {
78
- return _this.users.dataStore.parseResponse(result);
79
- }));
80
-
81
- case 10:
82
- case "end":
83
- return _context.stop();
84
- }
27
+ while (1) switch (_context.prev = _context.next) {
28
+ case 0:
29
+ if (!(!roleName || typeof roleName !== 'string')) {
30
+ _context.next = 2;
31
+ break;
32
+ }
33
+ throw new Error('Role Name must be a string and can not be empty');
34
+ case 2:
35
+ if (!(loadRoles !== null && loadRoles !== undefined && typeof loadRoles !== 'boolean')) {
36
+ _context.next = 4;
37
+ break;
38
+ }
39
+ throw new Error('The second argument "loadRoles" can be a boolean only');
40
+ case 4:
41
+ if (!(query !== null && query !== undefined && (Array.isArray(query) || (0, _typeof2["default"])(query) !== 'object'))) {
42
+ _context.next = 6;
43
+ break;
44
+ }
45
+ throw new Error('The third argument "query" can be an instance of DataQueryBuilder or a plain object only');
46
+ case 6:
47
+ queryStringTokens = [];
48
+ if (typeof loadRoles === 'boolean') {
49
+ queryStringTokens.push("loadRoles=".concat(loadRoles));
50
+ }
51
+ if (query) {
52
+ queryStringTokens.push(_dataQueryBuilder["default"].toQueryString(query));
53
+ }
54
+ return _context.abrupt("return", this.app.request.get({
55
+ url: this.app.urls.usersRole(roleName),
56
+ queryString: queryStringTokens.join('&')
57
+ }).then(function (result) {
58
+ return _this.users.dataStore.parseResponse(result);
59
+ }));
60
+ case 10:
61
+ case "end":
62
+ return _context.stop();
85
63
  }
86
64
  }, _callee, this);
87
65
  }));
88
-
89
66
  function findByRole(_x, _x2, _x3) {
90
67
  return _findByRole.apply(this, arguments);
91
68
  }
92
-
93
69
  return findByRole;
94
70
  }()
95
71
  }, {
@@ -97,25 +73,20 @@ var UsersRoles = /*#__PURE__*/function () {
97
73
  value: function () {
98
74
  var _getUserRoles = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(userId) {
99
75
  return _regenerator["default"].wrap(function _callee2$(_context2) {
100
- while (1) {
101
- switch (_context2.prev = _context2.next) {
102
- case 0:
103
- return _context2.abrupt("return", this.app.request.get({
104
- url: this.app.urls.userRoles(userId)
105
- }));
106
-
107
- case 1:
108
- case "end":
109
- return _context2.stop();
110
- }
76
+ while (1) switch (_context2.prev = _context2.next) {
77
+ case 0:
78
+ return _context2.abrupt("return", this.app.request.get({
79
+ url: this.app.urls.userRoles(userId)
80
+ }));
81
+ case 1:
82
+ case "end":
83
+ return _context2.stop();
111
84
  }
112
85
  }, _callee2, this);
113
86
  }));
114
-
115
87
  function getUserRoles(_x4) {
116
88
  return _getUserRoles.apply(this, arguments);
117
89
  }
118
-
119
90
  return getUserRoles;
120
91
  }()
121
92
  }, {
@@ -123,23 +94,18 @@ var UsersRoles = /*#__PURE__*/function () {
123
94
  value: function () {
124
95
  var _assignRole = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(identity, rolename) {
125
96
  return _regenerator["default"].wrap(function _callee3$(_context3) {
126
- while (1) {
127
- switch (_context3.prev = _context3.next) {
128
- case 0:
129
- return _context3.abrupt("return", this.changeRole(identity, rolename, 'assignRole'));
130
-
131
- case 1:
132
- case "end":
133
- return _context3.stop();
134
- }
97
+ while (1) switch (_context3.prev = _context3.next) {
98
+ case 0:
99
+ return _context3.abrupt("return", this.changeRole(identity, rolename, 'assignRole'));
100
+ case 1:
101
+ case "end":
102
+ return _context3.stop();
135
103
  }
136
104
  }, _callee3, this);
137
105
  }));
138
-
139
106
  function assignRole(_x5, _x6) {
140
107
  return _assignRole.apply(this, arguments);
141
108
  }
142
-
143
109
  return assignRole;
144
110
  }()
145
111
  }, {
@@ -147,23 +113,18 @@ var UsersRoles = /*#__PURE__*/function () {
147
113
  value: function () {
148
114
  var _unassignRole = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(identity, rolename) {
149
115
  return _regenerator["default"].wrap(function _callee4$(_context4) {
150
- while (1) {
151
- switch (_context4.prev = _context4.next) {
152
- case 0:
153
- return _context4.abrupt("return", this.changeRole(identity, rolename, 'unassignRole'));
154
-
155
- case 1:
156
- case "end":
157
- return _context4.stop();
158
- }
116
+ while (1) switch (_context4.prev = _context4.next) {
117
+ case 0:
118
+ return _context4.abrupt("return", this.changeRole(identity, rolename, 'unassignRole'));
119
+ case 1:
120
+ case "end":
121
+ return _context4.stop();
159
122
  }
160
123
  }, _callee4, this);
161
124
  }));
162
-
163
125
  function unassignRole(_x7, _x8) {
164
126
  return _unassignRole.apply(this, arguments);
165
127
  }
166
-
167
128
  return unassignRole;
168
129
  }()
169
130
  }, {
@@ -171,49 +132,39 @@ var UsersRoles = /*#__PURE__*/function () {
171
132
  value: function () {
172
133
  var _changeRole = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(identity, roleName, operation) {
173
134
  return _regenerator["default"].wrap(function _callee5$(_context5) {
174
- while (1) {
175
- switch (_context5.prev = _context5.next) {
176
- case 0:
177
- if (!(!identity || !(typeof identity === 'string' || typeof identity === 'number'))) {
178
- _context5.next = 2;
179
- break;
180
- }
181
-
182
- throw new Error('User identity must be a string or number and can not be empty.');
183
-
184
- case 2:
185
- if (!(!roleName || typeof roleName !== 'string')) {
186
- _context5.next = 4;
187
- break;
135
+ while (1) switch (_context5.prev = _context5.next) {
136
+ case 0:
137
+ if (!(!identity || !(typeof identity === 'string' || typeof identity === 'number'))) {
138
+ _context5.next = 2;
139
+ break;
140
+ }
141
+ throw new Error('User identity must be a string or number and can not be empty.');
142
+ case 2:
143
+ if (!(!roleName || typeof roleName !== 'string')) {
144
+ _context5.next = 4;
145
+ break;
146
+ }
147
+ throw new Error('Role Name must be a string and can not be empty.');
148
+ case 4:
149
+ return _context5.abrupt("return", this.app.request.post({
150
+ url: this.app.urls.userRoleOperation(operation),
151
+ data: {
152
+ user: identity,
153
+ roleName: roleName
188
154
  }
189
-
190
- throw new Error('Role Name must be a string and can not be empty.');
191
-
192
- case 4:
193
- return _context5.abrupt("return", this.app.request.post({
194
- url: this.app.urls.userRoleOperation(operation),
195
- data: {
196
- user: identity,
197
- roleName: roleName
198
- }
199
- }));
200
-
201
- case 5:
202
- case "end":
203
- return _context5.stop();
204
- }
155
+ }));
156
+ case 5:
157
+ case "end":
158
+ return _context5.stop();
205
159
  }
206
160
  }, _callee5, this);
207
161
  }));
208
-
209
162
  function changeRole(_x9, _x10, _x11) {
210
163
  return _changeRole.apply(this, arguments);
211
164
  }
212
-
213
165
  return changeRole;
214
166
  }()
215
167
  }]);
216
168
  return UsersRoles;
217
169
  }();
218
-
219
170
  exports["default"] = UsersRoles;
@@ -1,53 +1,42 @@
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.SocialContainer = 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 SocialContainer = /*#__PURE__*/function () {
15
11
  function SocialContainer(socialType, container) {
16
12
  (0, _classCallCheck2["default"])(this, SocialContainer);
17
13
  this.socialType = socialType;
18
14
  this.container = container;
19
-
20
15
  if (container) {
21
16
  this.processContainer();
22
17
  } else {
23
18
  this.createContainer();
24
19
  }
25
20
  }
26
-
27
21
  (0, _createClass2["default"])(SocialContainer, [{
28
22
  key: "processContainer",
29
23
  value: function processContainer() {
30
24
  var _this = this;
31
-
32
25
  var client;
33
26
  var container = this.container[0] || this.container;
34
27
  var loadingMsg = document.createElement('div');
35
28
  loadingMsg.innerHTML = 'Loading...';
36
29
  container.appendChild(loadingMsg);
37
30
  container.style.cursor = 'wait';
38
-
39
31
  this.closeContainer = function () {
40
32
  container.style.cursor = 'default';
41
33
  container.removeChild(client);
42
34
  };
43
-
44
35
  this.removeLoading = function () {
45
36
  container.removeChild(loadingMsg);
46
37
  };
47
-
48
38
  this.doAuthorizationActivity = function (url) {
49
39
  _this.removeLoading();
50
-
51
40
  client = document.createElement('iframe');
52
41
  client.frameBorder = 0;
53
42
  client.width = container.style.width;
@@ -55,7 +44,6 @@ var SocialContainer = /*#__PURE__*/function () {
55
44
  client.id = 'SocialAuthFrame';
56
45
  client.setAttribute('src', url + '&output=embed');
57
46
  container.appendChild(client);
58
-
59
47
  client.onload = function () {
60
48
  container.style.cursor = 'default';
61
49
  };
@@ -68,14 +56,11 @@ var SocialContainer = /*#__PURE__*/function () {
68
56
  var body = container.document.getElementsByTagName('body')[0];
69
57
  body.innerHTML = 'Loading...';
70
58
  container.document.getElementsByTagName('html')[0].style.cursor = 'wait';
71
-
72
59
  this.closeContainer = function () {
73
60
  container.close();
74
61
  };
75
-
76
62
  this.doAuthorizationActivity = function (url) {
77
63
  container.location.href = url;
78
-
79
64
  container.onload = function () {
80
65
  container.document.getElementsByTagName('html')[0].style.cursor = 'default';
81
66
  };
@@ -84,5 +69,4 @@ var SocialContainer = /*#__PURE__*/function () {
84
69
  }]);
85
70
  return SocialContainer;
86
71
  }();
87
-
88
72
  exports.SocialContainer = SocialContainer;