@voilab/vmol-objection
Advanced tools
Comparing version 0.7.0 to 0.7.1
@@ -1,2 +0,2 @@ | ||
# 0.5.0 > 0.6.0 | ||
# 0.5.0 > 0.7.0 | ||
@@ -6,3 +6,3 @@ When loading service in moleculer context | ||
```js | ||
const DbMiddleware = require('@voilab/vmol-objection'); | ||
const DBMiddleware = require('@voilab/vmol-objection'); | ||
@@ -26,11 +26,16 @@ // becomes | ||
In `package.json`, load new dependancies | ||
In `package.json`, load new dependancies. Node 12 is the minimum version for objection 3 | ||
```json | ||
{ | ||
```json | ||
{ | ||
"engines": { | ||
"node": ">=12.0.0" | ||
}, | ||
"dependancies": { | ||
"@voilab/vmol-objection": "^0.6.0", | ||
"knex": "^0.95.15", | ||
"@voilab/vmol-objection": "^0.7.1", | ||
"knex": "^2.0.0", | ||
"objection": "^3.0.1", | ||
"ajv-formats": "^2.1.1" | ||
"ajv": "^8.11.0", | ||
"ajv-formats": "^2.1.1", | ||
"ajv-keywords": "^5.1.1" | ||
} | ||
@@ -48,2 +53,7 @@ } | ||
} | ||
{ | ||
"data": { "type": "date" }, | ||
"becomes", | ||
"data": { "instanceof": "Date" } | ||
} | ||
``` |
{ | ||
"name": "@voilab/vmol-objection", | ||
"version": "0.7.0", | ||
"version": "0.7.1", | ||
"description": "Moleculer mixin for Objection.js and knex", | ||
@@ -31,3 +31,5 @@ "main": "index.js", | ||
"objection": "^3.0.0", | ||
"ajv-formats": "^2.1.1" | ||
"ajv": "^8.11.0", | ||
"ajv-formats": "^2.1.1", | ||
"ajv-keywords": "^5.1.1" | ||
}, | ||
@@ -34,0 +36,0 @@ "devDependencies": { |
@@ -5,4 +5,14 @@ 'use strict'; | ||
const addFormats = require('ajv-formats').default; | ||
let addFormats, addKeywords; | ||
try { | ||
addFormats = require('ajv-formats'); | ||
// eslint-disable-next-line | ||
} catch (e) {} | ||
try { | ||
addKeywords = require('ajv-keywords'); | ||
// eslint-disable-next-line | ||
} catch (e) {} | ||
class BaseModel extends Model { | ||
@@ -12,3 +22,4 @@ static createValidator() { | ||
onCreateAjv: (ajv) => { | ||
addFormats(ajv); | ||
addFormats && addFormats(ajv); | ||
addKeywords && addKeywords(ajv); | ||
}, | ||
@@ -19,3 +30,4 @@ options: { | ||
ownProperties: true, | ||
v5: true | ||
v5: true, | ||
strict: false | ||
} | ||
@@ -22,0 +34,0 @@ }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17468
450
7