roboto-js 1.4.44 → 1.4.46
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/cjs/rbt_api.cjs +8 -6
- package/dist/cjs/rbt_object.cjs +8 -2
- package/dist/cjs/rbt_user.cjs +8 -2
- package/dist/esm/rbt_api.js +2 -0
- package/dist/esm/rbt_object.js +8 -2
- package/dist/esm/rbt_user.js +8 -2
- package/package.json +1 -1
- package/src/rbt_api.js +2 -0
- package/src/rbt_object.js +9 -2
- package/src/rbt_user.js +9 -2
package/dist/cjs/rbt_api.cjs
CHANGED
|
@@ -695,26 +695,28 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
695
695
|
case 0:
|
|
696
696
|
dataHash = _args15.length > 1 && _args15[1] !== undefined ? _args15[1] : {};
|
|
697
697
|
_context15.prev = 1;
|
|
698
|
-
|
|
698
|
+
debugger;
|
|
699
|
+
_context15.next = 5;
|
|
699
700
|
return this.axios.post('/object_service/createObject', [type, dataHash]);
|
|
700
|
-
case
|
|
701
|
+
case 5:
|
|
701
702
|
response = _context15.sent;
|
|
702
703
|
record = response.data;
|
|
703
704
|
if (dataHash) {
|
|
704
705
|
record.data = dataHash;
|
|
705
706
|
}
|
|
707
|
+
debugger;
|
|
706
708
|
return _context15.abrupt("return", new _rbt_object["default"](record, this.axios, {
|
|
707
709
|
isNew: true
|
|
708
710
|
}));
|
|
709
|
-
case
|
|
710
|
-
_context15.prev =
|
|
711
|
+
case 12:
|
|
712
|
+
_context15.prev = 12;
|
|
711
713
|
_context15.t0 = _context15["catch"](1);
|
|
712
714
|
return _context15.abrupt("return", this._handleError(_context15.t0));
|
|
713
|
-
case
|
|
715
|
+
case 15:
|
|
714
716
|
case "end":
|
|
715
717
|
return _context15.stop();
|
|
716
718
|
}
|
|
717
|
-
}, _callee15, this, [[1,
|
|
719
|
+
}, _callee15, this, [[1, 12]]);
|
|
718
720
|
}));
|
|
719
721
|
function create(_x10) {
|
|
720
722
|
return _create.apply(this, arguments);
|
package/dist/cjs/rbt_object.cjs
CHANGED
|
@@ -322,8 +322,14 @@ var RbtObject = exports["default"] = /*#__PURE__*/function () {
|
|
|
322
322
|
value: function _deepUnpackJson(value) {
|
|
323
323
|
if (typeof value === 'string') {
|
|
324
324
|
try {
|
|
325
|
-
|
|
326
|
-
|
|
325
|
+
// Only parse as JSON if it's not a large number
|
|
326
|
+
// https://chatgpt.com/c/6745902c-edf4-800c-ab52-31bf27dde2bd
|
|
327
|
+
//
|
|
328
|
+
if (!/^\d{16,}$/.test(value)) {
|
|
329
|
+
var parsed = JSON.parse(value);
|
|
330
|
+
// Recursively parse if the result is a string, object, or array
|
|
331
|
+
return this._deepUnpackJson(parsed);
|
|
332
|
+
}
|
|
327
333
|
} catch (e) {
|
|
328
334
|
return value; // Return the original string if parsing fails
|
|
329
335
|
}
|
package/dist/cjs/rbt_user.cjs
CHANGED
|
@@ -151,8 +151,14 @@ var RbtUser = exports["default"] = /*#__PURE__*/function () {
|
|
|
151
151
|
value: function _deepUnpackJson(value) {
|
|
152
152
|
if (typeof value === 'string') {
|
|
153
153
|
try {
|
|
154
|
-
|
|
155
|
-
|
|
154
|
+
// Only parse as JSON if it's not a large number
|
|
155
|
+
// https://chatgpt.com/c/6745902c-edf4-800c-ab52-31bf27dde2bd
|
|
156
|
+
//
|
|
157
|
+
if (!/^\d{16,}$/.test(value)) {
|
|
158
|
+
var parsed = JSON.parse(value);
|
|
159
|
+
// Recursively parse if the result is a string, object, or array
|
|
160
|
+
return this._deepUnpackJson(parsed);
|
|
161
|
+
}
|
|
156
162
|
} catch (e) {
|
|
157
163
|
return value; // Return the original string if parsing fails
|
|
158
164
|
}
|
package/dist/esm/rbt_api.js
CHANGED
|
@@ -327,11 +327,13 @@ export default class RbtApi {
|
|
|
327
327
|
*/
|
|
328
328
|
async create(type, dataHash = {}) {
|
|
329
329
|
try {
|
|
330
|
+
debugger;
|
|
330
331
|
const response = await this.axios.post('/object_service/createObject', [type, dataHash]);
|
|
331
332
|
const record = response.data;
|
|
332
333
|
if (dataHash) {
|
|
333
334
|
record.data = dataHash;
|
|
334
335
|
}
|
|
336
|
+
debugger;
|
|
335
337
|
return new RbtObject(record, this.axios, {
|
|
336
338
|
isNew: true
|
|
337
339
|
});
|
package/dist/esm/rbt_object.js
CHANGED
|
@@ -220,8 +220,14 @@ export default class RbtObject {
|
|
|
220
220
|
_deepUnpackJson(value) {
|
|
221
221
|
if (typeof value === 'string') {
|
|
222
222
|
try {
|
|
223
|
-
|
|
224
|
-
|
|
223
|
+
// Only parse as JSON if it's not a large number
|
|
224
|
+
// https://chatgpt.com/c/6745902c-edf4-800c-ab52-31bf27dde2bd
|
|
225
|
+
//
|
|
226
|
+
if (!/^\d{16,}$/.test(value)) {
|
|
227
|
+
const parsed = JSON.parse(value);
|
|
228
|
+
// Recursively parse if the result is a string, object, or array
|
|
229
|
+
return this._deepUnpackJson(parsed);
|
|
230
|
+
}
|
|
225
231
|
} catch (e) {
|
|
226
232
|
return value; // Return the original string if parsing fails
|
|
227
233
|
}
|
package/dist/esm/rbt_user.js
CHANGED
|
@@ -92,8 +92,14 @@ export default class RbtUser {
|
|
|
92
92
|
_deepUnpackJson(value) {
|
|
93
93
|
if (typeof value === 'string') {
|
|
94
94
|
try {
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
// Only parse as JSON if it's not a large number
|
|
96
|
+
// https://chatgpt.com/c/6745902c-edf4-800c-ab52-31bf27dde2bd
|
|
97
|
+
//
|
|
98
|
+
if (!/^\d{16,}$/.test(value)) {
|
|
99
|
+
const parsed = JSON.parse(value);
|
|
100
|
+
// Recursively parse if the result is a string, object, or array
|
|
101
|
+
return this._deepUnpackJson(parsed);
|
|
102
|
+
}
|
|
97
103
|
} catch (e) {
|
|
98
104
|
return value; // Return the original string if parsing fails
|
|
99
105
|
}
|
package/package.json
CHANGED
package/src/rbt_api.js
CHANGED
|
@@ -408,12 +408,14 @@ export default class RbtApi {
|
|
|
408
408
|
*/
|
|
409
409
|
async create(type, dataHash={}) {
|
|
410
410
|
try {
|
|
411
|
+
debugger;
|
|
411
412
|
const response = await this.axios.post('/object_service/createObject', [type, dataHash]);
|
|
412
413
|
const record = response.data;
|
|
413
414
|
|
|
414
415
|
if(dataHash){
|
|
415
416
|
record.data = dataHash;
|
|
416
417
|
}
|
|
418
|
+
debugger;
|
|
417
419
|
return new RbtObject(record, this.axios, { isNew: true });
|
|
418
420
|
} catch (e) {
|
|
419
421
|
return this._handleError(e);
|
package/src/rbt_object.js
CHANGED
|
@@ -249,8 +249,15 @@ export default class RbtObject {
|
|
|
249
249
|
_deepUnpackJson(value){
|
|
250
250
|
if (typeof value === 'string') {
|
|
251
251
|
try {
|
|
252
|
-
|
|
253
|
-
|
|
252
|
+
|
|
253
|
+
// Only parse as JSON if it's not a large number
|
|
254
|
+
// https://chatgpt.com/c/6745902c-edf4-800c-ab52-31bf27dde2bd
|
|
255
|
+
//
|
|
256
|
+
if (!/^\d{16,}$/.test(value)) {
|
|
257
|
+
const parsed = JSON.parse(value);
|
|
258
|
+
// Recursively parse if the result is a string, object, or array
|
|
259
|
+
return this._deepUnpackJson(parsed);
|
|
260
|
+
}
|
|
254
261
|
} catch (e) {
|
|
255
262
|
return value; // Return the original string if parsing fails
|
|
256
263
|
}
|
package/src/rbt_user.js
CHANGED
|
@@ -112,8 +112,15 @@ export default class RbtUser {
|
|
|
112
112
|
_deepUnpackJson(value){
|
|
113
113
|
if (typeof value === 'string') {
|
|
114
114
|
try {
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
|
|
116
|
+
// Only parse as JSON if it's not a large number
|
|
117
|
+
// https://chatgpt.com/c/6745902c-edf4-800c-ab52-31bf27dde2bd
|
|
118
|
+
//
|
|
119
|
+
if (!/^\d{16,}$/.test(value)) {
|
|
120
|
+
const parsed = JSON.parse(value);
|
|
121
|
+
// Recursively parse if the result is a string, object, or array
|
|
122
|
+
return this._deepUnpackJson(parsed);
|
|
123
|
+
}
|
|
117
124
|
} catch (e) {
|
|
118
125
|
return value; // Return the original string if parsing fails
|
|
119
126
|
}
|