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,28 +1,20 @@
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 _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
13
-
14
10
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
15
-
16
11
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
17
-
18
12
  var _counter = _interopRequireDefault(require("./counter"));
19
-
20
13
  var Counters = /*#__PURE__*/function () {
21
14
  function Counters(app) {
22
15
  (0, _classCallCheck2["default"])(this, Counters);
23
16
  this.app = app;
24
17
  }
25
-
26
18
  (0, _createClass2["default"])(Counters, [{
27
19
  key: "of",
28
20
  value: function of(name) {
@@ -33,33 +25,26 @@ var Counters = /*#__PURE__*/function () {
33
25
  value: function () {
34
26
  var _list = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(pattern) {
35
27
  return _regenerator["default"].wrap(function _callee$(_context) {
36
- while (1) {
37
- switch (_context.prev = _context.next) {
38
- case 0:
39
- if (!(pattern !== null && pattern !== undefined && typeof pattern !== 'string')) {
40
- _context.next = 2;
41
- break;
42
- }
43
-
44
- throw new Error('Counters Pattern can be a string only');
45
-
46
- case 2:
47
- return _context.abrupt("return", this.app.request.get({
48
- url: this.app.urls.countersList(pattern)
49
- }));
50
-
51
- case 3:
52
- case "end":
53
- return _context.stop();
54
- }
28
+ while (1) switch (_context.prev = _context.next) {
29
+ case 0:
30
+ if (!(pattern !== null && pattern !== undefined && typeof pattern !== 'string')) {
31
+ _context.next = 2;
32
+ break;
33
+ }
34
+ throw new Error('Counters Pattern can be a string only');
35
+ case 2:
36
+ return _context.abrupt("return", this.app.request.get({
37
+ url: this.app.urls.countersList(pattern)
38
+ }));
39
+ case 3:
40
+ case "end":
41
+ return _context.stop();
55
42
  }
56
43
  }, _callee, this);
57
44
  }));
58
-
59
45
  function list(_x) {
60
46
  return _list.apply(this, arguments);
61
47
  }
62
-
63
48
  return list;
64
49
  }()
65
50
  }, {
@@ -67,33 +52,26 @@ var Counters = /*#__PURE__*/function () {
67
52
  value: function () {
68
53
  var _incrementAndGet = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(counterName) {
69
54
  return _regenerator["default"].wrap(function _callee2$(_context2) {
70
- while (1) {
71
- switch (_context2.prev = _context2.next) {
72
- case 0:
73
- if (!(!counterName || typeof counterName !== 'string')) {
74
- _context2.next = 2;
75
- break;
76
- }
77
-
78
- throw new Error('Counter Name must be provided and must be a string.');
79
-
80
- case 2:
81
- return _context2.abrupt("return", this.app.request.put({
82
- url: this.app.urls.counterIncrementAndGet(counterName)
83
- }));
84
-
85
- case 3:
86
- case "end":
87
- return _context2.stop();
88
- }
55
+ while (1) switch (_context2.prev = _context2.next) {
56
+ case 0:
57
+ if (!(!counterName || typeof counterName !== 'string')) {
58
+ _context2.next = 2;
59
+ break;
60
+ }
61
+ throw new Error('Counter Name must be provided and must be a string.');
62
+ case 2:
63
+ return _context2.abrupt("return", this.app.request.put({
64
+ url: this.app.urls.counterIncrementAndGet(counterName)
65
+ }));
66
+ case 3:
67
+ case "end":
68
+ return _context2.stop();
89
69
  }
90
70
  }, _callee2, this);
91
71
  }));
92
-
93
72
  function incrementAndGet(_x2) {
94
73
  return _incrementAndGet.apply(this, arguments);
95
74
  }
96
-
97
75
  return incrementAndGet;
98
76
  }()
99
77
  }, {
@@ -101,33 +79,26 @@ var Counters = /*#__PURE__*/function () {
101
79
  value: function () {
102
80
  var _getAndIncrement = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(counterName) {
103
81
  return _regenerator["default"].wrap(function _callee3$(_context3) {
104
- while (1) {
105
- switch (_context3.prev = _context3.next) {
106
- case 0:
107
- if (!(!counterName || typeof counterName !== 'string')) {
108
- _context3.next = 2;
109
- break;
110
- }
111
-
112
- throw new Error('Counter Name must be provided and must be a string.');
113
-
114
- case 2:
115
- return _context3.abrupt("return", this.app.request.put({
116
- url: this.app.urls.counterGetAndIncrement(counterName)
117
- }));
118
-
119
- case 3:
120
- case "end":
121
- return _context3.stop();
122
- }
82
+ while (1) switch (_context3.prev = _context3.next) {
83
+ case 0:
84
+ if (!(!counterName || typeof counterName !== 'string')) {
85
+ _context3.next = 2;
86
+ break;
87
+ }
88
+ throw new Error('Counter Name must be provided and must be a string.');
89
+ case 2:
90
+ return _context3.abrupt("return", this.app.request.put({
91
+ url: this.app.urls.counterGetAndIncrement(counterName)
92
+ }));
93
+ case 3:
94
+ case "end":
95
+ return _context3.stop();
123
96
  }
124
97
  }, _callee3, this);
125
98
  }));
126
-
127
99
  function getAndIncrement(_x3) {
128
100
  return _getAndIncrement.apply(this, arguments);
129
101
  }
130
-
131
102
  return getAndIncrement;
132
103
  }()
133
104
  }, {
@@ -135,33 +106,26 @@ var Counters = /*#__PURE__*/function () {
135
106
  value: function () {
136
107
  var _decrementAndGet = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(counterName) {
137
108
  return _regenerator["default"].wrap(function _callee4$(_context4) {
138
- while (1) {
139
- switch (_context4.prev = _context4.next) {
140
- case 0:
141
- if (!(!counterName || typeof counterName !== 'string')) {
142
- _context4.next = 2;
143
- break;
144
- }
145
-
146
- throw new Error('Counter Name must be provided and must be a string.');
147
-
148
- case 2:
149
- return _context4.abrupt("return", this.app.request.put({
150
- url: this.app.urls.counterDecrementAndGet(counterName)
151
- }));
152
-
153
- case 3:
154
- case "end":
155
- return _context4.stop();
156
- }
109
+ while (1) switch (_context4.prev = _context4.next) {
110
+ case 0:
111
+ if (!(!counterName || typeof counterName !== 'string')) {
112
+ _context4.next = 2;
113
+ break;
114
+ }
115
+ throw new Error('Counter Name must be provided and must be a string.');
116
+ case 2:
117
+ return _context4.abrupt("return", this.app.request.put({
118
+ url: this.app.urls.counterDecrementAndGet(counterName)
119
+ }));
120
+ case 3:
121
+ case "end":
122
+ return _context4.stop();
157
123
  }
158
124
  }, _callee4, this);
159
125
  }));
160
-
161
126
  function decrementAndGet(_x4) {
162
127
  return _decrementAndGet.apply(this, arguments);
163
128
  }
164
-
165
129
  return decrementAndGet;
166
130
  }()
167
131
  }, {
@@ -169,33 +133,26 @@ var Counters = /*#__PURE__*/function () {
169
133
  value: function () {
170
134
  var _getAndDecrement = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(counterName) {
171
135
  return _regenerator["default"].wrap(function _callee5$(_context5) {
172
- while (1) {
173
- switch (_context5.prev = _context5.next) {
174
- case 0:
175
- if (!(!counterName || typeof counterName !== 'string')) {
176
- _context5.next = 2;
177
- break;
178
- }
179
-
180
- throw new Error('Counter Name must be provided and must be a string.');
181
-
182
- case 2:
183
- return _context5.abrupt("return", this.app.request.put({
184
- url: this.app.urls.counterGetAndDecrement(counterName)
185
- }));
186
-
187
- case 3:
188
- case "end":
189
- return _context5.stop();
190
- }
136
+ while (1) switch (_context5.prev = _context5.next) {
137
+ case 0:
138
+ if (!(!counterName || typeof counterName !== 'string')) {
139
+ _context5.next = 2;
140
+ break;
141
+ }
142
+ throw new Error('Counter Name must be provided and must be a string.');
143
+ case 2:
144
+ return _context5.abrupt("return", this.app.request.put({
145
+ url: this.app.urls.counterGetAndDecrement(counterName)
146
+ }));
147
+ case 3:
148
+ case "end":
149
+ return _context5.stop();
191
150
  }
192
151
  }, _callee5, this);
193
152
  }));
194
-
195
153
  function getAndDecrement(_x5) {
196
154
  return _getAndDecrement.apply(this, arguments);
197
155
  }
198
-
199
156
  return getAndDecrement;
200
157
  }()
201
158
  }, {
@@ -203,33 +160,26 @@ var Counters = /*#__PURE__*/function () {
203
160
  value: function () {
204
161
  var _reset = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(counterName) {
205
162
  return _regenerator["default"].wrap(function _callee6$(_context6) {
206
- while (1) {
207
- switch (_context6.prev = _context6.next) {
208
- case 0:
209
- if (!(!counterName || typeof counterName !== 'string')) {
210
- _context6.next = 2;
211
- break;
212
- }
213
-
214
- throw new Error('Counter Name must be provided and must be a string.');
215
-
216
- case 2:
217
- return _context6.abrupt("return", this.app.request.put({
218
- url: this.app.urls.counterReset(counterName)
219
- }));
220
-
221
- case 3:
222
- case "end":
223
- return _context6.stop();
224
- }
163
+ while (1) switch (_context6.prev = _context6.next) {
164
+ case 0:
165
+ if (!(!counterName || typeof counterName !== 'string')) {
166
+ _context6.next = 2;
167
+ break;
168
+ }
169
+ throw new Error('Counter Name must be provided and must be a string.');
170
+ case 2:
171
+ return _context6.abrupt("return", this.app.request.put({
172
+ url: this.app.urls.counterReset(counterName)
173
+ }));
174
+ case 3:
175
+ case "end":
176
+ return _context6.stop();
225
177
  }
226
178
  }, _callee6, this);
227
179
  }));
228
-
229
180
  function reset(_x6) {
230
181
  return _reset.apply(this, arguments);
231
182
  }
232
-
233
183
  return reset;
234
184
  }()
235
185
  }, {
@@ -237,33 +187,26 @@ var Counters = /*#__PURE__*/function () {
237
187
  value: function () {
238
188
  var _get = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7(counterName) {
239
189
  return _regenerator["default"].wrap(function _callee7$(_context7) {
240
- while (1) {
241
- switch (_context7.prev = _context7.next) {
242
- case 0:
243
- if (!(!counterName || typeof counterName !== 'string')) {
244
- _context7.next = 2;
245
- break;
246
- }
247
-
248
- throw new Error('Counter Name must be provided and must be a string.');
249
-
250
- case 2:
251
- return _context7.abrupt("return", this.app.request.get({
252
- url: this.app.urls.counter(counterName)
253
- }));
254
-
255
- case 3:
256
- case "end":
257
- return _context7.stop();
258
- }
190
+ while (1) switch (_context7.prev = _context7.next) {
191
+ case 0:
192
+ if (!(!counterName || typeof counterName !== 'string')) {
193
+ _context7.next = 2;
194
+ break;
195
+ }
196
+ throw new Error('Counter Name must be provided and must be a string.');
197
+ case 2:
198
+ return _context7.abrupt("return", this.app.request.get({
199
+ url: this.app.urls.counter(counterName)
200
+ }));
201
+ case 3:
202
+ case "end":
203
+ return _context7.stop();
259
204
  }
260
205
  }, _callee7, this);
261
206
  }));
262
-
263
207
  function get(_x7) {
264
208
  return _get.apply(this, arguments);
265
209
  }
266
-
267
210
  return get;
268
211
  }()
269
212
  }, {
@@ -271,44 +214,35 @@ var Counters = /*#__PURE__*/function () {
271
214
  value: function () {
272
215
  var _addAndGet = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8(counterName, value) {
273
216
  return _regenerator["default"].wrap(function _callee8$(_context8) {
274
- while (1) {
275
- switch (_context8.prev = _context8.next) {
276
- case 0:
277
- if (!(!counterName || typeof counterName !== 'string')) {
278
- _context8.next = 2;
279
- break;
217
+ while (1) switch (_context8.prev = _context8.next) {
218
+ case 0:
219
+ if (!(!counterName || typeof counterName !== 'string')) {
220
+ _context8.next = 2;
221
+ break;
222
+ }
223
+ throw new Error('Counter Name must be provided and must be a string.');
224
+ case 2:
225
+ if (!(typeof value !== 'number')) {
226
+ _context8.next = 4;
227
+ break;
228
+ }
229
+ throw new Error('Counter Value must be a number.');
230
+ case 4:
231
+ return _context8.abrupt("return", this.app.request.put({
232
+ url: this.app.urls.counterAddAndGet(counterName),
233
+ query: {
234
+ value: value
280
235
  }
281
-
282
- throw new Error('Counter Name must be provided and must be a string.');
283
-
284
- case 2:
285
- if (!(typeof value !== 'number')) {
286
- _context8.next = 4;
287
- break;
288
- }
289
-
290
- throw new Error('Counter Value must be a number.');
291
-
292
- case 4:
293
- return _context8.abrupt("return", this.app.request.put({
294
- url: this.app.urls.counterAddAndGet(counterName),
295
- query: {
296
- value: value
297
- }
298
- }));
299
-
300
- case 5:
301
- case "end":
302
- return _context8.stop();
303
- }
236
+ }));
237
+ case 5:
238
+ case "end":
239
+ return _context8.stop();
304
240
  }
305
241
  }, _callee8, this);
306
242
  }));
307
-
308
243
  function addAndGet(_x8, _x9) {
309
244
  return _addAndGet.apply(this, arguments);
310
245
  }
311
-
312
246
  return addAndGet;
313
247
  }()
314
248
  }, {
@@ -316,44 +250,35 @@ var Counters = /*#__PURE__*/function () {
316
250
  value: function () {
317
251
  var _getAndAdd = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9(counterName, value) {
318
252
  return _regenerator["default"].wrap(function _callee9$(_context9) {
319
- while (1) {
320
- switch (_context9.prev = _context9.next) {
321
- case 0:
322
- if (!(!counterName || typeof counterName !== 'string')) {
323
- _context9.next = 2;
324
- break;
253
+ while (1) switch (_context9.prev = _context9.next) {
254
+ case 0:
255
+ if (!(!counterName || typeof counterName !== 'string')) {
256
+ _context9.next = 2;
257
+ break;
258
+ }
259
+ throw new Error('Counter Name must be provided and must be a string.');
260
+ case 2:
261
+ if (!(typeof value !== 'number')) {
262
+ _context9.next = 4;
263
+ break;
264
+ }
265
+ throw new Error('Counter Value must be a number.');
266
+ case 4:
267
+ return _context9.abrupt("return", this.app.request.put({
268
+ url: this.app.urls.counterGetAndAdd(counterName),
269
+ query: {
270
+ value: value
325
271
  }
326
-
327
- throw new Error('Counter Name must be provided and must be a string.');
328
-
329
- case 2:
330
- if (!(typeof value !== 'number')) {
331
- _context9.next = 4;
332
- break;
333
- }
334
-
335
- throw new Error('Counter Value must be a number.');
336
-
337
- case 4:
338
- return _context9.abrupt("return", this.app.request.put({
339
- url: this.app.urls.counterGetAndAdd(counterName),
340
- query: {
341
- value: value
342
- }
343
- }));
344
-
345
- case 5:
346
- case "end":
347
- return _context9.stop();
348
- }
272
+ }));
273
+ case 5:
274
+ case "end":
275
+ return _context9.stop();
349
276
  }
350
277
  }, _callee9, this);
351
278
  }));
352
-
353
279
  function getAndAdd(_x10, _x11) {
354
280
  return _getAndAdd.apply(this, arguments);
355
281
  }
356
-
357
282
  return getAndAdd;
358
283
  }()
359
284
  }, {
@@ -361,57 +286,45 @@ var Counters = /*#__PURE__*/function () {
361
286
  value: function () {
362
287
  var _compareAndSet = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee10(counterName, expected, updated) {
363
288
  return _regenerator["default"].wrap(function _callee10$(_context10) {
364
- while (1) {
365
- switch (_context10.prev = _context10.next) {
366
- case 0:
367
- if (!(!counterName || typeof counterName !== 'string')) {
368
- _context10.next = 2;
369
- break;
370
- }
371
-
372
- throw new Error('Counter Name must be provided and must be a string.');
373
-
374
- case 2:
375
- if (!(typeof expected !== 'number')) {
376
- _context10.next = 4;
377
- break;
289
+ while (1) switch (_context10.prev = _context10.next) {
290
+ case 0:
291
+ if (!(!counterName || typeof counterName !== 'string')) {
292
+ _context10.next = 2;
293
+ break;
294
+ }
295
+ throw new Error('Counter Name must be provided and must be a string.');
296
+ case 2:
297
+ if (!(typeof expected !== 'number')) {
298
+ _context10.next = 4;
299
+ break;
300
+ }
301
+ throw new Error('Counter Expected Value must be a number.');
302
+ case 4:
303
+ if (!(typeof updated !== 'number')) {
304
+ _context10.next = 6;
305
+ break;
306
+ }
307
+ throw new Error('Counter Updated Value must be a number.');
308
+ case 6:
309
+ return _context10.abrupt("return", this.app.request.put({
310
+ url: this.app.urls.counterCompareAndSet(counterName),
311
+ query: {
312
+ expected: expected,
313
+ updatedvalue: updated
378
314
  }
379
-
380
- throw new Error('Counter Expected Value must be a number.');
381
-
382
- case 4:
383
- if (!(typeof updated !== 'number')) {
384
- _context10.next = 6;
385
- break;
386
- }
387
-
388
- throw new Error('Counter Updated Value must be a number.');
389
-
390
- case 6:
391
- return _context10.abrupt("return", this.app.request.put({
392
- url: this.app.urls.counterCompareAndSet(counterName),
393
- query: {
394
- expected: expected,
395
- updatedvalue: updated
396
- }
397
- }));
398
-
399
- case 7:
400
- case "end":
401
- return _context10.stop();
402
- }
315
+ }));
316
+ case 7:
317
+ case "end":
318
+ return _context10.stop();
403
319
  }
404
320
  }, _callee10, this);
405
321
  }));
406
-
407
322
  function compareAndSet(_x12, _x13, _x14) {
408
323
  return _compareAndSet.apply(this, arguments);
409
324
  }
410
-
411
325
  return compareAndSet;
412
326
  }()
413
327
  }]);
414
328
  return Counters;
415
329
  }();
416
-
417
330
  exports["default"] = Counters;