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'],
|
|
|
|
},
|
|
|
|
|
|
|
|
runs: {
|
|
|
|
label: 'Runs',
|
|
|
|
type: String,
|
|
|
|
viewableBy: ['admins'],
|
|
|
|
},
|
|
|
|
|
|
|
|
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]',
|
2017-12-18 09:57:17 +09:00
|
|
|
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 [];
|
|
|
|
}
|
2017-12-18 09:57:17 +09:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2017-10-21 15:58:02 +09:00
|
|
|
};
|
|
|
|
|
|
|
|
export default schema;
|