@sockethub/schemas 3.0.0-alpha.11 → 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 (60) 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/dummy/v1.jsonld +8 -0
  8. package/dist/contexts/platform/error/v1.jsonld +8 -0
  9. package/dist/contexts/platform/feeds/v1.jsonld +8 -0
  10. package/dist/contexts/platform/irc/v1.jsonld +8 -0
  11. package/dist/contexts/platform/metadata/v1.jsonld +8 -0
  12. package/dist/contexts/platform/sockethub%3Ainternal/v1.jsonld +8 -0
  13. package/dist/contexts/platform/xmpp/v1.jsonld +8 -0
  14. package/dist/contexts/v1.jsonld +7 -0
  15. package/dist/helpers/error-parser.d.ts +13 -0
  16. package/dist/helpers/objects.d.ts +122 -0
  17. package/dist/index.d.ts +9 -0
  18. package/dist/index.js +459 -216
  19. package/dist/index.js.map +12 -11
  20. package/dist/maps/context-map.json +35 -0
  21. package/dist/object-types.d.ts +2 -0
  22. package/dist/object-types.js +296 -0
  23. package/dist/object-types.js.map +12 -0
  24. package/dist/schemas/activity-stream.d.ts +161 -0
  25. package/dist/schemas/platform/dummy/v1/credentials.schema.json +1 -0
  26. package/dist/schemas/platform/dummy/v1/messages.schema.json +22 -0
  27. package/dist/schemas/platform/error/v1/credentials.schema.json +1 -0
  28. package/dist/schemas/platform/error/v1/messages.schema.json +1 -0
  29. package/dist/schemas/platform/feeds/v1/credentials.schema.json +1 -0
  30. package/dist/schemas/platform/feeds/v1/messages.schema.json +27 -0
  31. package/dist/schemas/platform/irc/v1/credentials.schema.json +118 -0
  32. package/dist/schemas/platform/irc/v1/messages.schema.json +103 -0
  33. package/dist/schemas/platform/metadata/v1/credentials.schema.json +1 -0
  34. package/dist/schemas/platform/metadata/v1/messages.schema.json +14 -0
  35. package/dist/schemas/platform/sockethub%3Ainternal/v1/credentials.schema.json +1 -0
  36. package/dist/schemas/platform/sockethub%3Ainternal/v1/messages.schema.json +1 -0
  37. package/dist/schemas/platform/xmpp/v1/credentials.schema.json +43 -0
  38. package/dist/schemas/platform/xmpp/v1/messages.schema.json +129 -0
  39. package/dist/schemas/platform.d.ts +62 -0
  40. package/dist/schemas/sockethub-config.d.ts +261 -0
  41. package/{src/types.ts → dist/types.d.ts} +25 -46
  42. package/dist/validator.d.ts +26 -0
  43. package/package.json +17 -7
  44. package/src/helpers/error-parser.ts +0 -113
  45. package/src/helpers/objects.ts +0 -227
  46. package/src/index.test.data.credentials.ts +0 -71
  47. package/src/index.test.data.objects.ts +0 -241
  48. package/src/index.test.data.platform.ts +0 -45
  49. package/src/index.test.data.streams.ts +0 -498
  50. package/src/index.test.ts +0 -99
  51. package/src/index.ts +0 -29
  52. package/src/schemas/activity-object.ts +0 -19
  53. package/src/schemas/activity-stream.ts +0 -54
  54. package/src/schemas/json/activity-object.json +0 -356
  55. package/src/schemas/json/activity-stream.json +0 -469
  56. package/src/schemas/json/platform.json +0 -28
  57. package/src/schemas/json/sockethub-config.json +0 -222
  58. package/src/schemas/platform.ts +0 -47
  59. package/src/schemas/sockethub-config.ts +0 -206
  60. package/src/validator.ts +0 -87
@@ -1,469 +0,0 @@
1
- {
2
- "$id": "https://sockethub.org/schemas/3.0.0-alpha.11/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.11/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,222 +0,0 @@
1
- {
2
- "$id": "https://sockethub.org/schemas/3.0.0-alpha.11/sockethub-config.json",
3
- "description": "Sockethub Config Schema",
4
- "type": "object",
5
- "required": [
6
- "platforms"
7
- ],
8
- "additionalProperties": false,
9
- "properties": {
10
- "$schema": {
11
- "type": "string"
12
- },
13
- "examples": {
14
- "type": "boolean",
15
- "default": true
16
- },
17
- "logging": {
18
- "type": "object",
19
- "additionalProperties": false,
20
- "properties": {
21
- "level": {
22
- "type": "string",
23
- "enum": [
24
- "error",
25
- "warn",
26
- "info",
27
- "debug"
28
- ],
29
- "default": "info"
30
- },
31
- "fileLevel": {
32
- "type": "string",
33
- "enum": [
34
- "error",
35
- "warn",
36
- "info",
37
- "debug"
38
- ],
39
- "default": "debug"
40
- },
41
- "file": {
42
- "type": "string",
43
- "default": "sockethub.log"
44
- }
45
- }
46
- },
47
- "packageConfig": {
48
- "type": "object",
49
- "properties": {
50
- "@sockethub/activity-streams": {
51
- "type": "object",
52
- "additionalProperties": false,
53
- "properties": {
54
- "specialObjs": {
55
- "type": "array",
56
- "items": {
57
- "type": "string"
58
- },
59
- "default": [
60
- "credentials"
61
- ]
62
- },
63
- "failOnUnknownObjectProperties": {
64
- "type": "boolean",
65
- "default": true
66
- }
67
- }
68
- },
69
- "@sockethub/platform-dummy": {
70
- "type": "object",
71
- "additionalProperties": false,
72
- "properties": {
73
- "greeting": {
74
- "type": "string",
75
- "default": "Hello"
76
- }
77
- }
78
- },
79
- "@sockethub/platform-feeds": {
80
- "type": "object",
81
- "additionalProperties": false,
82
- "properties": {
83
- "connectTimeoutMs": {
84
- "type": "number"
85
- }
86
- }
87
- },
88
- "@sockethub/platform-irc": {
89
- "type": "object",
90
- "additionalProperties": false,
91
- "properties": {
92
- "connectTimeoutMs": {
93
- "type": "number"
94
- }
95
- }
96
- },
97
- "@sockethub/platform-xmpp": {
98
- "type": "object",
99
- "additionalProperties": false,
100
- "properties": {
101
- "connectTimeoutMs": {
102
- "type": "number"
103
- }
104
- }
105
- }
106
- }
107
- },
108
- "platforms": {
109
- "type": "array",
110
- "items": {
111
- "type": "string"
112
- },
113
- "default": [
114
- "@sockethub/platform-dummy",
115
- "@sockethub/platform-feeds",
116
- "@sockethub/platform-irc",
117
- "@sockethub/platform-metadata",
118
- "@sockethub/platform-xmpp"
119
- ]
120
- },
121
- "public": {
122
- "type": "object",
123
- "additionalProperties": false,
124
- "properties": {
125
- "protocol": {
126
- "type": "string",
127
- "default": "http"
128
- },
129
- "host": {
130
- "type": "string",
131
- "default": "localhost"
132
- },
133
- "port": {
134
- "type": "number",
135
- "default": 10550
136
- },
137
- "path": {
138
- "type": "string",
139
- "default": "/"
140
- }
141
- }
142
- },
143
- "rateLimiter": {
144
- "type": "object",
145
- "additionalProperties": false,
146
- "properties": {
147
- "windowMs": {
148
- "type": "number",
149
- "default": 1000
150
- },
151
- "maxRequests": {
152
- "type": "number",
153
- "default": 100
154
- },
155
- "blockDurationMs": {
156
- "type": "number",
157
- "default": 5000
158
- }
159
- }
160
- },
161
- "redis": {
162
- "type": "object",
163
- "additionalProperties": false,
164
- "properties": {
165
- "url": {
166
- "type": "string",
167
- "default": "redis://127.0.0.1:6379"
168
- },
169
- "connectTimeout": {
170
- "type": "number",
171
- "default": 10000,
172
- "description": "Connection timeout in milliseconds"
173
- },
174
- "disconnectTimeout": {
175
- "type": "number",
176
- "default": 5000,
177
- "description": "Disconnect timeout in milliseconds"
178
- },
179
- "maxRetriesPerRequest": {
180
- "type": [
181
- "number",
182
- "null"
183
- ],
184
- "default": null,
185
- "description": "Maximum number of retries per request (null for BullMQ default)"
186
- }
187
- }
188
- },
189
- "sentry": {
190
- "type": "object",
191
- "additionalProperties": false,
192
- "properties": {
193
- "dsn": {
194
- "type": "string",
195
- "default": ""
196
- },
197
- "traceSampleRate": {
198
- "type": "number",
199
- "default": 1
200
- }
201
- }
202
- },
203
- "sockethub": {
204
- "type": "object",
205
- "additionalProperties": false,
206
- "properties": {
207
- "port": {
208
- "type": "number",
209
- "default": 10550
210
- },
211
- "host": {
212
- "type": "string",
213
- "default": "localhost"
214
- },
215
- "path": {
216
- "type": "string",
217
- "default": "/sockethub"
218
- }
219
- }
220
- }
221
- }
222
- }