@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.
- package/dist/activity-stream-helper.d.ts +5 -0
- package/dist/activity-stream-helper.js +36 -0
- package/dist/activity-stream-helper.js.map +10 -0
- package/dist/context.d.ts +56 -0
- package/dist/context.js +80 -0
- package/dist/context.js.map +10 -0
- package/dist/contexts/platform/caldav/v1.jsonld +8 -0
- package/dist/contexts/platform/carddav/v1.jsonld +8 -0
- package/dist/contexts/platform/dummy/v1.jsonld +8 -0
- package/dist/contexts/platform/error/v1.jsonld +8 -0
- package/dist/contexts/platform/feeds/v1.jsonld +8 -0
- package/dist/contexts/platform/irc/v1.jsonld +8 -0
- package/dist/contexts/platform/metadata/v1.jsonld +8 -0
- package/dist/contexts/platform/sockethub%3Ainternal/v1.jsonld +8 -0
- package/dist/contexts/platform/xmpp/v1.jsonld +8 -0
- package/dist/contexts/v1.jsonld +7 -0
- package/dist/helpers/error-parser.d.ts +13 -0
- package/dist/helpers/objects.d.ts +157 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +1235 -1143
- package/dist/index.js.map +15 -17
- package/dist/maps/context-map.json +41 -0
- package/dist/object-types.d.ts +2 -0
- package/dist/object-types.js +299 -0
- package/dist/object-types.js.map +12 -0
- package/dist/schema-id.d.ts +11 -0
- package/dist/schemas/activity-stream.d.ts +196 -0
- package/{src/schemas/json/activity-object.json → dist/schemas/json/activity-stream.json} +99 -158
- package/dist/schemas/json/platform.json +52 -0
- package/dist/schemas/json/service-descriptor.json +58 -0
- package/dist/schemas/json/sockethub-config.json +500 -0
- package/dist/schemas/platform/caldav/v1/credentials.schema.json +71 -0
- package/dist/schemas/platform/caldav/v1/messages.schema.json +769 -0
- package/dist/schemas/platform/carddav/v1/credentials.schema.json +67 -0
- package/dist/schemas/platform/carddav/v1/messages.schema.json +375 -0
- package/dist/schemas/platform/dummy/v1/credentials.schema.json +1 -0
- package/dist/schemas/platform/dummy/v1/messages.schema.json +22 -0
- package/dist/schemas/platform/error/v1/credentials.schema.json +1 -0
- package/dist/schemas/platform/error/v1/messages.schema.json +1 -0
- package/dist/schemas/platform/feeds/v1/credentials.schema.json +1 -0
- package/dist/schemas/platform/feeds/v1/messages.schema.json +27 -0
- package/dist/schemas/platform/irc/v1/credentials.schema.json +118 -0
- package/dist/schemas/platform/irc/v1/messages.schema.json +149 -0
- package/dist/schemas/platform/metadata/v1/credentials.schema.json +1 -0
- package/dist/schemas/platform/metadata/v1/messages.schema.json +14 -0
- package/dist/schemas/platform/sockethub%3Ainternal/v1/credentials.schema.json +1 -0
- package/dist/schemas/platform/sockethub%3Ainternal/v1/messages.schema.json +1 -0
- package/dist/schemas/platform/xmpp/v1/credentials.schema.json +43 -0
- package/dist/schemas/platform/xmpp/v1/messages.schema.json +129 -0
- package/dist/schemas/platform.d.ts +62 -0
- package/dist/schemas/service-descriptor.d.ts +84 -0
- package/dist/schemas/sockethub-config.d.ts +466 -0
- package/dist/service-descriptor.d.ts +4 -0
- package/dist/service-descriptor.js +6280 -0
- package/dist/service-descriptor.js.map +77 -0
- package/{src/types.ts → dist/types.d.ts} +52 -53
- package/dist/validator.d.ts +26 -0
- package/package.json +32 -11
- package/src/helpers/error-parser.ts +0 -113
- package/src/helpers/objects.ts +0 -227
- package/src/index.test.data.credentials.ts +0 -71
- package/src/index.test.data.objects.ts +0 -241
- package/src/index.test.data.platform.ts +0 -45
- package/src/index.test.data.streams.ts +0 -498
- package/src/index.test.ts +0 -99
- package/src/index.ts +0 -27
- package/src/schemas/activity-object.ts +0 -19
- package/src/schemas/activity-stream.ts +0 -54
- package/src/schemas/json/activity-stream.json +0 -469
- package/src/schemas/json/platform.json +0 -28
- package/src/schemas/json/sockethub-config.json +0 -144
- package/src/schemas/platform.ts +0 -47
- package/src/schemas/sockethub-config.ts +0 -140
- package/src/validator.ts +0 -94
|
@@ -1,23 +1,66 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://sockethub.org/schemas/3.0.0-
|
|
3
|
-
"description": "Schema for Sockethub Activity
|
|
2
|
+
"$id": "https://sockethub.org/schemas/3.0.0-beta.0/activity-stream.json",
|
|
3
|
+
"description": "Schema for Sockethub Activity Streams",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"required": [
|
|
6
|
-
"
|
|
6
|
+
"@context",
|
|
7
|
+
"type",
|
|
8
|
+
"actor"
|
|
7
9
|
],
|
|
10
|
+
"additionalProperties": false,
|
|
8
11
|
"properties": {
|
|
9
|
-
"
|
|
12
|
+
"@context": {
|
|
13
|
+
"type": "array",
|
|
14
|
+
"minItems": 3,
|
|
15
|
+
"maxItems": 3,
|
|
16
|
+
"items": {
|
|
17
|
+
"type": "string"
|
|
18
|
+
},
|
|
19
|
+
"allOf": [
|
|
20
|
+
{
|
|
21
|
+
"contains": {
|
|
22
|
+
"const": "https://www.w3.org/ns/activitystreams"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"contains": {
|
|
27
|
+
"const": "https://sockethub.org/ns/context/v1.jsonld"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
"id": {
|
|
33
|
+
"type": "string"
|
|
34
|
+
},
|
|
35
|
+
"type": {
|
|
36
|
+
"type": "string"
|
|
37
|
+
},
|
|
38
|
+
"actor": {
|
|
10
39
|
"type": "object",
|
|
11
40
|
"oneOf": [
|
|
12
41
|
{
|
|
13
|
-
"$ref": "#/definitions/type/
|
|
42
|
+
"$ref": "#/definitions/type/person"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"$ref": "#/definitions/type/room"
|
|
14
46
|
},
|
|
15
47
|
{
|
|
16
|
-
"$ref": "#/definitions/type/
|
|
48
|
+
"$ref": "#/definitions/type/service"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"$ref": "#/definitions/type/feed"
|
|
17
52
|
},
|
|
18
53
|
{
|
|
19
|
-
"$ref": "#/definitions/type/
|
|
54
|
+
"$ref": "#/definitions/type/website"
|
|
20
55
|
},
|
|
56
|
+
{
|
|
57
|
+
"$ref": "#/definitions/type/platform"
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
},
|
|
61
|
+
"target": {
|
|
62
|
+
"type": "object",
|
|
63
|
+
"oneOf": [
|
|
21
64
|
{
|
|
22
65
|
"$ref": "#/definitions/type/person"
|
|
23
66
|
},
|
|
@@ -28,24 +71,31 @@
|
|
|
28
71
|
"$ref": "#/definitions/type/service"
|
|
29
72
|
},
|
|
30
73
|
{
|
|
31
|
-
"$ref": "#/definitions/type/
|
|
74
|
+
"$ref": "#/definitions/type/feed"
|
|
32
75
|
},
|
|
33
76
|
{
|
|
34
|
-
"$ref": "#/definitions/type/
|
|
77
|
+
"$ref": "#/definitions/type/website"
|
|
35
78
|
},
|
|
36
79
|
{
|
|
37
|
-
"$ref": "#/definitions/type/
|
|
80
|
+
"$ref": "#/definitions/type/platform"
|
|
38
81
|
},
|
|
39
82
|
{
|
|
40
|
-
"$ref": "#/definitions/type/
|
|
83
|
+
"$ref": "#/definitions/type/address"
|
|
41
84
|
},
|
|
42
85
|
{
|
|
43
|
-
"$ref": "#/definitions/type/
|
|
86
|
+
"$ref": "#/definitions/type/calendar"
|
|
44
87
|
},
|
|
45
88
|
{
|
|
46
|
-
"$ref": "#/definitions/type/
|
|
89
|
+
"$ref": "#/definitions/type/addressBook"
|
|
47
90
|
}
|
|
48
91
|
]
|
|
92
|
+
},
|
|
93
|
+
"object": {
|
|
94
|
+
"type": "object"
|
|
95
|
+
},
|
|
96
|
+
"published": {
|
|
97
|
+
"type": "string",
|
|
98
|
+
"format": "date-time"
|
|
49
99
|
}
|
|
50
100
|
},
|
|
51
101
|
"definitions": {
|
|
@@ -80,47 +130,27 @@
|
|
|
80
130
|
}
|
|
81
131
|
}
|
|
82
132
|
},
|
|
83
|
-
"
|
|
133
|
+
"person": {
|
|
84
134
|
"required": [
|
|
85
|
-
"
|
|
86
|
-
"
|
|
135
|
+
"id",
|
|
136
|
+
"type"
|
|
87
137
|
],
|
|
88
138
|
"additionalProperties": true,
|
|
89
139
|
"properties": {
|
|
90
|
-
"type": {
|
|
91
|
-
"enum": [
|
|
92
|
-
"message"
|
|
93
|
-
]
|
|
94
|
-
},
|
|
95
140
|
"id": {
|
|
96
141
|
"type": "string"
|
|
97
142
|
},
|
|
98
|
-
"name": {
|
|
99
|
-
"type": "string"
|
|
100
|
-
},
|
|
101
|
-
"content": {
|
|
102
|
-
"type": "string"
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
"me": {
|
|
107
|
-
"required": [
|
|
108
|
-
"type",
|
|
109
|
-
"content"
|
|
110
|
-
],
|
|
111
|
-
"additionalProperties": true,
|
|
112
|
-
"properties": {
|
|
113
143
|
"type": {
|
|
114
144
|
"enum": [
|
|
115
|
-
"
|
|
145
|
+
"person"
|
|
116
146
|
]
|
|
117
147
|
},
|
|
118
|
-
"
|
|
148
|
+
"name": {
|
|
119
149
|
"type": "string"
|
|
120
150
|
}
|
|
121
151
|
}
|
|
122
152
|
},
|
|
123
|
-
"
|
|
153
|
+
"room": {
|
|
124
154
|
"required": [
|
|
125
155
|
"id",
|
|
126
156
|
"type"
|
|
@@ -132,7 +162,7 @@
|
|
|
132
162
|
},
|
|
133
163
|
"type": {
|
|
134
164
|
"enum": [
|
|
135
|
-
"
|
|
165
|
+
"room"
|
|
136
166
|
]
|
|
137
167
|
},
|
|
138
168
|
"name": {
|
|
@@ -140,7 +170,7 @@
|
|
|
140
170
|
}
|
|
141
171
|
}
|
|
142
172
|
},
|
|
143
|
-
"
|
|
173
|
+
"service": {
|
|
144
174
|
"required": [
|
|
145
175
|
"id",
|
|
146
176
|
"type"
|
|
@@ -152,7 +182,7 @@
|
|
|
152
182
|
},
|
|
153
183
|
"type": {
|
|
154
184
|
"enum": [
|
|
155
|
-
"
|
|
185
|
+
"service"
|
|
156
186
|
]
|
|
157
187
|
},
|
|
158
188
|
"name": {
|
|
@@ -160,7 +190,7 @@
|
|
|
160
190
|
}
|
|
161
191
|
}
|
|
162
192
|
},
|
|
163
|
-
"
|
|
193
|
+
"platform": {
|
|
164
194
|
"required": [
|
|
165
195
|
"id",
|
|
166
196
|
"type"
|
|
@@ -172,7 +202,7 @@
|
|
|
172
202
|
},
|
|
173
203
|
"type": {
|
|
174
204
|
"enum": [
|
|
175
|
-
"
|
|
205
|
+
"platform"
|
|
176
206
|
]
|
|
177
207
|
},
|
|
178
208
|
"name": {
|
|
@@ -201,7 +231,7 @@
|
|
|
201
231
|
}
|
|
202
232
|
}
|
|
203
233
|
},
|
|
204
|
-
"
|
|
234
|
+
"address": {
|
|
205
235
|
"required": [
|
|
206
236
|
"type"
|
|
207
237
|
],
|
|
@@ -209,144 +239,55 @@
|
|
|
209
239
|
"properties": {
|
|
210
240
|
"type": {
|
|
211
241
|
"enum": [
|
|
212
|
-
"
|
|
242
|
+
"address"
|
|
213
243
|
]
|
|
214
|
-
},
|
|
215
|
-
"members": {
|
|
216
|
-
"type": "array",
|
|
217
|
-
"items": {
|
|
218
|
-
"type": "string"
|
|
219
|
-
}
|
|
220
244
|
}
|
|
221
245
|
}
|
|
222
246
|
},
|
|
223
|
-
"
|
|
247
|
+
"calendar": {
|
|
224
248
|
"required": [
|
|
249
|
+
"id",
|
|
225
250
|
"type"
|
|
226
251
|
],
|
|
227
|
-
"additionalProperties":
|
|
252
|
+
"additionalProperties": true,
|
|
228
253
|
"properties": {
|
|
229
|
-
"
|
|
230
|
-
"
|
|
231
|
-
|
|
232
|
-
]
|
|
233
|
-
},
|
|
234
|
-
"presence": {
|
|
235
|
-
"enum": [
|
|
236
|
-
"away",
|
|
237
|
-
"chat",
|
|
238
|
-
"dnd",
|
|
239
|
-
"xa",
|
|
240
|
-
"offline",
|
|
241
|
-
"online"
|
|
242
|
-
]
|
|
243
|
-
},
|
|
244
|
-
"role": {
|
|
245
|
-
"enum": [
|
|
246
|
-
"owner",
|
|
247
|
-
"member",
|
|
248
|
-
"participant",
|
|
249
|
-
"admin"
|
|
250
|
-
]
|
|
254
|
+
"id": {
|
|
255
|
+
"type": "string",
|
|
256
|
+
"format": "iri"
|
|
251
257
|
},
|
|
252
|
-
"content": {
|
|
253
|
-
"type": "string"
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
},
|
|
257
|
-
"relationship": {
|
|
258
|
-
"required": [
|
|
259
|
-
"type",
|
|
260
|
-
"relationship"
|
|
261
|
-
],
|
|
262
|
-
"additionalProperties": false,
|
|
263
|
-
"properties": {
|
|
264
258
|
"type": {
|
|
265
259
|
"enum": [
|
|
266
|
-
"
|
|
267
|
-
]
|
|
268
|
-
},
|
|
269
|
-
"relationship": {
|
|
270
|
-
"enum": [
|
|
271
|
-
"role"
|
|
260
|
+
"calendar"
|
|
272
261
|
]
|
|
273
262
|
},
|
|
274
|
-
"
|
|
275
|
-
"type": "
|
|
276
|
-
"oneOf": [
|
|
277
|
-
{
|
|
278
|
-
"$ref": "#/definitions/type/presence"
|
|
279
|
-
}
|
|
280
|
-
]
|
|
263
|
+
"name": {
|
|
264
|
+
"type": "string"
|
|
281
265
|
},
|
|
282
|
-
"
|
|
283
|
-
"type": "
|
|
284
|
-
"
|
|
285
|
-
|
|
286
|
-
"
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
},
|
|
291
|
-
{
|
|
292
|
-
"$ref": "#/definitions/type/me"
|
|
293
|
-
},
|
|
294
|
-
{
|
|
295
|
-
"$ref": "#/definitions/type/person"
|
|
296
|
-
},
|
|
297
|
-
{
|
|
298
|
-
"$ref": "#/definitions/type/room"
|
|
299
|
-
},
|
|
300
|
-
{
|
|
301
|
-
"$ref": "#/definitions/type/service"
|
|
302
|
-
},
|
|
303
|
-
{
|
|
304
|
-
"$ref": "#/definitions/type/website"
|
|
305
|
-
},
|
|
306
|
-
{
|
|
307
|
-
"$ref": "#/definitions/type/attendance"
|
|
308
|
-
},
|
|
309
|
-
{
|
|
310
|
-
"$ref": "#/definitions/type/presence"
|
|
311
|
-
},
|
|
312
|
-
{
|
|
313
|
-
"$ref": "#/definitions/type/relationship"
|
|
314
|
-
},
|
|
315
|
-
{
|
|
316
|
-
"$ref": "#/definitions/type/topic"
|
|
317
|
-
},
|
|
318
|
-
{
|
|
319
|
-
"$ref": "#/definitions/type/address"
|
|
320
|
-
}
|
|
321
|
-
]
|
|
266
|
+
"components": {
|
|
267
|
+
"type": "array",
|
|
268
|
+
"items": {
|
|
269
|
+
"enum": [
|
|
270
|
+
"event",
|
|
271
|
+
"task"
|
|
272
|
+
]
|
|
273
|
+
}
|
|
322
274
|
}
|
|
323
275
|
}
|
|
324
276
|
},
|
|
325
|
-
"
|
|
277
|
+
"addressBook": {
|
|
326
278
|
"required": [
|
|
279
|
+
"id",
|
|
327
280
|
"type"
|
|
328
281
|
],
|
|
329
282
|
"additionalProperties": false,
|
|
330
283
|
"properties": {
|
|
331
|
-
"
|
|
332
|
-
"
|
|
333
|
-
|
|
334
|
-
]
|
|
284
|
+
"id": {
|
|
285
|
+
"type": "string",
|
|
286
|
+
"format": "iri"
|
|
335
287
|
},
|
|
336
|
-
"content": {
|
|
337
|
-
"type": "string"
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
},
|
|
341
|
-
"address": {
|
|
342
|
-
"required": [
|
|
343
|
-
"type"
|
|
344
|
-
],
|
|
345
|
-
"additionalProperties": false,
|
|
346
|
-
"properties": {
|
|
347
288
|
"type": {
|
|
348
289
|
"enum": [
|
|
349
|
-
"
|
|
290
|
+
"addressBook"
|
|
350
291
|
]
|
|
351
292
|
}
|
|
352
293
|
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$id": "https://sockethub.org/schemas/3.0.0-beta.0/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
|
+
"responses": {
|
|
40
|
+
"title": "responses",
|
|
41
|
+
"type": "object"
|
|
42
|
+
},
|
|
43
|
+
"name": {
|
|
44
|
+
"title": "name",
|
|
45
|
+
"type": "string"
|
|
46
|
+
},
|
|
47
|
+
"version": {
|
|
48
|
+
"title": "version",
|
|
49
|
+
"type": "string"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$id": "https://sockethub.org/schemas/3.0.0-beta.0/service-descriptor.json",
|
|
3
|
+
"description": "Sockethub service descriptor",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"required": [
|
|
6
|
+
"name",
|
|
7
|
+
"apiVersion",
|
|
8
|
+
"platforms"
|
|
9
|
+
],
|
|
10
|
+
"additionalProperties": true,
|
|
11
|
+
"properties": {
|
|
12
|
+
"name": {
|
|
13
|
+
"const": "sockethub"
|
|
14
|
+
},
|
|
15
|
+
"apiVersion": {
|
|
16
|
+
"type": "integer",
|
|
17
|
+
"minimum": 0
|
|
18
|
+
},
|
|
19
|
+
"endpoints": {
|
|
20
|
+
"type": "object",
|
|
21
|
+
"required": [
|
|
22
|
+
"socketIO"
|
|
23
|
+
],
|
|
24
|
+
"additionalProperties": true,
|
|
25
|
+
"properties": {
|
|
26
|
+
"socketIO": {
|
|
27
|
+
"type": "string",
|
|
28
|
+
"pattern": "^/(?![/\\\\])[^\\s\\\\]*$"
|
|
29
|
+
},
|
|
30
|
+
"httpActions": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"pattern": "^/(?![/\\\\])[^\\s\\\\]*$"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"platforms": {
|
|
37
|
+
"type": "array",
|
|
38
|
+
"items": {
|
|
39
|
+
"type": "object",
|
|
40
|
+
"required": [
|
|
41
|
+
"id",
|
|
42
|
+
"apiVersion"
|
|
43
|
+
],
|
|
44
|
+
"additionalProperties": true,
|
|
45
|
+
"properties": {
|
|
46
|
+
"id": {
|
|
47
|
+
"type": "string",
|
|
48
|
+
"minLength": 1
|
|
49
|
+
},
|
|
50
|
+
"apiVersion": {
|
|
51
|
+
"type": "integer",
|
|
52
|
+
"minimum": 0
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|