git ssb

0+

Piet / ssb-loomio



Commit 1c7838db4a112873f77b9c4e8962ac23b04bbbf7

extract mentions and recps as common definitions

mix irving committed on 3/5/2018, 5:47:35 AM
Parent: 3bc106d06cd050c026b7934dacf2076f6d847894

Files changed

lib/ssbSchemaDefintions.jschanged
poll/schema/poll.jschanged
position/schema/position.jschanged
lib/ssbSchemaDefintions.jsView
@@ -35,7 +35,36 @@
3535 properties: {
3636 link: { $ref: '#/definitions/blobId' },
3737 name: { type: 'string' }
3838 }
39+ },
40+ any: {
41+ oneOf: [
42+ { type: 'null' },
43+ {
44+ type: 'array',
45+ items: {
46+ oneOf: [
47+ { $ref: '#/definitions/mentions/message' },
48+ { $ref: '#/definitions/mentions/feed' },
49+ { $ref: '#/definitions/mentions/blob' }
50+ ]
51+ }
52+ }
53+ ]
3954 }
55+ },
56+ recps: {
57+ oneOf: [
58+ { type: 'null' },
59+ {
60+ type: 'array',
61+ items: {
62+ oneOf: [
63+ { $ref: '#/definitions/feedId' },
64+ { $ref: '#/definitions/mentions/feed' }
65+ ]
66+ }
67+ }
68+ ]
4069 }
4170 }
poll/schema/poll.jsView
@@ -30,49 +30,19 @@
3030 },
3131 title: { type: 'string' },
3232 closesAt: { type: 'integer' },
3333 body: { type: 'string' },
34- mentions: {
35- oneOf: [
36- { type: 'null' },
37- {
38- type: 'array',
39- items: {
40- oneOf: [
41- { $ref: '#/definitions/mentions/message' },
42- { $ref: '#/definitions/mentions/feed' },
43- { $ref: '#/definitions/mentions/blob' }
44- ]
45- }
46- }
47- ]
48- },
49- recps: {
50- oneOf: [
51- { type: 'null' },
52- {
53- type: 'array',
54- items: {
55- oneOf: [
56- { $ref: '#/definitions/feedId' },
57- { $ref: '#/definitions/mentions/feed' }
58- ]
59- }
60- }
61- ]
62- }
34+ mentions: { $ref: '#/definitions/mentions/any' },
35+ recps: { $ref: '#/definitions/recps' }
6336 },
64- definitions: Object.assign({},
65- ssbSchemaDefintions,
66- {
67- pollDetails: {
68- type: 'object',
69- dot: dotDetails,
70- proposal: proposalDetails,
71- score: scoreDetails,
72- chooseOne: chooseOneDetails
73- }
37+ definitions: Object.assign({}, ssbSchemaDefintions, {
38+ pollDetails: {
39+ type: 'object',
40+ dot: dotDetails,
41+ proposal: proposalDetails,
42+ score: scoreDetails,
43+ chooseOne: chooseOneDetails
7444 }
75- )
45+ })
7646 }
7747
7848 module.exports = schema
position/schema/position.jsView
@@ -27,46 +27,16 @@
2727 // { $ref: '#/definitions/positionDetails/rsvp'},
2828 // { $ref: '#/definitions/positionDetails/meeting'},
2929 ]
3030 },
31- mentions: {
32- oneOf: [
33- { type: 'null' },
34- {
35- type: 'array',
36- items: {
37- oneOf: [
38- { $ref: '#/definitions/mentions/message' },
39- { $ref: '#/definitions/mentions/feed' },
40- { $ref: '#/definitions/mentions/blob' }
41- ]
42- }
43- }
44- ]
45- },
46- recps: {
47- oneOf: [
48- { type: 'null' },
49- {
50- type: 'array',
51- items: {
52- oneOf: [
53- { $ref: '#/definitions/feedId' },
54- { $ref: '#/definitions/mentions/feed' }
55- ]
56- }
57- }
58- ]
59- }
31+ mentions: { $ref: '#/definitions/mentions/any' },
32+ recps: { $ref: '#/definitions/recps' }
6033 },
61- definitions: Object.assign({},
62- ssbSchemaDefintions,
63- {
64- positionDetails: {
65- type: 'object',
66- chooseOne: chooseOneDetails
67- }
34+ definitions: Object.assign({}, ssbSchemaDefintions, {
35+ positionDetails: {
36+ type: 'object',
37+ chooseOne: chooseOneDetails
6838 }
69- )
39+ })
7040 }
7141
7242 module.exports = schema

Built with git-ssb-web