git ssb

0+

Piet / ssb-loomio



Tree: ac1a79fec1e45652d23a6905c8540851a850a868

Files: ac1a79fec1e45652d23a6905c8540851a850a868 / poll / schema / poll.js

1405 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', 'pollDetails', '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 pollDetails: {
22 oneOf: [
23 // { $ref: '#/definitions/pollDetails/dot'},
24 // { $ref: '#/definitions/pollDetails/proposal'},
25 // { $ref: '#/definitions/pollDetails/score'},
26 { $ref: '#/definitions/pollDetails/chooseOne' }
27 // { $ref: '#/definitions/pollDetails/rsvp'},
28 // { $ref: '#/definitions/pollDetails/meeting'},
29 ]
30 },
31 title: { type: 'string' },
32 closesAt: { type: 'integer' },
33 body: { type: 'string' },
34 mentions: { $ref: '#/definitions/mentions/any' },
35 recps: { $ref: '#/definitions/recps' }
36 },
37 definitions: Object.assign({}, ssbSchemaDefintions, {
38 pollDetails: {
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