roboto-js 1.6.5 → 1.6.7
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_object.cjs +12 -12
- package/dist/esm/rbt_object.js +2 -2
- package/package.json +1 -1
- package/src/rbt_object.js +2 -2
package/dist/cjs/rbt_object.cjs
CHANGED
|
@@ -33,7 +33,7 @@ var RbtObject = exports["default"] = /*#__PURE__*/function () {
|
|
|
33
33
|
this.isRbtObject = true;
|
|
34
34
|
this.id = record.id;
|
|
35
35
|
this.id_revision = record.id_revision;
|
|
36
|
-
this.rpcMeta = {
|
|
36
|
+
this.rpcMeta = record.rpcMeta || {
|
|
37
37
|
changes: [],
|
|
38
38
|
isNew: options.isNew || record.revision == 0 || false
|
|
39
39
|
};
|
|
@@ -315,6 +315,7 @@ var RbtObject = exports["default"] = /*#__PURE__*/function () {
|
|
|
315
315
|
// Reset unique identifiers to ensure a new ID is generated upon saving
|
|
316
316
|
delete clonedData.id;
|
|
317
317
|
delete clonedData.id_revision;
|
|
318
|
+
delete clonedData.rpcMeta;
|
|
318
319
|
|
|
319
320
|
// Create a new instance of RbtObject with the cloned data
|
|
320
321
|
var clonedObject = new RbtObject(clonedData, this._axios, {
|
|
@@ -337,29 +338,28 @@ var RbtObject = exports["default"] = /*#__PURE__*/function () {
|
|
|
337
338
|
throw new Error('Cannot save object without type');
|
|
338
339
|
case 2:
|
|
339
340
|
_context3.prev = 2;
|
|
340
|
-
debugger;
|
|
341
341
|
if (this.rpcMeta.isNew) {
|
|
342
342
|
record = this.toRecord();
|
|
343
343
|
} else {
|
|
344
344
|
record = this.toDeltaRecord();
|
|
345
345
|
}
|
|
346
|
-
_context3.next =
|
|
346
|
+
_context3.next = 6;
|
|
347
347
|
return this._axios.post('/object_service/saveObject', [record]);
|
|
348
|
-
case
|
|
348
|
+
case 6:
|
|
349
349
|
response = _context3.sent;
|
|
350
350
|
if (!(response.data.ok === false)) {
|
|
351
|
-
_context3.next =
|
|
351
|
+
_context3.next = 9;
|
|
352
352
|
break;
|
|
353
353
|
}
|
|
354
354
|
throw new Error(response.data.message);
|
|
355
|
-
case
|
|
355
|
+
case 9:
|
|
356
356
|
if (!(((_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.result) == 'NO_CHANGES')) {
|
|
357
|
-
_context3.next =
|
|
357
|
+
_context3.next = 12;
|
|
358
358
|
break;
|
|
359
359
|
}
|
|
360
360
|
this.rpcMeta.isNew = false;
|
|
361
361
|
return _context3.abrupt("return", this);
|
|
362
|
-
case
|
|
362
|
+
case 12:
|
|
363
363
|
if ((_response$data2 = response.data) !== null && _response$data2 !== void 0 && _response$data2.newData) {
|
|
364
364
|
// apply new incoming data
|
|
365
365
|
this.setData(response.newData);
|
|
@@ -369,18 +369,18 @@ var RbtObject = exports["default"] = /*#__PURE__*/function () {
|
|
|
369
369
|
this.type = response.data.type;
|
|
370
370
|
this.rpcMeta.isNew = false;
|
|
371
371
|
return _context3.abrupt("return", this);
|
|
372
|
-
case
|
|
373
|
-
_context3.prev =
|
|
372
|
+
case 20:
|
|
373
|
+
_context3.prev = 20;
|
|
374
374
|
_context3.t0 = _context3["catch"](2);
|
|
375
375
|
console.log('RbtObject.save.error:', _context3.t0 === null || _context3.t0 === void 0 || (_e$response = _context3.t0.response) === null || _e$response === void 0 ? void 0 : _e$response.data);
|
|
376
376
|
this._error = _context3.t0;
|
|
377
377
|
//console.log(e.response.data);
|
|
378
378
|
throw _context3.t0;
|
|
379
|
-
case
|
|
379
|
+
case 25:
|
|
380
380
|
case "end":
|
|
381
381
|
return _context3.stop();
|
|
382
382
|
}
|
|
383
|
-
}, _callee3, this, [[2,
|
|
383
|
+
}, _callee3, this, [[2, 20]]);
|
|
384
384
|
}));
|
|
385
385
|
function save() {
|
|
386
386
|
return _save.apply(this, arguments);
|
package/dist/esm/rbt_object.js
CHANGED
|
@@ -6,7 +6,7 @@ export default class RbtObject {
|
|
|
6
6
|
this.isRbtObject = true;
|
|
7
7
|
this.id = record.id;
|
|
8
8
|
this.id_revision = record.id_revision;
|
|
9
|
-
this.rpcMeta = {
|
|
9
|
+
this.rpcMeta = record.rpcMeta || {
|
|
10
10
|
changes: [],
|
|
11
11
|
isNew: options.isNew || record.revision == 0 || false
|
|
12
12
|
};
|
|
@@ -227,6 +227,7 @@ export default class RbtObject {
|
|
|
227
227
|
// Reset unique identifiers to ensure a new ID is generated upon saving
|
|
228
228
|
delete clonedData.id;
|
|
229
229
|
delete clonedData.id_revision;
|
|
230
|
+
delete clonedData.rpcMeta;
|
|
230
231
|
|
|
231
232
|
// Create a new instance of RbtObject with the cloned data
|
|
232
233
|
const clonedObject = new RbtObject(clonedData, this._axios, {
|
|
@@ -239,7 +240,6 @@ export default class RbtObject {
|
|
|
239
240
|
throw new Error('Cannot save object without type');
|
|
240
241
|
}
|
|
241
242
|
try {
|
|
242
|
-
debugger;
|
|
243
243
|
let record;
|
|
244
244
|
if (this.rpcMeta.isNew) {
|
|
245
245
|
record = this.toRecord();
|
package/package.json
CHANGED
package/src/rbt_object.js
CHANGED
|
@@ -8,7 +8,7 @@ export default class RbtObject {
|
|
|
8
8
|
this.isRbtObject = true;
|
|
9
9
|
this.id = record.id;
|
|
10
10
|
this.id_revision = record.id_revision;
|
|
11
|
-
this.rpcMeta = {
|
|
11
|
+
this.rpcMeta = record.rpcMeta || {
|
|
12
12
|
changes: [],
|
|
13
13
|
isNew: options.isNew || record.revision == 0 || false
|
|
14
14
|
};
|
|
@@ -250,6 +250,7 @@ export default class RbtObject {
|
|
|
250
250
|
// Reset unique identifiers to ensure a new ID is generated upon saving
|
|
251
251
|
delete clonedData.id;
|
|
252
252
|
delete clonedData.id_revision;
|
|
253
|
+
delete clonedData.rpcMeta;
|
|
253
254
|
|
|
254
255
|
// Create a new instance of RbtObject with the cloned data
|
|
255
256
|
const clonedObject = new RbtObject(clonedData, this._axios, { isNew: true });
|
|
@@ -264,7 +265,6 @@ export default class RbtObject {
|
|
|
264
265
|
|
|
265
266
|
try {
|
|
266
267
|
|
|
267
|
-
debugger;
|
|
268
268
|
let record;
|
|
269
269
|
if(this.rpcMeta.isNew){
|
|
270
270
|
record = this.toRecord();
|