mirror of
https://github.com/vale981/Vulcan
synced 2025-03-12 05:26:38 -04:00
66 lines
877 B
JavaScript
66 lines
877 B
JavaScript
![]() |
|
||
|
const schema = {
|
||
|
|
||
|
// default properties
|
||
|
|
||
|
_id: {
|
||
|
type: String,
|
||
|
optional: true,
|
||
|
viewableBy: ['guests'],
|
||
|
},
|
||
|
createdAt: {
|
||
|
type: Date,
|
||
|
optional: true,
|
||
|
viewableBy: ['guests'],
|
||
|
onInsert: (document, currentUser) => {
|
||
|
return new Date();
|
||
|
}
|
||
|
},
|
||
|
userId: {
|
||
|
type: String,
|
||
|
optional: true,
|
||
|
viewableBy: ['guests'],
|
||
|
resolveAs: 'user: User', // resolve as "user" on the client
|
||
|
},
|
||
|
|
||
|
// custom properties
|
||
|
|
||
|
tokenId: {
|
||
|
type: String,
|
||
|
optional: false,
|
||
|
},
|
||
|
|
||
|
productKey: {
|
||
|
type: String,
|
||
|
optional: true,
|
||
|
},
|
||
|
|
||
|
type: {
|
||
|
type: String,
|
||
|
optional: false,
|
||
|
},
|
||
|
|
||
|
test: {
|
||
|
type: Boolean,
|
||
|
optional: true,
|
||
|
},
|
||
|
|
||
|
data: {
|
||
|
type: Object,
|
||
|
blackbox: true,
|
||
|
},
|
||
|
|
||
|
properties: {
|
||
|
type: Object,
|
||
|
blackbox: true,
|
||
|
},
|
||
|
|
||
|
ip: {
|
||
|
type: String,
|
||
|
optional: true,
|
||
|
},
|
||
|
|
||
|
};
|
||
|
|
||
|
export default schema;
|