@point-hub/papi 0.5.4 → 0.5.6

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.
Files changed (2) hide show
  1. package/lib/index.js +4 -4
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -61021,7 +61021,7 @@ class MongoDBConnection {
61021
61021
  this.databaseName = databaseName;
61022
61022
  const options = {
61023
61023
  writeConcern: { w: "majority" },
61024
- readConcern: { level: "linearizable" }
61024
+ readConcern: { level: "majority" }
61025
61025
  };
61026
61026
  this.client = new import_mongodb2.MongoClient(connectionString, options);
61027
61027
  this.database(databaseName);
@@ -61244,10 +61244,10 @@ class MongoDBConnection {
61244
61244
  // src/database/mongodb/mongodb-error-handler.ts
61245
61245
  function handleSchemaValidation(err, error) {
61246
61246
  error.errors = {};
61247
- const errorMessage = err.errInfo?.details.schemaRulesNotSatisfied[0].propertiesNotSatisfied;
61247
+ const errorMessage = err.errInfo?.details.schemaRulesNotSatisfied[0].missingProperties;
61248
61248
  errorMessage.forEach((element) => {
61249
61249
  const obj = {};
61250
- obj[element.propertyName] = [element.details[0].reason];
61250
+ obj[element] = [`${element} is required`];
61251
61251
  error.errors = obj;
61252
61252
  });
61253
61253
  }
@@ -61285,7 +61285,7 @@ class MongoErrorHandler extends BaseError {
61285
61285
  } else if (err.code === 11000) {
61286
61286
  handleUniqueValidation(err, error);
61287
61287
  } else {
61288
- console.error(err);
61288
+ console.error(JSON.stringify(err));
61289
61289
  }
61290
61290
  super(error);
61291
61291
  Object.setPrototypeOf(this, new.target.prototype);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@point-hub/papi",
3
- "version": "0.5.4",
3
+ "version": "0.5.6",
4
4
  "description": "Point API Framework",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",