@onehat/data 1.8.15 → 1.8.18
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/package.json +8 -8
- package/src/Entity.js +1 -4
- package/src/Repository/Ajax.js +8 -12
- package/src/Repository/OneBuild.js +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onehat/data",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.18",
|
|
4
4
|
"description": "JS data modeling package with adapters for many storage mediums.",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -37,16 +37,16 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@onehat/events": "^1.6.5",
|
|
39
39
|
"accounting-js": "^1.1.1",
|
|
40
|
-
"axios": "^0.
|
|
41
|
-
"chrono-node": "^2.3.
|
|
42
|
-
"fast-xml-parser": "^
|
|
40
|
+
"axios": "^0.27.2",
|
|
41
|
+
"chrono-node": "^2.3.9",
|
|
42
|
+
"fast-xml-parser": "^4.0.9",
|
|
43
43
|
"he": "^1.2.0",
|
|
44
|
-
"js-base64": "^3.
|
|
44
|
+
"js-base64": "^3.7.2",
|
|
45
45
|
"lodash": "^4.17.21",
|
|
46
|
-
"moment": "^2.29.
|
|
46
|
+
"moment": "^2.29.4",
|
|
47
47
|
"numeral": "^2.0.6",
|
|
48
|
-
"qs": "^6.
|
|
49
|
-
"relative-time-parser": "^1.0.
|
|
48
|
+
"qs": "^6.11.0",
|
|
49
|
+
"relative-time-parser": "^1.0.15",
|
|
50
50
|
"uuid": "^8.3.2"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
package/src/Entity.js
CHANGED
|
@@ -1322,10 +1322,7 @@ class Entity extends EventEmitter {
|
|
|
1322
1322
|
}
|
|
1323
1323
|
|
|
1324
1324
|
get [Symbol.toStringTag]() {
|
|
1325
|
-
|
|
1326
|
-
throw Error('this.toStringTag is no longer valid. Entity has been destroyed.');
|
|
1327
|
-
}
|
|
1328
|
-
return 'Entity {' + this.id + '} - ' + this.displayValue;
|
|
1325
|
+
return 'Entity {' + this.id + '} - ' + (this.isDestroyed ? 'destroyed' : this.displayValue);
|
|
1329
1326
|
}
|
|
1330
1327
|
|
|
1331
1328
|
get toJSON() {
|
package/src/Repository/Ajax.js
CHANGED
|
@@ -374,10 +374,6 @@ class AjaxRepository extends Repository {
|
|
|
374
374
|
if (!_.isNil(params) && _.isObject(params)) {
|
|
375
375
|
this.setParams(params);
|
|
376
376
|
}
|
|
377
|
-
|
|
378
|
-
if (this.debugMode) {
|
|
379
|
-
console.log('loading ' + this.name, params);
|
|
380
|
-
}
|
|
381
377
|
|
|
382
378
|
const repository = this;
|
|
383
379
|
const data = _.merge({}, this._baseParams, this._params);
|
|
@@ -385,7 +381,7 @@ class AjaxRepository extends Repository {
|
|
|
385
381
|
return this._send(this.methods.get, this.api.get, data)
|
|
386
382
|
.then(result => {
|
|
387
383
|
if (this.debugMode) {
|
|
388
|
-
console.log('
|
|
384
|
+
console.log('Response for ' + this.name, result);
|
|
389
385
|
}
|
|
390
386
|
|
|
391
387
|
if (this.isDestroyed) {
|
|
@@ -453,7 +449,7 @@ class AjaxRepository extends Repository {
|
|
|
453
449
|
return this._send(this.methods.get, this.api.get, params)
|
|
454
450
|
.then(result => {
|
|
455
451
|
if (this.debugMode) {
|
|
456
|
-
console.log('reloadEntity
|
|
452
|
+
console.log('reloadEntity response ' + entity.id, result);
|
|
457
453
|
}
|
|
458
454
|
|
|
459
455
|
const {
|
|
@@ -531,7 +527,7 @@ class AjaxRepository extends Repository {
|
|
|
531
527
|
return this._send(method, url, data)
|
|
532
528
|
.then(result => {
|
|
533
529
|
if (this.debugMode) {
|
|
534
|
-
console.log(this.api.add + '
|
|
530
|
+
console.log(this.api.add + ' response', result);
|
|
535
531
|
}
|
|
536
532
|
const {
|
|
537
533
|
root,
|
|
@@ -571,7 +567,7 @@ class AjaxRepository extends Repository {
|
|
|
571
567
|
return this._send(method, url, data)
|
|
572
568
|
.then(result => {
|
|
573
569
|
if (this.debugMode) {
|
|
574
|
-
console.log(this.api.batchAdd + '
|
|
570
|
+
console.log(this.api.batchAdd + ' response', result);
|
|
575
571
|
}
|
|
576
572
|
const {
|
|
577
573
|
root,
|
|
@@ -611,7 +607,7 @@ class AjaxRepository extends Repository {
|
|
|
611
607
|
return this._send(method, url, data)
|
|
612
608
|
.then(result => {
|
|
613
609
|
if (this.debugMode) {
|
|
614
|
-
console.log(this.api.edit + '
|
|
610
|
+
console.log(this.api.edit + ' response', result);
|
|
615
611
|
}
|
|
616
612
|
const {
|
|
617
613
|
root,
|
|
@@ -651,7 +647,7 @@ class AjaxRepository extends Repository {
|
|
|
651
647
|
return this._send(method, url, data)
|
|
652
648
|
.then(result => {
|
|
653
649
|
if (this.debugMode) {
|
|
654
|
-
console.log(this.api.batchEdit + '
|
|
650
|
+
console.log(this.api.batchEdit + ' response', result);
|
|
655
651
|
}
|
|
656
652
|
const {
|
|
657
653
|
root,
|
|
@@ -691,7 +687,7 @@ class AjaxRepository extends Repository {
|
|
|
691
687
|
return this._send(method, url, data)
|
|
692
688
|
.then(result => {
|
|
693
689
|
if (this.debugMode) {
|
|
694
|
-
console.log(this.api.delete + '
|
|
690
|
+
console.log(this.api.delete + ' response', result);
|
|
695
691
|
}
|
|
696
692
|
const {
|
|
697
693
|
root,
|
|
@@ -733,7 +729,7 @@ class AjaxRepository extends Repository {
|
|
|
733
729
|
return this._send(method, url, data)
|
|
734
730
|
.then(result => {
|
|
735
731
|
if (this.debugMode) {
|
|
736
|
-
console.log(this.api.batchDelete + '
|
|
732
|
+
console.log(this.api.batchDelete + ' response', result);
|
|
737
733
|
}
|
|
738
734
|
const {
|
|
739
735
|
root,
|
|
@@ -110,7 +110,7 @@ class OneBuildRepository extends AjaxRepository {
|
|
|
110
110
|
};
|
|
111
111
|
|
|
112
112
|
if (this.debugMode) {
|
|
113
|
-
console.log(url, options);
|
|
113
|
+
console.log('Sending ' + url, options);
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
this.lastSendOptions = options;
|
|
@@ -251,7 +251,7 @@ class OneBuildRepository extends AjaxRepository {
|
|
|
251
251
|
return this.axios(data)
|
|
252
252
|
.then((result) => {
|
|
253
253
|
if (this.debugMode) {
|
|
254
|
-
console.log('login
|
|
254
|
+
console.log('login response', result);
|
|
255
255
|
}
|
|
256
256
|
|
|
257
257
|
const response = result.data;
|
|
@@ -281,7 +281,7 @@ class OneBuildRepository extends AjaxRepository {
|
|
|
281
281
|
})
|
|
282
282
|
.then((result) => {
|
|
283
283
|
if (this.debugMode) {
|
|
284
|
-
console.log('logout
|
|
284
|
+
console.log('logout response', result);
|
|
285
285
|
}
|
|
286
286
|
const response = result.data;
|
|
287
287
|
if (!response.success) {
|
|
@@ -309,7 +309,7 @@ class OneBuildRepository extends AjaxRepository {
|
|
|
309
309
|
return this.axios(data)
|
|
310
310
|
.then((result) => {
|
|
311
311
|
if (this.debugMode) {
|
|
312
|
-
console.log('forgotPassword
|
|
312
|
+
console.log('forgotPassword response', result);
|
|
313
313
|
}
|
|
314
314
|
|
|
315
315
|
const response = result.data;
|