Files: 468d684bfde5b5b265ab076477d4c4930e4d8dc8 / poll / schema / poll.js
1405 bytesRaw
1 | const dotDetails = require('./details/dot.js') |
2 | const proposalDetails = require('./details/proposal.js') |
3 | const scoreDetails = require('./details/score.js') |
4 | const chooseOneDetails = require('./details/chooseOne.js') |
5 | |
6 | const ssbSchemaDefintions = require('../../lib/ssbSchemaDefintions') |
7 | |
8 | const 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 | |
48 | module.exports = schema |
49 |
Built with git-ssb-web