backendless 6.5.0 → 6.5.1

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.
@@ -25,7 +25,7 @@ var _baseStore = require("./base-store");
25
25
 
26
26
  var _constants = require("../constants");
27
27
 
28
- var _utils = _interopRequireDefault(require("../../utils"));
28
+ var _utils = require("../utils");
29
29
 
30
30
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
31
31
 
@@ -77,55 +77,99 @@ var SetStore = /*#__PURE__*/function (_HiveStore) {
77
77
  });
78
78
  }
79
79
  }, {
80
- key: "set",
81
- value: function set(values) {
82
- if (!values || typeof values !== 'string' && !Array.isArray(values)) {
83
- throw new Error('Value(s) must be provided and must be a string or list of strings.');
80
+ key: "setValue",
81
+ value: function setValue(value) {
82
+ if (!(0, _utils.isHiveValueValid)(value)) {
83
+ throw new Error('Value must be provided and must be one of types: string, number, boolean, object, array.');
84
84
  }
85
85
 
86
86
  return this.app.request.put({
87
87
  url: this.getBaseURL(),
88
- data: _utils["default"].castArray(values)
88
+ data: [value]
89
89
  });
90
90
  }
91
91
  }, {
92
- key: "add",
93
- value: function add(values) {
94
- if (!values || !(typeof values === 'string' || Array.isArray(values))) {
95
- throw new Error('Value(s) must be provided and must be a string or list of strings.');
92
+ key: "setValues",
93
+ value: function setValues(values) {
94
+ if (!values || !Array.isArray(values) || !values.length || !(0, _utils.isHiveValueValid)(values)) {
95
+ throw new Error('Value must be provided and must be a list of valid JSON items.');
96
+ }
97
+
98
+ return this.app.request.put({
99
+ url: this.getBaseURL(),
100
+ data: values
101
+ });
102
+ }
103
+ }, {
104
+ key: "addValue",
105
+ value: function addValue(value) {
106
+ if (!(0, _utils.isHiveValueValid)(value)) {
107
+ throw new Error('Value must be provided and must be one of types: string, number, boolean, object, array.');
108
+ }
109
+
110
+ return this.app.request.put({
111
+ url: "".concat(this.getBaseURL(), "/add"),
112
+ data: [value]
113
+ });
114
+ }
115
+ }, {
116
+ key: "addValues",
117
+ value: function addValues(values) {
118
+ if (!values || !Array.isArray(values) || !values.length || !(0, _utils.isHiveValueValid)(values)) {
119
+ throw new Error('Value must be provided and must be a list of valid JSON items.');
96
120
  }
97
121
 
98
122
  return this.app.request.put({
99
123
  url: "".concat(this.getBaseURL(), "/add"),
100
- data: _utils["default"].castArray(values)
124
+ data: values
125
+ });
126
+ }
127
+ }, {
128
+ key: "deleteValue",
129
+ value: function deleteValue(value) {
130
+ if (!(0, _utils.isHiveValueValid)(value)) {
131
+ throw new Error('Value must be provided and must be one of types: string, number, boolean, object, array.');
132
+ }
133
+
134
+ return this.app.request["delete"]({
135
+ url: "".concat(this.getBaseURL(), "/values"),
136
+ data: [value]
101
137
  });
102
138
  }
103
139
  }, {
104
140
  key: "deleteValues",
105
141
  value: function deleteValues(values) {
106
- if (!values || !(typeof values === 'string' || Array.isArray(values))) {
107
- throw new Error('Value(s) must be provided and must be a string or list of strings.');
142
+ if (!values || !Array.isArray(values) || !values.length || !(0, _utils.isHiveValueValid)(values)) {
143
+ throw new Error('Value must be provided and must be a list of valid JSON items.');
108
144
  }
109
145
 
110
146
  return this.app.request["delete"]({
111
147
  url: "".concat(this.getBaseURL(), "/values"),
112
- data: _utils["default"].castArray(values)
148
+ data: values
113
149
  });
114
150
  }
115
151
  }, {
116
- key: "isMember",
117
- value: function isMember(value) {
118
- if (typeof value === 'string') {
119
- value = [value];
152
+ key: "isValueMember",
153
+ value: function isValueMember(value) {
154
+ if (!(0, _utils.isHiveValueValid)(value)) {
155
+ throw new Error('Value must be provided and must be one of types: string, number, boolean, object, array.');
120
156
  }
121
157
 
122
- if (!Array.isArray(value)) {
123
- throw new Error('Value must be provided and must be a string or a list of strings.');
158
+ return this.app.request.post({
159
+ url: "".concat(this.getBaseURL(), "/contains"),
160
+ data: [value]
161
+ });
162
+ }
163
+ }, {
164
+ key: "isValuesMembers",
165
+ value: function isValuesMembers(values) {
166
+ if (!values || !Array.isArray(values) || !values.length || !(0, _utils.isHiveValueValid)(values)) {
167
+ throw new Error('Value must be provided and must be a list of valid JSON items.');
124
168
  }
125
169
 
126
170
  return this.app.request.post({
127
171
  url: "".concat(this.getBaseURL(), "/contains"),
128
- data: value
172
+ data: values
129
173
  });
130
174
  }
131
175
  }, {
@@ -29,6 +29,8 @@ var _utils = _interopRequireDefault(require("../../utils"));
29
29
 
30
30
  var _set = require("./set");
31
31
 
32
+ var _utils2 = require("../utils");
33
+
32
34
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
33
35
 
34
36
  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; }
@@ -123,8 +125,8 @@ var SortedSetStore = /*#__PURE__*/function (_HiveStore) {
123
125
  }, {
124
126
  key: "incrementScore",
125
127
  value: function incrementScore(value, scoreValue) {
126
- if (!value || typeof value !== 'string') {
127
- throw new Error('Value must be provided and must be a string.');
128
+ if (!(0, _utils2.isHiveValueValid)(value)) {
129
+ throw new Error('Value must be provided and must be one of types: string, number, boolean, object, array.');
128
130
  }
129
131
 
130
132
  if (isNaN(scoreValue) || typeof scoreValue !== 'number') {
@@ -142,8 +144,8 @@ var SortedSetStore = /*#__PURE__*/function (_HiveStore) {
142
144
  }, {
143
145
  key: "decrementScore",
144
146
  value: function decrementScore(value, scoreValue) {
145
- if (!value || typeof value !== 'string') {
146
- throw new Error('Value must be provided and must be a string.');
147
+ if (!(0, _utils2.isHiveValueValid)(value)) {
148
+ throw new Error('Value must be provided and must be one of types: string, number, boolean, object, array.');
147
149
  }
148
150
 
149
151
  if (isNaN(scoreValue) || typeof scoreValue !== 'number') {
@@ -214,8 +216,8 @@ var SortedSetStore = /*#__PURE__*/function (_HiveStore) {
214
216
  }, {
215
217
  key: "getScore",
216
218
  value: function getScore(value) {
217
- if (!value || typeof value !== 'string') {
218
- throw new Error('Value must be provided and must be a string.');
219
+ if (!(0, _utils2.isHiveValueValid)(value)) {
220
+ throw new Error('Value must be provided and must be one of types: string, number, boolean, object, array.');
219
221
  }
220
222
 
221
223
  return this.app.request.post({
@@ -228,8 +230,8 @@ var SortedSetStore = /*#__PURE__*/function (_HiveStore) {
228
230
  }, {
229
231
  key: "getRank",
230
232
  value: function getRank(value, reverse) {
231
- if (!value || typeof value !== 'string') {
232
- throw new Error('Value must be provided and must be a string.');
233
+ if (!(0, _utils2.isHiveValueValid)(value)) {
234
+ throw new Error('Value must be provided and must be one of types: string, number, boolean, object, array.');
233
235
  }
234
236
 
235
237
  if (reverse !== undefined && typeof reverse !== 'boolean') {
@@ -335,16 +337,28 @@ var SortedSetStore = /*#__PURE__*/function (_HiveStore) {
335
337
  query: _objectSpread({}, options)
336
338
  });
337
339
  }
340
+ }, {
341
+ key: "deleteValue",
342
+ value: function deleteValue(value) {
343
+ if (!(0, _utils2.isHiveValueValid)(value)) {
344
+ throw new Error('Value must be provided and must be one of types: string, number, boolean, object, array.');
345
+ }
346
+
347
+ return this.app.request["delete"]({
348
+ url: "".concat(this.getBaseURL(), "/values"),
349
+ data: [value]
350
+ });
351
+ }
338
352
  }, {
339
353
  key: "deleteValues",
340
354
  value: function deleteValues(values) {
341
- if (!values || !(typeof values === 'string' || Array.isArray(values))) {
342
- throw new Error('Value(s) must be provided and must be a string or list of strings.');
355
+ if (!values || !Array.isArray(values) || !values.length || !(0, _utils2.isHiveValueValid)(values)) {
356
+ throw new Error('Value must be provided and must be a list of JSON items.');
343
357
  }
344
358
 
345
359
  return this.app.request["delete"]({
346
360
  url: "".concat(this.getBaseURL(), "/values"),
347
- data: _utils["default"].castArray(values)
361
+ data: values
348
362
  });
349
363
  }
350
364
  }, {
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isHiveValueValid = isHiveValueValid;
7
+
8
+ function isHiveValueValid(value) {
9
+ if (value == null) {
10
+ return false;
11
+ }
12
+
13
+ try {
14
+ var json = JSON.stringify(value);
15
+ return !!json;
16
+ } catch (_unused) {
17
+ return false;
18
+ }
19
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "backendless",
3
- "version": "6.5.0",
3
+ "version": "6.5.1",
4
4
  "description": "Backendless JavaScript SDK for Node.js and the browser",
5
5
  "browser": "dist/backendless.js",
6
6
  "main": "lib/index.js",
@@ -1,6 +1,7 @@
1
1
  import { HiveTypes } from '../constants'
2
2
  import { HiveStore } from './base-store'
3
3
  import Utils from '../../utils'
4
+ import { isHiveValueValid } from '../utils'
4
5
 
5
6
  export class KeyValueStore extends HiveStore {
6
7
 
@@ -57,6 +58,10 @@ export class KeyValueStore extends HiveStore {
57
58
  }
58
59
  }
59
60
 
61
+ if (!isHiveValueValid(value)) {
62
+ throw new Error('Value must be provided and must be one of types: string, number, boolean, object, array.')
63
+ }
64
+
60
65
  return this.app.request
61
66
  .put({
62
67
  url : `${this.app.urls.hiveStore(this.hiveName, this.TYPE)}/${key}`,
@@ -1,6 +1,6 @@
1
1
  import { HiveTypes } from '../constants'
2
2
  import { HiveStore } from './base-store'
3
- import Utils from '../../utils'
3
+ import { isHiveValueValid } from '../utils'
4
4
 
5
5
  export class ListStore extends HiveStore {
6
6
 
@@ -78,12 +78,12 @@ export class ListStore extends HiveStore {
78
78
  }
79
79
 
80
80
  insert(valueToInsert, anchorValue, before) {
81
- if (!valueToInsert || typeof valueToInsert !== 'string') {
82
- throw new Error('ValueToInsert must be provided and must be a string.')
81
+ if (!isHiveValueValid(valueToInsert)) {
82
+ throw new Error('ValueToInsert must be provided and must be on of types: string, number, boolean, object, array.')
83
83
  }
84
84
 
85
- if (!anchorValue || typeof anchorValue !== 'string') {
86
- throw new Error('AnchorValue must be provided and must be a string.')
85
+ if (!isHiveValueValid(anchorValue)) {
86
+ throw new Error('AnchorValue must be provided and must be one of types: string, number, boolean, object, array.')
87
87
  }
88
88
 
89
89
  return this.app.request
@@ -97,8 +97,8 @@ export class ListStore extends HiveStore {
97
97
  }
98
98
 
99
99
  deleteValue(value, count) {
100
- if (!value || typeof value !== 'string') {
101
- throw new Error('Value must be provided and must be a string.')
100
+ if (!isHiveValueValid(value)) {
101
+ throw new Error('Value must be provided and must be one of types: string, number, boolean, object, array.')
102
102
  }
103
103
 
104
104
  if (count !== undefined && (isNaN(count) || typeof count !== 'number')) {
@@ -115,27 +115,51 @@ export class ListStore extends HiveStore {
115
115
  })
116
116
  }
117
117
 
118
- addFirst(value) {
119
- if (!value || !(typeof value === 'string' || Array.isArray(value))) {
120
- throw new Error('Value(s) must be provided and must be a string or list of strings.')
118
+ addFirstValue(value) {
119
+ if (!isHiveValueValid(value)) {
120
+ throw new Error('Value must be provided and must be one of types: string, number, boolean, object, array.')
121
121
  }
122
122
 
123
123
  return this.app.request
124
124
  .put({
125
125
  url : `${this.getBaseURL()}/add-first`,
126
- data: Utils.castArray(value)
126
+ data: [value]
127
127
  })
128
128
  }
129
129
 
130
- addLast(value) {
131
- if (!value || !(typeof value === 'string' || Array.isArray(value))) {
132
- throw new Error('Value(s) must be provided and must be a string or list of strings.')
130
+ addFirstValues(values) {
131
+ if (!values || !Array.isArray(values) || !values.length || !isHiveValueValid(values)) {
132
+ throw new Error('Value must be provided and must be a list of valid JSON items.')
133
+ }
134
+
135
+ return this.app.request
136
+ .put({
137
+ url : `${this.getBaseURL()}/add-first`,
138
+ data: values
139
+ })
140
+ }
141
+
142
+ addLastValue(value) {
143
+ if (!isHiveValueValid(value)) {
144
+ throw new Error('Value must be provided and must be one of types: string, number, boolean, object, array.')
145
+ }
146
+
147
+ return this.app.request
148
+ .put({
149
+ url : `${this.getBaseURL()}/add-last`,
150
+ data: [value]
151
+ })
152
+ }
153
+
154
+ addLastValues(values) {
155
+ if (!values || !Array.isArray(values) || !values.length || !isHiveValueValid(values)) {
156
+ throw new Error('Value must be provided and must be a list of valid JSON items.')
133
157
  }
134
158
 
135
159
  return this.app.request
136
160
  .put({
137
161
  url : `${this.getBaseURL()}/add-last`,
138
- data: Utils.castArray(value)
162
+ data: values
139
163
  })
140
164
  }
141
165
 
@@ -1,6 +1,7 @@
1
1
  import { HiveTypes } from '../constants'
2
2
  import { HiveStore } from './base-store'
3
3
  import Utils from '../../utils'
4
+ import { isHiveValueValid } from '../utils'
4
5
 
5
6
  export class MapStore extends HiveStore {
6
7
 
@@ -82,8 +83,8 @@ export class MapStore extends HiveStore {
82
83
  throw new Error('Key must be a string.')
83
84
  }
84
85
 
85
- if (!value || typeof value !== 'string') {
86
- throw new Error('Value must be provided and must be a string.')
86
+ if (!isHiveValueValid(value)) {
87
+ throw new Error('Value must be provided and must be one of types: string, number, boolean, object, array.')
87
88
  }
88
89
 
89
90
  return this.app.request
@@ -100,8 +101,8 @@ export class MapStore extends HiveStore {
100
101
  throw new Error('Key must be provided and must be a string.')
101
102
  }
102
103
 
103
- if (!value || typeof value !== 'string') {
104
- throw new Error('Value must be provided and must be a string.')
104
+ if (!isHiveValueValid(value)) {
105
+ throw new Error('Value must be provided and must be one of types: string, number, boolean, object, array.')
105
106
  }
106
107
 
107
108
  if (overwrite !== undefined && typeof overwrite !== 'boolean') {
@@ -1,6 +1,6 @@
1
1
  import { HiveStore } from './base-store'
2
2
  import { HiveTypes } from '../constants'
3
- import Utils from '../../utils'
3
+ import { isHiveValueValid } from '../utils'
4
4
 
5
5
  export class SetStore extends HiveStore {
6
6
 
@@ -75,55 +75,99 @@ export class SetStore extends HiveStore {
75
75
  })
76
76
  }
77
77
 
78
- set(values) {
79
- if (!values || (typeof values !== 'string' && !Array.isArray(values))) {
80
- throw new Error('Value(s) must be provided and must be a string or list of strings.')
78
+ setValue(value) {
79
+ if (!isHiveValueValid(value)) {
80
+ throw new Error('Value must be provided and must be one of types: string, number, boolean, object, array.')
81
81
  }
82
82
 
83
83
  return this.app.request
84
84
  .put({
85
85
  url : this.getBaseURL(),
86
- data: Utils.castArray(values)
86
+ data: [value]
87
87
  })
88
88
  }
89
89
 
90
- add(values) {
91
- if (!values || !(typeof values === 'string' || Array.isArray(values))) {
92
- throw new Error('Value(s) must be provided and must be a string or list of strings.')
90
+ setValues(values) {
91
+ if (!values || !Array.isArray(values) || !values.length || !isHiveValueValid(values)) {
92
+ throw new Error('Value must be provided and must be a list of valid JSON items.')
93
+ }
94
+
95
+ return this.app.request
96
+ .put({
97
+ url : this.getBaseURL(),
98
+ data: values
99
+ })
100
+ }
101
+
102
+ addValue(value) {
103
+ if (!isHiveValueValid(value)) {
104
+ throw new Error('Value must be provided and must be one of types: string, number, boolean, object, array.')
105
+ }
106
+
107
+ return this.app.request
108
+ .put({
109
+ url : `${this.getBaseURL()}/add`,
110
+ data: [value]
111
+ })
112
+ }
113
+
114
+ addValues(values) {
115
+ if (!values || !Array.isArray(values) || !values.length || !isHiveValueValid(values)) {
116
+ throw new Error('Value must be provided and must be a list of valid JSON items.')
93
117
  }
94
118
 
95
119
  return this.app.request
96
120
  .put({
97
121
  url : `${this.getBaseURL()}/add`,
98
- data: Utils.castArray(values)
122
+ data: values
123
+ })
124
+ }
125
+
126
+ deleteValue(value) {
127
+ if (!isHiveValueValid(value)) {
128
+ throw new Error('Value must be provided and must be one of types: string, number, boolean, object, array.')
129
+ }
130
+
131
+ return this.app.request
132
+ .delete({
133
+ url : `${this.getBaseURL()}/values`,
134
+ data: [value]
99
135
  })
100
136
  }
101
137
 
102
138
  deleteValues(values) {
103
- if (!values || !(typeof values === 'string' || Array.isArray(values))) {
104
- throw new Error('Value(s) must be provided and must be a string or list of strings.')
139
+ if (!values || !Array.isArray(values) || !values.length || !isHiveValueValid(values)) {
140
+ throw new Error('Value must be provided and must be a list of valid JSON items.')
105
141
  }
106
142
 
107
143
  return this.app.request
108
144
  .delete({
109
145
  url : `${this.getBaseURL()}/values`,
110
- data: Utils.castArray(values)
146
+ data: values
111
147
  })
112
148
  }
113
149
 
114
- isMember(value) {
115
- if (typeof value === 'string') {
116
- value = [value]
150
+ isValueMember(value) {
151
+ if (!isHiveValueValid(value)) {
152
+ throw new Error('Value must be provided and must be one of types: string, number, boolean, object, array.')
117
153
  }
118
154
 
119
- if (!Array.isArray(value)) {
120
- throw new Error('Value must be provided and must be a string or a list of strings.')
155
+ return this.app.request
156
+ .post({
157
+ url : `${this.getBaseURL()}/contains`,
158
+ data: [value]
159
+ })
160
+ }
161
+
162
+ isValuesMembers(values) {
163
+ if (!values || !Array.isArray(values) || !values.length || !isHiveValueValid(values)) {
164
+ throw new Error('Value must be provided and must be a list of valid JSON items.')
121
165
  }
122
166
 
123
167
  return this.app.request
124
168
  .post({
125
169
  url : `${this.getBaseURL()}/contains`,
126
- data: value
170
+ data: values
127
171
  })
128
172
  }
129
173
 
@@ -1,8 +1,8 @@
1
1
  import { HiveStore } from './base-store'
2
2
  import { HiveTypes } from '../constants'
3
3
  import Utils from '../../utils'
4
-
5
4
  import { SetStore } from './set'
5
+ import { isHiveValueValid } from '../utils'
6
6
 
7
7
  export class SortedSetStore extends HiveStore {
8
8
 
@@ -108,8 +108,8 @@ export class SortedSetStore extends HiveStore {
108
108
  }
109
109
 
110
110
  incrementScore(value, scoreValue) {
111
- if (!value || typeof value !== 'string') {
112
- throw new Error('Value must be provided and must be a string.')
111
+ if (!isHiveValueValid(value)) {
112
+ throw new Error('Value must be provided and must be one of types: string, number, boolean, object, array.')
113
113
  }
114
114
 
115
115
  if (isNaN(scoreValue) || typeof scoreValue !== 'number') {
@@ -127,8 +127,8 @@ export class SortedSetStore extends HiveStore {
127
127
  }
128
128
 
129
129
  decrementScore(value, scoreValue) {
130
- if (!value || typeof value !== 'string') {
131
- throw new Error('Value must be provided and must be a string.')
130
+ if (!isHiveValueValid(value)) {
131
+ throw new Error('Value must be provided and must be one of types: string, number, boolean, object, array.')
132
132
  }
133
133
 
134
134
  if (isNaN(scoreValue) || typeof scoreValue !== 'number') {
@@ -194,8 +194,8 @@ export class SortedSetStore extends HiveStore {
194
194
  }
195
195
 
196
196
  getScore(value) {
197
- if (!value || typeof value !== 'string') {
198
- throw new Error('Value must be provided and must be a string.')
197
+ if (!isHiveValueValid(value)) {
198
+ throw new Error('Value must be provided and must be one of types: string, number, boolean, object, array.')
199
199
  }
200
200
 
201
201
  return this.app.request
@@ -208,8 +208,8 @@ export class SortedSetStore extends HiveStore {
208
208
  }
209
209
 
210
210
  getRank(value, reverse) {
211
- if (!value || typeof value !== 'string') {
212
- throw new Error('Value must be provided and must be a string.')
211
+ if (!isHiveValueValid(value)) {
212
+ throw new Error('Value must be provided and must be one of types: string, number, boolean, object, array.')
213
213
  }
214
214
 
215
215
  if (reverse !== undefined && typeof reverse !== 'boolean') {
@@ -306,15 +306,27 @@ export class SortedSetStore extends HiveStore {
306
306
  })
307
307
  }
308
308
 
309
+ deleteValue(value) {
310
+ if (!isHiveValueValid(value)) {
311
+ throw new Error('Value must be provided and must be one of types: string, number, boolean, object, array.')
312
+ }
313
+
314
+ return this.app.request
315
+ .delete({
316
+ url : `${this.getBaseURL()}/values`,
317
+ data: [value]
318
+ })
319
+ }
320
+
309
321
  deleteValues(values) {
310
- if (!values || !(typeof values === 'string' || Array.isArray(values))) {
311
- throw new Error('Value(s) must be provided and must be a string or list of strings.')
322
+ if (!values || !Array.isArray(values) || !values.length || !isHiveValueValid(values)) {
323
+ throw new Error('Value must be provided and must be a list of JSON items.')
312
324
  }
313
325
 
314
326
  return this.app.request
315
327
  .delete({
316
328
  url : `${this.getBaseURL()}/values`,
317
- data: Utils.castArray(values)
329
+ data: values
318
330
  })
319
331
  }
320
332
 
@@ -0,0 +1,13 @@
1
+ export function isHiveValueValid(value) {
2
+ if (value == null) {
3
+ return false
4
+ }
5
+
6
+ try {
7
+ const json = JSON.stringify(value)
8
+
9
+ return !!json
10
+ } catch {
11
+ return false
12
+ }
13
+ }