spice-js 2.5.9 → 2.5.13

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.
@@ -23,6 +23,7 @@ try {
23
23
  /*#__PURE__*/
24
24
  function () {
25
25
  var _ref = _asyncToGenerator(function* (file) {
26
+ spice[resource][file.split(".")[0].toLowerCase()] = (yield Promise.resolve("" + _path.default.join(paths, file)).then(s => _interopRequireWildcard(require(s)))).default;
26
27
  spice[resource][file.split(".")[0]] = (yield Promise.resolve("" + _path.default.join(paths, file)).then(s => _interopRequireWildcard(require(s)))).default;
27
28
  });
28
29
 
package/build/index.js CHANGED
@@ -136,9 +136,8 @@ class Spice {
136
136
  }));
137
137
  app.use(convert(Validate()));
138
138
  spice.app = app;
139
- spice.config = yield require("./loaders/config")();
140
- /* io.attach(app);
141
- spice.io = io; */
139
+ spice.config = yield require("./loaders/config")(); //io.attach(app);
140
+ //spice.io = io; */
142
141
 
143
142
  /* io.on("message", (ctx, data) => {
144
143
  console.log("client sent data to message endpoint", data);
@@ -179,7 +179,7 @@ class SpiceModel {
179
179
  complete
180
180
  } = _ref;
181
181
  var operationExempt = {
182
- PUT: ["required"]
182
+ PUT: ["required", "unique"]
183
183
  };
184
184
  var returnVal = [];
185
185
 
@@ -877,7 +877,6 @@ class SpiceModel {
877
877
  when: properties[i].map.when || "read",
878
878
  execute: function () {
879
879
  var _execute2 = _asyncToGenerator(function* (data) {
880
- console.log(_.isString(properties[i].map.reference), _.isString(properties[i].map.reference) ? spice.models[properties[i].map.reference] : properties[i].map.reference, spice.models, properties[i].map.reference);
881
880
  return yield _this10.mapToObjectArray(data, _.isString(properties[i].map.reference) ? spice.models[properties[i].map.reference] : properties[i].map.reference, i, properties[i].map.destination || i, properties[i]);
882
881
  });
883
882
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spice-js",
3
- "version": "2.5.9",
3
+ "version": "2.5.13",
4
4
  "description": "spice",
5
5
  "main": "build/index.js",
6
6
  "repository": {
@@ -38,6 +38,7 @@
38
38
  "regenerator-runtime": "^0.13.7",
39
39
  "socket.io-client": "^4.0.1",
40
40
  "sonover-date": "^1.0.1",
41
+ "spice-couchbase": "^2.0.14",
41
42
  "uuid": "^3.3.3",
42
43
  "winston": "^3.2.1"
43
44
  },
@@ -8,6 +8,9 @@ try {
8
8
  require("fs")
9
9
  .readdirSync(paths)
10
10
  .forEach(async function (file) {
11
+ spice[resource][file.split(".")[0].toLowerCase()] = (
12
+ await import(path.join(paths, file))
13
+ ).default;
11
14
  spice[resource][file.split(".")[0]] = (
12
15
  await import(path.join(paths, file))
13
16
  ).default;
package/src/index.js CHANGED
@@ -72,8 +72,8 @@ export default class Spice {
72
72
  spice.app = app;
73
73
  spice.config = await require("./loaders/config")();
74
74
 
75
- /* io.attach(app);
76
- spice.io = io; */
75
+ //io.attach(app);
76
+ //spice.io = io; */
77
77
  /* io.on("message", (ctx, data) => {
78
78
  console.log("client sent data to message endpoint", data);
79
79
  }); */
@@ -154,7 +154,7 @@ export default class SpiceModel {
154
154
 
155
155
  createValidationString({ property_name, props, operation, complete }) {
156
156
  let operationExempt = {
157
- PUT: ["required"],
157
+ PUT: ["required", "unique"],
158
158
  };
159
159
  let returnVal = [];
160
160
  for (let i in props) {
@@ -765,14 +765,6 @@ export default class SpiceModel {
765
765
  this.addModifier({
766
766
  when: properties[i].map.when || "read",
767
767
  execute: async (data) => {
768
- console.log(
769
- _.isString(properties[i].map.reference),
770
- _.isString(properties[i].map.reference)
771
- ? spice.models[properties[i].map.reference]
772
- : properties[i].map.reference,
773
- spice.models,
774
- properties[i].map.reference
775
- );
776
768
  return await this.mapToObjectArray(
777
769
  data,
778
770
  _.isString(properties[i].map.reference)