Vulcan/packages/vulcan-debug/lib/modules/callbacks/schema.js

85 lines
1.3 KiB
JavaScript
Raw Normal View History

2017-10-21 15:58:02 +09:00
import { Callbacks } from 'meteor/vulcan:lib';
const schema = {
name: {
label: 'Name',
type: String,
viewableBy: ['admins'],
},
arguments: {
label: 'Arguments',
type: Array,
viewableBy: ['admins'],
},
'arguments.$': {
type: Object,
viewableBy: ['admins'],
},
2018-04-07 10:20:44 +09:00
// iterator: {
// label: 'Iterator',
// type: String,
// viewableBy: ['admins'],
// },
// options: {
// label: 'Options',
// type: Array,
// viewableBy: ['admins'],
// },
// 'options.$': {
// type: Object,
// viewableBy: ['admins'],
// },
2017-10-21 15:58:02 +09:00
runs: {
label: 'Runs',
type: String,
viewableBy: ['admins'],
},
2018-04-07 10:20:44 +09:00
newSyntax: {
label: 'New Syntax',
type: Boolean,
viewableBy: ['admins'],
},
2017-10-21 15:58:02 +09:00
returns: {
label: 'Should Return',
type: String,
viewableBy: ['admins'],
},
description: {
label: 'Description',
type: String,
viewableBy: ['admins'],
},
hooks: {
label: 'Hooks',
type: Array,
viewableBy: ['admins'],
resolveAs: {
type: '[String]',
resolver: callback => {
2017-10-21 15:58:02 +09:00
if (Callbacks[callback.name]) {
const callbacks = Callbacks[callback.name].map(f => f.name);
return callbacks;
} else {
return [];
}
},
},
},
'hooks.$': {
type: Object,
}
2017-10-21 15:58:02 +09:00
};
export default schema;