@rss/common
Advanced tools
Comparing version 0.0.8 to 0.0.9
@@ -23,3 +23,2 @@ 'use strict'; | ||
var Access = require('../core/access'); | ||
var GroupReference = require('../core/group-reference'); | ||
var PersonReference = require('../core/person-reference'); | ||
@@ -39,3 +38,2 @@ | ||
this.status = DOCUMENT_STATUS.DRAFT; | ||
this.group = null; | ||
this.access = []; | ||
@@ -64,3 +62,2 @@ this.createdBy = null; | ||
this.description = opt.description ? opt.description : null; | ||
this.group = opt.group ? new GroupReference(opt.group) : null; | ||
this.access = opt.access && opt.access.length ? opt.access.map(function (item) { | ||
@@ -129,3 +126,2 @@ return new Access(item); | ||
description: { type: ['string', 'null'] }, | ||
group: { anyOf: [{ type: 'null' }, { $ref: 'group.schema.json' }] }, | ||
access: { type: 'array', item: { $ref: 'access.schema.json' } }, | ||
@@ -143,3 +139,3 @@ sections: { type: 'array', item: { $ref: 'document-section.schema.json' } }, | ||
}, | ||
required: Object.keys(this) | ||
required: Object.keys(new Document()) | ||
}; | ||
@@ -189,3 +185,2 @@ } | ||
tv4.addSchema(Access.schema()); | ||
tv4.addSchema(GroupReference.schema()); | ||
tv4.addSchema(PersonReference.schema()); | ||
@@ -192,0 +187,0 @@ tv4.addSchema(TemplateReference.schema()); |
{ | ||
"name": "@rss/common", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"description": "common constant, classes, & helper", | ||
@@ -28,6 +28,12 @@ "author": "Risk & Safety Solution", | ||
"babel": { | ||
"presets": ["env"], | ||
"ignore": ["**/*.spec.js"], | ||
"plugins": ["transform-object-rest-spread"] | ||
"presets": [ | ||
"env" | ||
], | ||
"ignore": [ | ||
"**/*.spec.js" | ||
], | ||
"plugins": [ | ||
"transform-object-rest-spread" | ||
] | ||
} | ||
} |
@@ -17,3 +17,2 @@ const ObjectId = require('bson').ObjectID; | ||
const Access = require('../core/access'); | ||
const GroupReference = require('../core/group-reference'); | ||
const PersonReference = require('../core/person-reference'); | ||
@@ -31,3 +30,2 @@ | ||
this.status = DOCUMENT_STATUS.DRAFT; | ||
this.group = null; | ||
this.access = []; | ||
@@ -52,3 +50,2 @@ this.createdBy = null; | ||
this.description = opt.description ? opt.description : null; | ||
this.group = opt.group ? new GroupReference(opt.group) : null; | ||
this.access = opt.access && opt.access.length ? opt.access.map((item) => new Access(item)) : []; | ||
@@ -93,3 +90,2 @@ this.createdBy = opt.createdBy ? new PersonReference(opt.createdBy) : null; | ||
description: { type: ['string', 'null'] }, | ||
group: { anyOf: [{ type: 'null' }, { $ref: 'group.schema.json' }] }, | ||
access: { type: 'array', item: { $ref: 'access.schema.json' } }, | ||
@@ -107,3 +103,3 @@ sections: { type: 'array', item: { $ref: 'document-section.schema.json' } }, | ||
}, | ||
required: Object.keys(this), | ||
required: Object.keys(new Document()), | ||
}; | ||
@@ -167,3 +163,2 @@ } | ||
tv4.addSchema(Access.schema()); | ||
tv4.addSchema(GroupReference.schema()); | ||
tv4.addSchema(PersonReference.schema()); | ||
@@ -170,0 +165,0 @@ tv4.addSchema(TemplateReference.schema()); |
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
409095
200
11266