@sockethub/schemas 3.0.0-alpha.12 → 3.0.0-alpha.13

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 (46) 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 +20 -41
  6. package/dist/context.js.map +3 -3
  7. package/dist/helpers/error-parser.d.ts +13 -0
  8. package/dist/helpers/objects.d.ts +122 -0
  9. package/dist/index.d.ts +9 -0
  10. package/dist/index.js +180 -218
  11. package/dist/index.js.map +12 -12
  12. package/dist/maps/context-map.json +2 -2
  13. package/dist/object-types.d.ts +2 -0
  14. package/dist/object-types.js +296 -0
  15. package/dist/object-types.js.map +12 -0
  16. package/dist/schemas/activity-stream.d.ts +161 -0
  17. package/dist/schemas/platform/feeds/v1/messages.schema.json +8 -17
  18. package/dist/schemas/platform/irc/v1/credentials.schema.json +71 -1
  19. package/dist/schemas/platform/irc/v1/messages.schema.json +84 -0
  20. package/dist/schemas/platform/metadata/v1/messages.schema.json +1 -16
  21. package/dist/schemas/platform/xmpp/v1/credentials.schema.json +2 -2
  22. package/dist/schemas/platform/xmpp/v1/messages.schema.json +108 -0
  23. package/dist/schemas/platform.d.ts +62 -0
  24. package/dist/schemas/sockethub-config.d.ts +261 -0
  25. package/{src/types.ts → dist/types.d.ts} +17 -45
  26. package/dist/validator.d.ts +26 -0
  27. package/package.json +13 -8
  28. package/src/context.ts +0 -125
  29. package/src/helpers/error-parser.ts +0 -160
  30. package/src/helpers/objects.ts +0 -283
  31. package/src/index.test.data.credentials.ts +0 -103
  32. package/src/index.test.data.objects.ts +0 -241
  33. package/src/index.test.data.platform.ts +0 -48
  34. package/src/index.test.data.streams.ts +0 -590
  35. package/src/index.test.ts +0 -127
  36. package/src/index.ts +0 -56
  37. package/src/schemas/activity-object.ts +0 -19
  38. package/src/schemas/activity-stream.ts +0 -75
  39. package/src/schemas/json/activity-object.json +0 -405
  40. package/src/schemas/json/activity-stream.json +0 -502
  41. package/src/schemas/json/platform.json +0 -48
  42. package/src/schemas/json/sockethub-config.json +0 -236
  43. package/src/schemas/platform.ts +0 -71
  44. package/src/schemas/sockethub-config.ts +0 -220
  45. package/src/types/ajv-formats-draft2019.d.ts +0 -5
  46. package/src/validator.ts +0 -207
@@ -1,502 +0,0 @@
1
- {
2
- "$id": "https://sockethub.org/schemas/3.0.0-alpha.12/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
- "@context": {
12
- "type": "array",
13
- "minItems": 3,
14
- "maxItems": 3,
15
- "items": {
16
- "type": "string"
17
- },
18
- "allOf": [
19
- {
20
- "contains": {
21
- "const": "https://www.w3.org/ns/activitystreams"
22
- }
23
- },
24
- {
25
- "contains": {
26
- "const": "https://sockethub.org/ns/context/v1.jsonld"
27
- }
28
- }
29
- ]
30
- },
31
- "id": {
32
- "type": "string"
33
- },
34
- "type": {
35
- "type": "string"
36
- },
37
- "actor": {
38
- "type": "object",
39
- "oneOf": [
40
- {
41
- "$ref": "#/definitions/type/person"
42
- },
43
- {
44
- "$ref": "#/definitions/type/room"
45
- },
46
- {
47
- "$ref": "#/definitions/type/service"
48
- },
49
- {
50
- "$ref": "#/definitions/type/feed"
51
- },
52
- {
53
- "$ref": "#/definitions/type/website"
54
- },
55
- {
56
- "$ref": "#/definitions/type/platform"
57
- }
58
- ]
59
- },
60
- "target": {
61
- "type": "object",
62
- "oneOf": [
63
- {
64
- "$ref": "#/definitions/type/person"
65
- },
66
- {
67
- "$ref": "#/definitions/type/room"
68
- },
69
- {
70
- "$ref": "#/definitions/type/service"
71
- },
72
- {
73
- "$ref": "#/definitions/type/feed"
74
- },
75
- {
76
- "$ref": "#/definitions/type/website"
77
- },
78
- {
79
- "$ref": "#/definitions/type/platform"
80
- },
81
- {
82
- "$ref": "#/definitions/type/address"
83
- }
84
- ]
85
- },
86
- "object": {
87
- "type": "object",
88
- "oneOf": [
89
- {
90
- "$ref": "#/definitions/type/credentials"
91
- },
92
- {
93
- "$ref": "#/definitions/type/feed"
94
- },
95
- {
96
- "$ref": "#/definitions/type/message"
97
- },
98
- {
99
- "$ref": "#/definitions/type/me"
100
- },
101
- {
102
- "$ref": "#/definitions/type/person"
103
- },
104
- {
105
- "$ref": "#/definitions/type/room"
106
- },
107
- {
108
- "$ref": "#/definitions/type/service"
109
- },
110
- {
111
- "$ref": "#/definitions/type/platform"
112
- },
113
- {
114
- "$ref": "#/definitions/type/website"
115
- },
116
- {
117
- "$ref": "#/definitions/type/attendance"
118
- },
119
- {
120
- "$ref": "#/definitions/type/presence"
121
- },
122
- {
123
- "$ref": "#/definitions/type/relationship"
124
- },
125
- {
126
- "$ref": "#/definitions/type/topic"
127
- },
128
- {
129
- "$ref": "#/definitions/type/address"
130
- },
131
- {
132
- "$ref": "#/definitions/type/heartbeat"
133
- }
134
- ]
135
- },
136
- "published": {
137
- "type": "string",
138
- "format": "date-time"
139
- }
140
- },
141
- "definitions": {
142
- "type": {
143
- "credentials": {
144
- "required": [
145
- "type"
146
- ],
147
- "additionalProperties": true,
148
- "properties": {
149
- "type": {
150
- "enum": [
151
- "credentials"
152
- ]
153
- }
154
- }
155
- },
156
- "feed": {
157
- "required": [
158
- "id",
159
- "type"
160
- ],
161
- "additionalProperties": true,
162
- "properties": {
163
- "type": {
164
- "enum": [
165
- "feed"
166
- ]
167
- },
168
- "id": {
169
- "type": "string",
170
- "format": "iri"
171
- },
172
- "name": {
173
- "type": "string"
174
- },
175
- "description": {
176
- "type": "string"
177
- },
178
- "author": {
179
- "type": "string"
180
- },
181
- "favicon": {
182
- "type": "string"
183
- }
184
- }
185
- },
186
- "message": {
187
- "required": [
188
- "type",
189
- "content"
190
- ],
191
- "additionalProperties": true,
192
- "properties": {
193
- "type": {
194
- "enum": [
195
- "message"
196
- ]
197
- },
198
- "id": {
199
- "type": "string"
200
- },
201
- "name": {
202
- "type": "string"
203
- },
204
- "content": {
205
- "type": "string"
206
- }
207
- }
208
- },
209
- "me": {
210
- "required": [
211
- "type",
212
- "content"
213
- ],
214
- "additionalProperties": true,
215
- "properties": {
216
- "type": {
217
- "enum": [
218
- "me"
219
- ]
220
- },
221
- "content": {
222
- "type": "string"
223
- }
224
- }
225
- },
226
- "person": {
227
- "required": [
228
- "id",
229
- "type"
230
- ],
231
- "additionalProperties": true,
232
- "properties": {
233
- "id": {
234
- "type": "string"
235
- },
236
- "type": {
237
- "enum": [
238
- "person"
239
- ]
240
- },
241
- "name": {
242
- "type": "string"
243
- }
244
- }
245
- },
246
- "room": {
247
- "required": [
248
- "id",
249
- "type"
250
- ],
251
- "additionalProperties": true,
252
- "properties": {
253
- "id": {
254
- "type": "string"
255
- },
256
- "type": {
257
- "enum": [
258
- "room"
259
- ]
260
- },
261
- "name": {
262
- "type": "string"
263
- }
264
- }
265
- },
266
- "service": {
267
- "required": [
268
- "id",
269
- "type"
270
- ],
271
- "additionalProperties": true,
272
- "properties": {
273
- "id": {
274
- "type": "string"
275
- },
276
- "type": {
277
- "enum": [
278
- "service"
279
- ]
280
- },
281
- "name": {
282
- "type": "string"
283
- }
284
- }
285
- },
286
- "platform": {
287
- "required": [
288
- "id",
289
- "type"
290
- ],
291
- "additionalProperties": true,
292
- "properties": {
293
- "id": {
294
- "type": "string"
295
- },
296
- "type": {
297
- "enum": [
298
- "platform"
299
- ]
300
- },
301
- "name": {
302
- "type": "string"
303
- }
304
- }
305
- },
306
- "website": {
307
- "required": [
308
- "id",
309
- "type"
310
- ],
311
- "additionalProperties": true,
312
- "properties": {
313
- "id": {
314
- "type": "string",
315
- "format": "iri"
316
- },
317
- "type": {
318
- "enum": [
319
- "website"
320
- ]
321
- },
322
- "name": {
323
- "type": "string"
324
- }
325
- }
326
- },
327
- "attendance": {
328
- "required": [
329
- "type"
330
- ],
331
- "additionalProperties": false,
332
- "properties": {
333
- "type": {
334
- "enum": [
335
- "attendance"
336
- ]
337
- },
338
- "members": {
339
- "type": "array",
340
- "items": {
341
- "type": "string"
342
- }
343
- }
344
- }
345
- },
346
- "presence": {
347
- "required": [
348
- "type"
349
- ],
350
- "additionalProperties": false,
351
- "properties": {
352
- "type": {
353
- "enum": [
354
- "presence"
355
- ]
356
- },
357
- "presence": {
358
- "enum": [
359
- "away",
360
- "chat",
361
- "dnd",
362
- "xa",
363
- "offline",
364
- "online"
365
- ]
366
- },
367
- "role": {
368
- "enum": [
369
- "owner",
370
- "member",
371
- "participant",
372
- "admin"
373
- ]
374
- },
375
- "content": {
376
- "type": "string"
377
- }
378
- }
379
- },
380
- "relationship": {
381
- "required": [
382
- "type",
383
- "relationship"
384
- ],
385
- "additionalProperties": false,
386
- "properties": {
387
- "type": {
388
- "enum": [
389
- "relationship"
390
- ]
391
- },
392
- "relationship": {
393
- "enum": [
394
- "role"
395
- ]
396
- },
397
- "subject": {
398
- "type": "object",
399
- "oneOf": [
400
- {
401
- "$ref": "#/definitions/type/presence"
402
- }
403
- ]
404
- },
405
- "object": {
406
- "type": "object",
407
- "oneOf": [
408
- {
409
- "$ref": "#/definitions/type/feed"
410
- },
411
- {
412
- "$ref": "#/definitions/type/message"
413
- },
414
- {
415
- "$ref": "#/definitions/type/me"
416
- },
417
- {
418
- "$ref": "#/definitions/type/person"
419
- },
420
- {
421
- "$ref": "#/definitions/type/room"
422
- },
423
- {
424
- "$ref": "#/definitions/type/service"
425
- },
426
- {
427
- "$ref": "#/definitions/type/platform"
428
- },
429
- {
430
- "$ref": "#/definitions/type/website"
431
- },
432
- {
433
- "$ref": "#/definitions/type/attendance"
434
- },
435
- {
436
- "$ref": "#/definitions/type/presence"
437
- },
438
- {
439
- "$ref": "#/definitions/type/relationship"
440
- },
441
- {
442
- "$ref": "#/definitions/type/topic"
443
- },
444
- {
445
- "$ref": "#/definitions/type/address"
446
- },
447
- {
448
- "$ref": "#/definitions/type/heartbeat"
449
- }
450
- ]
451
- }
452
- }
453
- },
454
- "topic": {
455
- "required": [
456
- "type"
457
- ],
458
- "additionalProperties": false,
459
- "properties": {
460
- "type": {
461
- "enum": [
462
- "topic"
463
- ]
464
- },
465
- "content": {
466
- "type": "string"
467
- }
468
- }
469
- },
470
- "address": {
471
- "required": [
472
- "type"
473
- ],
474
- "additionalProperties": false,
475
- "properties": {
476
- "type": {
477
- "enum": [
478
- "address"
479
- ]
480
- }
481
- }
482
- },
483
- "heartbeat": {
484
- "required": [
485
- "type",
486
- "timestamp"
487
- ],
488
- "additionalProperties": false,
489
- "properties": {
490
- "type": {
491
- "enum": [
492
- "heartbeat"
493
- ]
494
- },
495
- "timestamp": {
496
- "type": "number"
497
- }
498
- }
499
- }
500
- }
501
- }
502
- }
@@ -1,48 +0,0 @@
1
- {
2
- "$id": "https://sockethub.org/schemas/3.0.0-alpha.12/platform.json",
3
- "type": "object",
4
- "required": [
5
- "name",
6
- "version",
7
- "messages",
8
- "contextUrl",
9
- "contextVersion",
10
- "schemaVersion"
11
- ],
12
- "additionalProperties": false,
13
- "properties": {
14
- "contextUrl": {
15
- "title": "contextUrl",
16
- "type": "string",
17
- "format": "uri"
18
- },
19
- "contextVersion": {
20
- "title": "contextVersion",
21
- "type": "string"
22
- },
23
- "schemaVersion": {
24
- "title": "schemaVersion",
25
- "type": "string"
26
- },
27
- "messageConstraints": {
28
- "title": "messageConstraints",
29
- "type": "object"
30
- },
31
- "credentials": {
32
- "title": "credentials",
33
- "type": "object"
34
- },
35
- "messages": {
36
- "title": "messages",
37
- "type": "object"
38
- },
39
- "name": {
40
- "title": "name",
41
- "type": "string"
42
- },
43
- "version": {
44
- "title": "version",
45
- "type": "string"
46
- }
47
- }
48
- }