git ssb

0+

Piet / ssb-loomio



Tree: 1fe8a8808eb5537d88dcaf30930d6d57f2986822

Files: 1fe8a8808eb5537d88dcaf30930d6d57f2986822 / poll / schema / poll.js

1389 bytesRaw
1const dotDetails = require('./details/dot.js')
2const proposalDetails = require('./details/proposal.js')
3const scoreDetails = require('./details/score.js')
4const chooseOneDetails = require('./details/chooseOne.js')
5
6const ssbSchemaDefintions = require('../../lib/ssbSchemaDefintions')
7
8const schema = {
9 $schema: 'http://json-schema.org/schema#',
10 type: 'object',
11 required: ['type', 'details', 'title', 'closesAt'],
12 properties: {
13 version: {
14 type: 'string',
15 pattern: '^0.1.0$'
16 },
17 type: {
18 type: 'string',
19 pattern: '^poll$'
20 },
21 details: {
22 oneOf: [
23 // { $ref: '#/definitions/details/dot'},
24 // { $ref: '#/definitions/details/proposal'},
25 // { $ref: '#/definitions/details/score'},
26 { $ref: '#/definitions/details/chooseOne' }
27 // { $ref: '#/definitions/details/rsvp'},
28 // { $ref: '#/definitions/details/meeting'},
29 ]
30 },
31 title: { type: 'string' },
32 closesAt: { type: 'string', format: 'date-time' },
33 body: { type: 'string' },
34 mentions: { $ref: '#/definitions/mentions/any' },
35 recps: { $ref: '#/definitions/recps' }
36 },
37 definitions: Object.assign({}, ssbSchemaDefintions, {
38 details: {
39 type: 'object',
40 dot: dotDetails,
41 proposal: proposalDetails,
42 score: scoreDetails,
43 chooseOne: chooseOneDetails
44 }
45 })
46}
47
48module.exports = schema
49

Built with git-ssb-web