@sockethub/schemas 3.0.0-alpha.8 → 3.0.0-beta.0

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.
Files changed (74) hide show
  1. package/dist/activity-stream-helper.d.ts +5 -0
  2. package/dist/activity-stream-helper.js +36 -0
  3. package/dist/activity-stream-helper.js.map +10 -0
  4. package/dist/context.d.ts +56 -0
  5. package/dist/context.js +80 -0
  6. package/dist/context.js.map +10 -0
  7. package/dist/contexts/platform/caldav/v1.jsonld +8 -0
  8. package/dist/contexts/platform/carddav/v1.jsonld +8 -0
  9. package/dist/contexts/platform/dummy/v1.jsonld +8 -0
  10. package/dist/contexts/platform/error/v1.jsonld +8 -0
  11. package/dist/contexts/platform/feeds/v1.jsonld +8 -0
  12. package/dist/contexts/platform/irc/v1.jsonld +8 -0
  13. package/dist/contexts/platform/metadata/v1.jsonld +8 -0
  14. package/dist/contexts/platform/sockethub%3Ainternal/v1.jsonld +8 -0
  15. package/dist/contexts/platform/xmpp/v1.jsonld +8 -0
  16. package/dist/contexts/v1.jsonld +7 -0
  17. package/dist/helpers/error-parser.d.ts +13 -0
  18. package/dist/helpers/objects.d.ts +157 -0
  19. package/dist/index.d.ts +11 -0
  20. package/dist/index.js +1235 -1143
  21. package/dist/index.js.map +15 -17
  22. package/dist/maps/context-map.json +41 -0
  23. package/dist/object-types.d.ts +2 -0
  24. package/dist/object-types.js +299 -0
  25. package/dist/object-types.js.map +12 -0
  26. package/dist/schema-id.d.ts +11 -0
  27. package/dist/schemas/activity-stream.d.ts +196 -0
  28. package/{src/schemas/json/activity-object.json → dist/schemas/json/activity-stream.json} +99 -158
  29. package/dist/schemas/json/platform.json +52 -0
  30. package/dist/schemas/json/service-descriptor.json +58 -0
  31. package/dist/schemas/json/sockethub-config.json +500 -0
  32. package/dist/schemas/platform/caldav/v1/credentials.schema.json +71 -0
  33. package/dist/schemas/platform/caldav/v1/messages.schema.json +769 -0
  34. package/dist/schemas/platform/carddav/v1/credentials.schema.json +67 -0
  35. package/dist/schemas/platform/carddav/v1/messages.schema.json +375 -0
  36. package/dist/schemas/platform/dummy/v1/credentials.schema.json +1 -0
  37. package/dist/schemas/platform/dummy/v1/messages.schema.json +22 -0
  38. package/dist/schemas/platform/error/v1/credentials.schema.json +1 -0
  39. package/dist/schemas/platform/error/v1/messages.schema.json +1 -0
  40. package/dist/schemas/platform/feeds/v1/credentials.schema.json +1 -0
  41. package/dist/schemas/platform/feeds/v1/messages.schema.json +27 -0
  42. package/dist/schemas/platform/irc/v1/credentials.schema.json +118 -0
  43. package/dist/schemas/platform/irc/v1/messages.schema.json +149 -0
  44. package/dist/schemas/platform/metadata/v1/credentials.schema.json +1 -0
  45. package/dist/schemas/platform/metadata/v1/messages.schema.json +14 -0
  46. package/dist/schemas/platform/sockethub%3Ainternal/v1/credentials.schema.json +1 -0
  47. package/dist/schemas/platform/sockethub%3Ainternal/v1/messages.schema.json +1 -0
  48. package/dist/schemas/platform/xmpp/v1/credentials.schema.json +43 -0
  49. package/dist/schemas/platform/xmpp/v1/messages.schema.json +129 -0
  50. package/dist/schemas/platform.d.ts +62 -0
  51. package/dist/schemas/service-descriptor.d.ts +84 -0
  52. package/dist/schemas/sockethub-config.d.ts +466 -0
  53. package/dist/service-descriptor.d.ts +4 -0
  54. package/dist/service-descriptor.js +6280 -0
  55. package/dist/service-descriptor.js.map +77 -0
  56. package/{src/types.ts → dist/types.d.ts} +52 -53
  57. package/dist/validator.d.ts +26 -0
  58. package/package.json +32 -11
  59. package/src/helpers/error-parser.ts +0 -113
  60. package/src/helpers/objects.ts +0 -227
  61. package/src/index.test.data.credentials.ts +0 -71
  62. package/src/index.test.data.objects.ts +0 -241
  63. package/src/index.test.data.platform.ts +0 -45
  64. package/src/index.test.data.streams.ts +0 -498
  65. package/src/index.test.ts +0 -99
  66. package/src/index.ts +0 -27
  67. package/src/schemas/activity-object.ts +0 -19
  68. package/src/schemas/activity-stream.ts +0 -54
  69. package/src/schemas/json/activity-stream.json +0 -469
  70. package/src/schemas/json/platform.json +0 -28
  71. package/src/schemas/json/sockethub-config.json +0 -144
  72. package/src/schemas/platform.ts +0 -47
  73. package/src/schemas/sockethub-config.ts +0 -140
  74. package/src/validator.ts +0 -94
@@ -1,469 +0,0 @@
1
- {
2
- "$id": "https://sockethub.org/schemas/3.0.0-alpha.8/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
- }
@@ -1,28 +0,0 @@
1
- {
2
- "$id": "https://sockethub.org/schemas/3.0.0-alpha.8/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
- }
@@ -1,144 +0,0 @@
1
- {
2
- "$id": "https://sockethub.org/schemas/3.0.0-alpha.8/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
- }
@@ -1,47 +0,0 @@
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
- };