spice-js 2.6.84 → 2.6.85
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/build/models/SpiceModel.js +10 -16
- package/package.json +1 -1
- package/src/models/SpiceModel.js +8 -12
|
@@ -168,8 +168,7 @@ class SpiceModel {
|
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
return props;
|
|
171
|
-
}
|
|
172
|
-
|
|
171
|
+
}
|
|
173
172
|
|
|
174
173
|
args.props = applySchemaOverrides(removeDynamicProps(args.props), args.collection);
|
|
175
174
|
this[_props] = args.props;
|
|
@@ -232,7 +231,7 @@ class SpiceModel {
|
|
|
232
231
|
that = this;
|
|
233
232
|
this.createModifiersFromProps();
|
|
234
233
|
} catch (e) {
|
|
235
|
-
console.
|
|
234
|
+
console.warn(e.stack);
|
|
236
235
|
} // }
|
|
237
236
|
|
|
238
237
|
}
|
|
@@ -682,7 +681,7 @@ class SpiceModel {
|
|
|
682
681
|
|
|
683
682
|
return yield doGet();
|
|
684
683
|
} catch (e) {
|
|
685
|
-
console.
|
|
684
|
+
console.warn(e.message, e);
|
|
686
685
|
throw e;
|
|
687
686
|
}
|
|
688
687
|
})();
|
|
@@ -750,7 +749,7 @@ class SpiceModel {
|
|
|
750
749
|
|
|
751
750
|
return results;
|
|
752
751
|
} catch (e) {
|
|
753
|
-
console.
|
|
752
|
+
console.warn(e.stack);
|
|
754
753
|
throw e;
|
|
755
754
|
}
|
|
756
755
|
})();
|
|
@@ -869,7 +868,7 @@ class SpiceModel {
|
|
|
869
868
|
|
|
870
869
|
return yield doUpdate();
|
|
871
870
|
} catch (e) {
|
|
872
|
-
console.
|
|
871
|
+
console.warn("Error on update", e, e.stack);
|
|
873
872
|
throw e;
|
|
874
873
|
}
|
|
875
874
|
})();
|
|
@@ -962,7 +961,7 @@ class SpiceModel {
|
|
|
962
961
|
|
|
963
962
|
return yield doCreate();
|
|
964
963
|
} catch (e) {
|
|
965
|
-
console.
|
|
964
|
+
console.warn(e.stack);
|
|
966
965
|
throw e;
|
|
967
966
|
}
|
|
968
967
|
})();
|
|
@@ -983,7 +982,7 @@ class SpiceModel {
|
|
|
983
982
|
touch_response = yield _this10.database.touch(args.id, args._ttl);
|
|
984
983
|
return touch_response;
|
|
985
984
|
} catch (e) {
|
|
986
|
-
console.
|
|
985
|
+
console.warn(e.stack);
|
|
987
986
|
throw e;
|
|
988
987
|
}
|
|
989
988
|
})();
|
|
@@ -1063,7 +1062,7 @@ class SpiceModel {
|
|
|
1063
1062
|
|
|
1064
1063
|
return yield doDelete();
|
|
1065
1064
|
} catch (e) {
|
|
1066
|
-
console.
|
|
1065
|
+
console.warn(e.stack);
|
|
1067
1066
|
throw e;
|
|
1068
1067
|
}
|
|
1069
1068
|
})();
|
|
@@ -1433,7 +1432,7 @@ class SpiceModel {
|
|
|
1433
1432
|
|
|
1434
1433
|
return yield doList();
|
|
1435
1434
|
} catch (e) {
|
|
1436
|
-
console.
|
|
1435
|
+
console.warn(e.stack);
|
|
1437
1436
|
throw e;
|
|
1438
1437
|
}
|
|
1439
1438
|
})();
|
|
@@ -1781,8 +1780,6 @@ class SpiceModel {
|
|
|
1781
1780
|
|
|
1782
1781
|
var _loop = function _loop(i) {
|
|
1783
1782
|
if (properties[i].map) {
|
|
1784
|
-
console.log("properties[i].map", properties[i].map);
|
|
1785
|
-
|
|
1786
1783
|
switch (properties[i].map.type) {
|
|
1787
1784
|
case _2.MapType.MODEL:
|
|
1788
1785
|
{
|
|
@@ -1918,8 +1915,6 @@ class SpiceModel {
|
|
|
1918
1915
|
|
|
1919
1916
|
|
|
1920
1917
|
if (_this18.type && !_this18[_external_modifier_loaded]) {
|
|
1921
|
-
console.trace("adding external modifiers", _this18.type);
|
|
1922
|
-
|
|
1923
1918
|
_this18.addExternalModifiers(_this18.type);
|
|
1924
1919
|
|
|
1925
1920
|
_this18[_external_modifier_loaded] = true;
|
|
@@ -1935,8 +1930,7 @@ class SpiceModel {
|
|
|
1935
1930
|
var genericModifiers = [];
|
|
1936
1931
|
|
|
1937
1932
|
for (var modifier of modifiers) {
|
|
1938
|
-
|
|
1939
|
-
|
|
1933
|
+
// Skip field-specific modifiers if columns specified and neither source nor destination field is requested
|
|
1940
1934
|
if (requestedColumns && modifier.field && !requestedColumns.has(modifier.field) && !(modifier.sourceField && requestedColumns.has(modifier.sourceField))) {
|
|
1941
1935
|
continue;
|
|
1942
1936
|
} // Field modifiers have a .field property and .execute function - they can run in parallel
|
package/package.json
CHANGED
package/src/models/SpiceModel.js
CHANGED
|
@@ -157,7 +157,6 @@ export default class SpiceModel {
|
|
|
157
157
|
}
|
|
158
158
|
return props;
|
|
159
159
|
}
|
|
160
|
-
//console.log("Applying Overrides to :", this.collection,'||', args.collection)
|
|
161
160
|
args.props = applySchemaOverrides(
|
|
162
161
|
removeDynamicProps(args.props),
|
|
163
162
|
args.collection
|
|
@@ -221,7 +220,7 @@ export default class SpiceModel {
|
|
|
221
220
|
that = this;
|
|
222
221
|
this.createModifiersFromProps();
|
|
223
222
|
} catch (e) {
|
|
224
|
-
console.
|
|
223
|
+
console.warn(e.stack);
|
|
225
224
|
}
|
|
226
225
|
// }
|
|
227
226
|
}
|
|
@@ -592,7 +591,7 @@ export default class SpiceModel {
|
|
|
592
591
|
}
|
|
593
592
|
return await doGet();
|
|
594
593
|
} catch (e) {
|
|
595
|
-
console.
|
|
594
|
+
console.warn(e.message, e);
|
|
596
595
|
throw e;
|
|
597
596
|
}
|
|
598
597
|
}
|
|
@@ -655,7 +654,7 @@ export default class SpiceModel {
|
|
|
655
654
|
|
|
656
655
|
return results;
|
|
657
656
|
} catch (e) {
|
|
658
|
-
console.
|
|
657
|
+
console.warn(e.stack);
|
|
659
658
|
throw e;
|
|
660
659
|
}
|
|
661
660
|
}
|
|
@@ -763,7 +762,7 @@ export default class SpiceModel {
|
|
|
763
762
|
}
|
|
764
763
|
return await doUpdate();
|
|
765
764
|
} catch (e) {
|
|
766
|
-
console.
|
|
765
|
+
console.warn("Error on update", e, e.stack);
|
|
767
766
|
throw e;
|
|
768
767
|
}
|
|
769
768
|
}
|
|
@@ -836,7 +835,7 @@ export default class SpiceModel {
|
|
|
836
835
|
}
|
|
837
836
|
return await doCreate();
|
|
838
837
|
} catch (e) {
|
|
839
|
-
console.
|
|
838
|
+
console.warn(e.stack);
|
|
840
839
|
throw e;
|
|
841
840
|
}
|
|
842
841
|
}
|
|
@@ -852,7 +851,7 @@ export default class SpiceModel {
|
|
|
852
851
|
touch_response = await this.database.touch(args.id, args._ttl);
|
|
853
852
|
return touch_response;
|
|
854
853
|
} catch (e) {
|
|
855
|
-
console.
|
|
854
|
+
console.warn(e.stack);
|
|
856
855
|
throw e;
|
|
857
856
|
}
|
|
858
857
|
}
|
|
@@ -902,7 +901,7 @@ export default class SpiceModel {
|
|
|
902
901
|
}
|
|
903
902
|
return await doDelete();
|
|
904
903
|
} catch (e) {
|
|
905
|
-
console.
|
|
904
|
+
console.warn(e.stack);
|
|
906
905
|
throw e;
|
|
907
906
|
}
|
|
908
907
|
}
|
|
@@ -1290,7 +1289,7 @@ export default class SpiceModel {
|
|
|
1290
1289
|
}
|
|
1291
1290
|
return await doList();
|
|
1292
1291
|
} catch (e) {
|
|
1293
|
-
console.
|
|
1292
|
+
console.warn(e.stack);
|
|
1294
1293
|
throw e;
|
|
1295
1294
|
}
|
|
1296
1295
|
}
|
|
@@ -1616,7 +1615,6 @@ export default class SpiceModel {
|
|
|
1616
1615
|
createMofifier(properties) {
|
|
1617
1616
|
for (let i in properties) {
|
|
1618
1617
|
if (properties[i].map) {
|
|
1619
|
-
console.log("properties[i].map", properties[i].map);
|
|
1620
1618
|
switch (properties[i].map.type) {
|
|
1621
1619
|
case MapType.MODEL: {
|
|
1622
1620
|
const destinationField = properties[i].map.destination || i;
|
|
@@ -1719,7 +1717,6 @@ export default class SpiceModel {
|
|
|
1719
1717
|
|
|
1720
1718
|
// Add external modifiers only once.
|
|
1721
1719
|
if (this.type && !this[_external_modifier_loaded]) {
|
|
1722
|
-
console.trace("adding external modifiers", this.type);
|
|
1723
1720
|
this.addExternalModifiers(this.type);
|
|
1724
1721
|
this[_external_modifier_loaded] = true;
|
|
1725
1722
|
}
|
|
@@ -1735,7 +1732,6 @@ export default class SpiceModel {
|
|
|
1735
1732
|
const genericModifiers = [];
|
|
1736
1733
|
|
|
1737
1734
|
for (const modifier of modifiers) {
|
|
1738
|
-
console.log("modifier", modifier);
|
|
1739
1735
|
// Skip field-specific modifiers if columns specified and neither source nor destination field is requested
|
|
1740
1736
|
if (
|
|
1741
1737
|
requestedColumns &&
|