@sockethub/schemas 3.0.0-alpha.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,469 @@
1
+ {
2
+ "$id": "https://sockethub.org/schemas/3.0.0-alpha.10/activity-stream.json",
3
+ "description": "Schema for Sockethub Activity Streams",
4
+ "type": "object",
5
+ "required": [
6
+ "context",
7
+ "type",
8
+ "actor"
9
+ ],
10
+ "properties": {
11
+ "id": {
12
+ "type": "string"
13
+ },
14
+ "type": {
15
+ "type": "string"
16
+ },
17
+ "context": {
18
+ "type": "string"
19
+ },
20
+ "actor": {
21
+ "type": "object",
22
+ "oneOf": [
23
+ {
24
+ "$ref": "#/definitions/type/feed"
25
+ },
26
+ {
27
+ "$ref": "#/definitions/type/message"
28
+ },
29
+ {
30
+ "$ref": "#/definitions/type/me"
31
+ },
32
+ {
33
+ "$ref": "#/definitions/type/person"
34
+ },
35
+ {
36
+ "$ref": "#/definitions/type/room"
37
+ },
38
+ {
39
+ "$ref": "#/definitions/type/service"
40
+ },
41
+ {
42
+ "$ref": "#/definitions/type/website"
43
+ },
44
+ {
45
+ "$ref": "#/definitions/type/attendance"
46
+ },
47
+ {
48
+ "$ref": "#/definitions/type/presence"
49
+ },
50
+ {
51
+ "$ref": "#/definitions/type/relationship"
52
+ },
53
+ {
54
+ "$ref": "#/definitions/type/topic"
55
+ },
56
+ {
57
+ "$ref": "#/definitions/type/address"
58
+ }
59
+ ]
60
+ },
61
+ "target": {
62
+ "type": "object",
63
+ "oneOf": [
64
+ {
65
+ "$ref": "#/definitions/type/feed"
66
+ },
67
+ {
68
+ "$ref": "#/definitions/type/message"
69
+ },
70
+ {
71
+ "$ref": "#/definitions/type/me"
72
+ },
73
+ {
74
+ "$ref": "#/definitions/type/person"
75
+ },
76
+ {
77
+ "$ref": "#/definitions/type/room"
78
+ },
79
+ {
80
+ "$ref": "#/definitions/type/service"
81
+ },
82
+ {
83
+ "$ref": "#/definitions/type/website"
84
+ },
85
+ {
86
+ "$ref": "#/definitions/type/attendance"
87
+ },
88
+ {
89
+ "$ref": "#/definitions/type/presence"
90
+ },
91
+ {
92
+ "$ref": "#/definitions/type/relationship"
93
+ },
94
+ {
95
+ "$ref": "#/definitions/type/topic"
96
+ },
97
+ {
98
+ "$ref": "#/definitions/type/address"
99
+ }
100
+ ]
101
+ },
102
+ "object": {
103
+ "type": "object",
104
+ "oneOf": [
105
+ {
106
+ "$ref": "#/definitions/type/credentials"
107
+ },
108
+ {
109
+ "$ref": "#/definitions/type/feed"
110
+ },
111
+ {
112
+ "$ref": "#/definitions/type/message"
113
+ },
114
+ {
115
+ "$ref": "#/definitions/type/me"
116
+ },
117
+ {
118
+ "$ref": "#/definitions/type/person"
119
+ },
120
+ {
121
+ "$ref": "#/definitions/type/room"
122
+ },
123
+ {
124
+ "$ref": "#/definitions/type/service"
125
+ },
126
+ {
127
+ "$ref": "#/definitions/type/website"
128
+ },
129
+ {
130
+ "$ref": "#/definitions/type/attendance"
131
+ },
132
+ {
133
+ "$ref": "#/definitions/type/presence"
134
+ },
135
+ {
136
+ "$ref": "#/definitions/type/relationship"
137
+ },
138
+ {
139
+ "$ref": "#/definitions/type/topic"
140
+ },
141
+ {
142
+ "$ref": "#/definitions/type/address"
143
+ }
144
+ ]
145
+ },
146
+ "published": {
147
+ "type": "string",
148
+ "format": "date-time"
149
+ }
150
+ },
151
+ "definitions": {
152
+ "type": {
153
+ "credentials": {
154
+ "required": [
155
+ "type"
156
+ ],
157
+ "additionalProperties": true,
158
+ "properties": {
159
+ "type": {
160
+ "enum": [
161
+ "credentials"
162
+ ]
163
+ }
164
+ }
165
+ },
166
+ "feed": {
167
+ "required": [
168
+ "id",
169
+ "type"
170
+ ],
171
+ "additionalProperties": true,
172
+ "properties": {
173
+ "type": {
174
+ "enum": [
175
+ "feed"
176
+ ]
177
+ },
178
+ "id": {
179
+ "type": "string",
180
+ "format": "iri"
181
+ },
182
+ "name": {
183
+ "type": "string"
184
+ },
185
+ "description": {
186
+ "type": "string"
187
+ },
188
+ "author": {
189
+ "type": "string"
190
+ },
191
+ "favicon": {
192
+ "type": "string"
193
+ }
194
+ }
195
+ },
196
+ "message": {
197
+ "required": [
198
+ "type",
199
+ "content"
200
+ ],
201
+ "additionalProperties": true,
202
+ "properties": {
203
+ "type": {
204
+ "enum": [
205
+ "message"
206
+ ]
207
+ },
208
+ "id": {
209
+ "type": "string"
210
+ },
211
+ "name": {
212
+ "type": "string"
213
+ },
214
+ "content": {
215
+ "type": "string"
216
+ }
217
+ }
218
+ },
219
+ "me": {
220
+ "required": [
221
+ "type",
222
+ "content"
223
+ ],
224
+ "additionalProperties": true,
225
+ "properties": {
226
+ "type": {
227
+ "enum": [
228
+ "me"
229
+ ]
230
+ },
231
+ "content": {
232
+ "type": "string"
233
+ }
234
+ }
235
+ },
236
+ "person": {
237
+ "required": [
238
+ "id",
239
+ "type"
240
+ ],
241
+ "additionalProperties": true,
242
+ "properties": {
243
+ "id": {
244
+ "type": "string"
245
+ },
246
+ "type": {
247
+ "enum": [
248
+ "person"
249
+ ]
250
+ },
251
+ "name": {
252
+ "type": "string"
253
+ }
254
+ }
255
+ },
256
+ "room": {
257
+ "required": [
258
+ "id",
259
+ "type"
260
+ ],
261
+ "additionalProperties": true,
262
+ "properties": {
263
+ "id": {
264
+ "type": "string"
265
+ },
266
+ "type": {
267
+ "enum": [
268
+ "room"
269
+ ]
270
+ },
271
+ "name": {
272
+ "type": "string"
273
+ }
274
+ }
275
+ },
276
+ "service": {
277
+ "required": [
278
+ "id",
279
+ "type"
280
+ ],
281
+ "additionalProperties": true,
282
+ "properties": {
283
+ "id": {
284
+ "type": "string"
285
+ },
286
+ "type": {
287
+ "enum": [
288
+ "service"
289
+ ]
290
+ },
291
+ "name": {
292
+ "type": "string"
293
+ }
294
+ }
295
+ },
296
+ "website": {
297
+ "required": [
298
+ "id",
299
+ "type"
300
+ ],
301
+ "additionalProperties": true,
302
+ "properties": {
303
+ "id": {
304
+ "type": "string",
305
+ "format": "iri"
306
+ },
307
+ "type": {
308
+ "enum": [
309
+ "website"
310
+ ]
311
+ },
312
+ "name": {
313
+ "type": "string"
314
+ }
315
+ }
316
+ },
317
+ "attendance": {
318
+ "required": [
319
+ "type"
320
+ ],
321
+ "additionalProperties": false,
322
+ "properties": {
323
+ "type": {
324
+ "enum": [
325
+ "attendance"
326
+ ]
327
+ },
328
+ "members": {
329
+ "type": "array",
330
+ "items": {
331
+ "type": "string"
332
+ }
333
+ }
334
+ }
335
+ },
336
+ "presence": {
337
+ "required": [
338
+ "type"
339
+ ],
340
+ "additionalProperties": false,
341
+ "properties": {
342
+ "type": {
343
+ "enum": [
344
+ "presence"
345
+ ]
346
+ },
347
+ "presence": {
348
+ "enum": [
349
+ "away",
350
+ "chat",
351
+ "dnd",
352
+ "xa",
353
+ "offline",
354
+ "online"
355
+ ]
356
+ },
357
+ "role": {
358
+ "enum": [
359
+ "owner",
360
+ "member",
361
+ "participant",
362
+ "admin"
363
+ ]
364
+ },
365
+ "content": {
366
+ "type": "string"
367
+ }
368
+ }
369
+ },
370
+ "relationship": {
371
+ "required": [
372
+ "type",
373
+ "relationship"
374
+ ],
375
+ "additionalProperties": false,
376
+ "properties": {
377
+ "type": {
378
+ "enum": [
379
+ "relationship"
380
+ ]
381
+ },
382
+ "relationship": {
383
+ "enum": [
384
+ "role"
385
+ ]
386
+ },
387
+ "subject": {
388
+ "type": "object",
389
+ "oneOf": [
390
+ {
391
+ "$ref": "#/definitions/type/presence"
392
+ }
393
+ ]
394
+ },
395
+ "object": {
396
+ "type": "object",
397
+ "oneOf": [
398
+ {
399
+ "$ref": "#/definitions/type/feed"
400
+ },
401
+ {
402
+ "$ref": "#/definitions/type/message"
403
+ },
404
+ {
405
+ "$ref": "#/definitions/type/me"
406
+ },
407
+ {
408
+ "$ref": "#/definitions/type/person"
409
+ },
410
+ {
411
+ "$ref": "#/definitions/type/room"
412
+ },
413
+ {
414
+ "$ref": "#/definitions/type/service"
415
+ },
416
+ {
417
+ "$ref": "#/definitions/type/website"
418
+ },
419
+ {
420
+ "$ref": "#/definitions/type/attendance"
421
+ },
422
+ {
423
+ "$ref": "#/definitions/type/presence"
424
+ },
425
+ {
426
+ "$ref": "#/definitions/type/relationship"
427
+ },
428
+ {
429
+ "$ref": "#/definitions/type/topic"
430
+ },
431
+ {
432
+ "$ref": "#/definitions/type/address"
433
+ }
434
+ ]
435
+ }
436
+ }
437
+ },
438
+ "topic": {
439
+ "required": [
440
+ "type"
441
+ ],
442
+ "additionalProperties": false,
443
+ "properties": {
444
+ "type": {
445
+ "enum": [
446
+ "topic"
447
+ ]
448
+ },
449
+ "content": {
450
+ "type": "string"
451
+ }
452
+ }
453
+ },
454
+ "address": {
455
+ "required": [
456
+ "type"
457
+ ],
458
+ "additionalProperties": false,
459
+ "properties": {
460
+ "type": {
461
+ "enum": [
462
+ "address"
463
+ ]
464
+ }
465
+ }
466
+ }
467
+ }
468
+ }
469
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "$id": "https://sockethub.org/schemas/3.0.0-alpha.10/platform.json",
3
+ "type": "object",
4
+ "required": [
5
+ "name",
6
+ "version",
7
+ "messages"
8
+ ],
9
+ "additionalProperties": false,
10
+ "properties": {
11
+ "credentials": {
12
+ "title": "credentials",
13
+ "type": "object"
14
+ },
15
+ "messages": {
16
+ "title": "messages",
17
+ "type": "object"
18
+ },
19
+ "name": {
20
+ "title": "name",
21
+ "type": "string"
22
+ },
23
+ "version": {
24
+ "title": "version",
25
+ "type": "string"
26
+ }
27
+ }
28
+ }
@@ -0,0 +1,144 @@
1
+ {
2
+ "$id": "https://sockethub.org/schemas/3.0.0-alpha.10/sockethub-config.json",
3
+ "description": "Sockethub Config Schema",
4
+ "type": "object",
5
+ "required": [
6
+ "platforms"
7
+ ],
8
+ "properties": {
9
+ "examples": {
10
+ "type": "object",
11
+ "properties": {
12
+ "enabled": {
13
+ "type": "boolean",
14
+ "default": false
15
+ },
16
+ "secret": {
17
+ "type": "string",
18
+ "default": "1234567890"
19
+ }
20
+ },
21
+ "additionalProperties": false
22
+ },
23
+ "log_file": {
24
+ "type": "string"
25
+ },
26
+ "packageConfig": {
27
+ "type": "object",
28
+ "properties": {
29
+ "@sockethub/activity-streams": {
30
+ "type": "object",
31
+ "properties": {
32
+ "specialObjs": {
33
+ "type": "array",
34
+ "items": {
35
+ "type": "string"
36
+ },
37
+ "default": [
38
+ "credentials"
39
+ ]
40
+ },
41
+ "failOnUnknownObjectProperties": {
42
+ "type": "boolean",
43
+ "default": true
44
+ }
45
+ },
46
+ "additionalProperties": false
47
+ },
48
+ "@sockethub/platform-dummy": {
49
+ "type": "object",
50
+ "properties": {
51
+ "greeting": {
52
+ "type": "string",
53
+ "default": "Hello"
54
+ }
55
+ },
56
+ "additionalProperties": false
57
+ },
58
+ "@sockethub/platform-feeds": {
59
+ "type": "object",
60
+ "properties": {
61
+ "connectTimeoutMs": {
62
+ "type": "number"
63
+ }
64
+ },
65
+ "additionalProperties": false
66
+ },
67
+ "@sockethub/platform-irc": {
68
+ "type": "object",
69
+ "properties": {
70
+ "connectTimeoutMs": {
71
+ "type": "number"
72
+ }
73
+ },
74
+ "additionalProperties": false
75
+ },
76
+ "@sockethub/platform-xmpp": {
77
+ "type": "object",
78
+ "properties": {
79
+ "connectTimeoutMs": {
80
+ "type": "number"
81
+ }
82
+ },
83
+ "additionalProperties": false
84
+ }
85
+ }
86
+ },
87
+ "platforms": {
88
+ "type": "array",
89
+ "items": {
90
+ "type": "string"
91
+ }
92
+ },
93
+ "public": {
94
+ "type": "object",
95
+ "properties": {
96
+ "protocol": {
97
+ "type": "string",
98
+ "default": "http"
99
+ },
100
+ "host": {
101
+ "type": "string",
102
+ "default": "localhost"
103
+ },
104
+ "port": {
105
+ "type": "number",
106
+ "default": 10550
107
+ },
108
+ "path": {
109
+ "type": "string",
110
+ "default": "/"
111
+ }
112
+ },
113
+ "additionalProperties": false
114
+ },
115
+ "redis": {
116
+ "type": "object",
117
+ "properties": {
118
+ "url": {
119
+ "type": "string",
120
+ "default": "redis://127.0.0.1:6379"
121
+ }
122
+ },
123
+ "additionalProperties": false
124
+ },
125
+ "sockethub": {
126
+ "type": "object",
127
+ "properties": {
128
+ "port": {
129
+ "type": "number",
130
+ "default": 10550
131
+ },
132
+ "host": {
133
+ "type": "string",
134
+ "default": "localhost"
135
+ },
136
+ "path": {
137
+ "type": "string",
138
+ "default": "/sockethub"
139
+ }
140
+ },
141
+ "additionalProperties": false
142
+ }
143
+ }
144
+ }
@@ -0,0 +1,47 @@
1
+ /**
2
+ * This file is part of Sockethub.
3
+ *
4
+ * Developed by Nick Jennings (https://github.com/silverbucket)
5
+ *
6
+ * server is licensed under the LGPL.
7
+ * See the LICENSE file for details.
8
+ *
9
+ * The latest version of server can be found here:
10
+ * git://github.com/sockethub/sockethub.git
11
+ *
12
+ * For more information about Sockethub visit https://sockethub.org/.
13
+ *
14
+ * This program is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17
+ */
18
+
19
+ // this schema defines the general structure of the schema object which should
20
+ // be returned from platforms.
21
+ export const PlatformSchema = {
22
+ $id: "https://sockethub.org/schemas/v/platform.json",
23
+ type: "object",
24
+ required: ["name", "version", "messages"],
25
+ additionalProperties: false,
26
+ properties: {
27
+ credentials: {
28
+ title: "credentials",
29
+ type: "object",
30
+ },
31
+
32
+ messages: {
33
+ title: "messages",
34
+ type: "object",
35
+ },
36
+
37
+ name: {
38
+ title: "name",
39
+ type: "string",
40
+ },
41
+
42
+ version: {
43
+ title: "version",
44
+ type: "string",
45
+ },
46
+ },
47
+ };