backendless 6.5.1 → 6.5.3

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/backendless.d.ts CHANGED
@@ -336,7 +336,7 @@ declare module Backendless {
336
336
 
337
337
  delete(keys: Array<string>): Promise<void>;
338
338
 
339
- exists(keys: Array<string>): Promise<number>;
339
+ exist(keys: Array<string>): Promise<number>;
340
340
 
341
341
  touch(keys: Array<string>): Promise<void>;
342
342
  }
@@ -350,7 +350,7 @@ declare module Backendless {
350
350
 
351
351
  rename(newKeyName: string, overwrite?: boolean): Promise<void>;
352
352
 
353
- exists(): Promise<boolean>;
353
+ exist(): Promise<boolean>;
354
354
 
355
355
  getExpiration(): Promise<number>;
356
356
 
@@ -414,9 +414,9 @@ declare module Backendless {
414
414
 
415
415
  get(indexFrom: number, indexTo: number): Promise<Array<JSONValue>>
416
416
 
417
- set(values: Array<string>): Promise<number>;
417
+ set(values: Array<JSONValue>): Promise<number>;
418
418
 
419
- set(value: string, index: number): Promise<void>;
419
+ set(value: JSONValue, index: number): Promise<void>;
420
420
 
421
421
  insertBefore(valueToInsert: JSONValue, anchorValue: JSONValue): Promise<number>;
422
422
 
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * ********************************************************************************************************************
3
- * Backendless SDK for JavaScript. Version: 6.5.1
3
+ * Backendless SDK for JavaScript. Version: 6.5.3
4
4
  *
5
5
  * Copyright 2012-2022 BACKENDLESS.COM. All Rights Reserved.
6
6
  *
@@ -18713,16 +18713,16 @@ var HiveStore = /*#__PURE__*/function () {
18713
18713
  return this.constructor["delete"].call(_objectSpread(_objectSpread({}, this), this.constructor), [this.storeKey]);
18714
18714
  }
18715
18715
  }, {
18716
- key: "exists",
18716
+ key: "exist",
18717
18717
  value: function () {
18718
- var _exists = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
18718
+ var _exist = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
18719
18719
  var result;
18720
18720
  return _regenerator["default"].wrap(function _callee$(_context) {
18721
18721
  while (1) {
18722
18722
  switch (_context.prev = _context.next) {
18723
18723
  case 0:
18724
18724
  _context.next = 2;
18725
- return this.constructor.exists.call(_objectSpread(_objectSpread({}, this), this.constructor), [this.storeKey]);
18725
+ return this.constructor.exist.call(_objectSpread(_objectSpread({}, this), this.constructor), [this.storeKey]);
18726
18726
 
18727
18727
  case 2:
18728
18728
  result = _context.sent;
@@ -18736,11 +18736,11 @@ var HiveStore = /*#__PURE__*/function () {
18736
18736
  }, _callee, this);
18737
18737
  }));
18738
18738
 
18739
- function exists() {
18740
- return _exists.apply(this, arguments);
18739
+ function exist() {
18740
+ return _exist.apply(this, arguments);
18741
18741
  }
18742
18742
 
18743
- return exists;
18743
+ return exist;
18744
18744
  }()
18745
18745
  }, {
18746
18746
  key: "rename",
@@ -18883,14 +18883,14 @@ var HiveStore = /*#__PURE__*/function () {
18883
18883
  });
18884
18884
  }
18885
18885
  }, {
18886
- key: "exists",
18887
- value: function exists(keys) {
18886
+ key: "exist",
18887
+ value: function exist(keys) {
18888
18888
  if (!Array.isArray(keys)) {
18889
18889
  throw new Error('Keys must be provided and must be a list of strings.');
18890
18890
  }
18891
18891
 
18892
18892
  return this.app.request.post({
18893
- url: "".concat(this.app.urls.hiveStore(this.hiveName, this.TYPE), "/action/exists"),
18893
+ url: "".concat(this.app.urls.hiveStore(this.hiveName, this.TYPE), "/action/exist"),
18894
18894
  data: keys
18895
18895
  });
18896
18896
  }
@@ -18911,7 +18911,7 @@ var HiveStore = /*#__PURE__*/function () {
18911
18911
  }();
18912
18912
 
18913
18913
  exports.HiveStore = HiveStore;
18914
- (0, _defineProperty2["default"])(HiveStore, "STATIC_METHODS", ['keys', 'delete', 'exists', 'touch']);
18914
+ (0, _defineProperty2["default"])(HiveStore, "STATIC_METHODS", ['keys', 'delete', 'exist', 'touch']);
18915
18915
 
18916
18916
  /***/ }),
18917
18917
 
@@ -19253,14 +19253,22 @@ var ListStore = /*#__PURE__*/function (_HiveStore) {
19253
19253
  }, {
19254
19254
  key: "set",
19255
19255
  value: function set(value, index) {
19256
- if (Array.isArray(value)) {
19256
+ if (typeof index === 'undefined') {
19257
+ if (!value || !Array.isArray(value) || !value.length || !(0, _utils.isHiveValueValid)(value)) {
19258
+ throw new Error('Value must be provided and must be a list of valid JSON items.');
19259
+ }
19260
+
19257
19261
  return this.app.request.put({
19258
19262
  url: this.getBaseURL(),
19259
19263
  data: value
19260
19264
  });
19261
19265
  }
19262
19266
 
19263
- if (isNaN(index) || typeof index !== 'number') {
19267
+ if (!(0, _utils.isHiveValueValid)(value)) {
19268
+ throw new Error('Value must be provided and must be one of types: string, number, boolean, object, array.');
19269
+ }
19270
+
19271
+ if (typeof index !== 'number' || isNaN(index)) {
19264
19272
  throw new Error('Index must be a number.');
19265
19273
  }
19266
19274
 
@@ -19292,7 +19300,7 @@ var ListStore = /*#__PURE__*/function (_HiveStore) {
19292
19300
  key: "insert",
19293
19301
  value: function insert(valueToInsert, anchorValue, before) {
19294
19302
  if (!(0, _utils.isHiveValueValid)(valueToInsert)) {
19295
- throw new Error('ValueToInsert must be provided and must be on of types: string, number, boolean, object, array.');
19303
+ throw new Error('ValueToInsert must be provided and must be one of types: string, number, boolean, object, array.');
19296
19304
  }
19297
19305
 
19298
19306
  if (!(0, _utils.isHiveValueValid)(anchorValue)) {