@sockethub/schemas 3.0.0-alpha.9 → 3.0.0-beta.1

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 (75) 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/codegen.d.ts +23 -0
  18. package/dist/helpers/error-parser.d.ts +13 -0
  19. package/dist/helpers/objects.d.ts +157 -0
  20. package/dist/index.d.ts +12 -0
  21. package/dist/index.js +1375 -1147
  22. package/dist/index.js.map +16 -17
  23. package/dist/maps/context-map.json +41 -0
  24. package/dist/object-types.d.ts +2 -0
  25. package/dist/object-types.js +299 -0
  26. package/dist/object-types.js.map +12 -0
  27. package/dist/schema-id.d.ts +11 -0
  28. package/dist/schemas/activity-stream.d.ts +196 -0
  29. package/{src/schemas/json/activity-object.json → dist/schemas/json/activity-stream.json} +99 -158
  30. package/dist/schemas/json/platform.json +52 -0
  31. package/dist/schemas/json/service-descriptor.json +58 -0
  32. package/dist/schemas/json/sockethub-config.json +515 -0
  33. package/dist/schemas/platform/caldav/v1/credentials.schema.json +71 -0
  34. package/dist/schemas/platform/caldav/v1/messages.schema.json +769 -0
  35. package/dist/schemas/platform/carddav/v1/credentials.schema.json +67 -0
  36. package/dist/schemas/platform/carddav/v1/messages.schema.json +375 -0
  37. package/dist/schemas/platform/dummy/v1/credentials.schema.json +1 -0
  38. package/dist/schemas/platform/dummy/v1/messages.schema.json +22 -0
  39. package/dist/schemas/platform/error/v1/credentials.schema.json +1 -0
  40. package/dist/schemas/platform/error/v1/messages.schema.json +1 -0
  41. package/dist/schemas/platform/feeds/v1/credentials.schema.json +1 -0
  42. package/dist/schemas/platform/feeds/v1/messages.schema.json +27 -0
  43. package/dist/schemas/platform/irc/v1/credentials.schema.json +118 -0
  44. package/dist/schemas/platform/irc/v1/messages.schema.json +149 -0
  45. package/dist/schemas/platform/metadata/v1/credentials.schema.json +1 -0
  46. package/dist/schemas/platform/metadata/v1/messages.schema.json +14 -0
  47. package/dist/schemas/platform/sockethub%3Ainternal/v1/credentials.schema.json +1 -0
  48. package/dist/schemas/platform/sockethub%3Ainternal/v1/messages.schema.json +1 -0
  49. package/dist/schemas/platform/xmpp/v1/credentials.schema.json +45 -0
  50. package/dist/schemas/platform/xmpp/v1/messages.schema.json +129 -0
  51. package/dist/schemas/platform.d.ts +62 -0
  52. package/dist/schemas/service-descriptor.d.ts +84 -0
  53. package/dist/schemas/sockethub-config.d.ts +481 -0
  54. package/dist/service-descriptor.d.ts +9 -0
  55. package/dist/service-descriptor.js +6355 -0
  56. package/dist/service-descriptor.js.map +78 -0
  57. package/{src/types.ts → dist/types.d.ts} +52 -53
  58. package/dist/validator.d.ts +50 -0
  59. package/package.json +32 -11
  60. package/src/helpers/error-parser.ts +0 -113
  61. package/src/helpers/objects.ts +0 -227
  62. package/src/index.test.data.credentials.ts +0 -71
  63. package/src/index.test.data.objects.ts +0 -241
  64. package/src/index.test.data.platform.ts +0 -45
  65. package/src/index.test.data.streams.ts +0 -498
  66. package/src/index.test.ts +0 -99
  67. package/src/index.ts +0 -27
  68. package/src/schemas/activity-object.ts +0 -19
  69. package/src/schemas/activity-stream.ts +0 -54
  70. package/src/schemas/json/activity-stream.json +0 -469
  71. package/src/schemas/json/platform.json +0 -28
  72. package/src/schemas/json/sockethub-config.json +0 -144
  73. package/src/schemas/platform.ts +0 -47
  74. package/src/schemas/sockethub-config.ts +0 -140
  75. package/src/validator.ts +0 -94
@@ -0,0 +1,67 @@
1
+ {
2
+ "required": [
3
+ "object"
4
+ ],
5
+ "properties": {
6
+ "object": {
7
+ "oneOf": [
8
+ {
9
+ "type": "object",
10
+ "required": [
11
+ "type",
12
+ "url",
13
+ "username",
14
+ "password"
15
+ ],
16
+ "additionalProperties": false,
17
+ "properties": {
18
+ "type": {
19
+ "const": "credentials"
20
+ },
21
+ "url": {
22
+ "type": "string",
23
+ "format": "uri",
24
+ "pattern": "^https?://",
25
+ "maxLength": 4096
26
+ },
27
+ "username": {
28
+ "type": "string",
29
+ "minLength": 1,
30
+ "maxLength": 1024
31
+ },
32
+ "password": {
33
+ "type": "string",
34
+ "minLength": 1,
35
+ "maxLength": 4096
36
+ }
37
+ }
38
+ },
39
+ {
40
+ "type": "object",
41
+ "required": [
42
+ "type",
43
+ "url",
44
+ "token"
45
+ ],
46
+ "additionalProperties": false,
47
+ "properties": {
48
+ "type": {
49
+ "const": "credentials"
50
+ },
51
+ "url": {
52
+ "type": "string",
53
+ "format": "uri",
54
+ "pattern": "^https?://",
55
+ "maxLength": 4096
56
+ },
57
+ "token": {
58
+ "type": "string",
59
+ "minLength": 1,
60
+ "maxLength": 8192
61
+ }
62
+ }
63
+ }
64
+ ]
65
+ }
66
+ }
67
+ }
@@ -0,0 +1,375 @@
1
+ {
2
+ "required": [
3
+ "type",
4
+ "actor"
5
+ ],
6
+ "properties": {
7
+ "type": {
8
+ "enum": [
9
+ "fetch",
10
+ "query",
11
+ "create",
12
+ "update",
13
+ "delete"
14
+ ]
15
+ },
16
+ "actor": {
17
+ "type": "object",
18
+ "required": [
19
+ "id",
20
+ "type"
21
+ ],
22
+ "additionalProperties": false,
23
+ "properties": {
24
+ "id": {
25
+ "type": "string",
26
+ "minLength": 1,
27
+ "maxLength": 1024
28
+ },
29
+ "type": {
30
+ "enum": [
31
+ "person"
32
+ ]
33
+ }
34
+ }
35
+ },
36
+ "target": {
37
+ "type": "object",
38
+ "required": [
39
+ "id",
40
+ "type"
41
+ ],
42
+ "additionalProperties": false,
43
+ "properties": {
44
+ "id": {
45
+ "type": "string",
46
+ "format": "uri",
47
+ "maxLength": 4096
48
+ },
49
+ "type": {
50
+ "enum": [
51
+ "addressBook"
52
+ ]
53
+ }
54
+ }
55
+ },
56
+ "object": {
57
+ "oneOf": [
58
+ {
59
+ "type": "object",
60
+ "required": [
61
+ "type",
62
+ "name"
63
+ ],
64
+ "additionalProperties": false,
65
+ "properties": {
66
+ "id": {
67
+ "type": "string",
68
+ "format": "uri",
69
+ "maxLength": 4096
70
+ },
71
+ "etag": {
72
+ "type": "string",
73
+ "minLength": 1,
74
+ "maxLength": 1024
75
+ },
76
+ "uid": {
77
+ "type": "string",
78
+ "minLength": 1,
79
+ "maxLength": 255
80
+ },
81
+ "type": {
82
+ "const": "person"
83
+ },
84
+ "name": {
85
+ "type": "string",
86
+ "minLength": 1,
87
+ "maxLength": 4096
88
+ },
89
+ "givenName": {
90
+ "type": "string",
91
+ "maxLength": 1024
92
+ },
93
+ "additionalNames": {
94
+ "type": "array",
95
+ "maxItems": 32,
96
+ "items": {
97
+ "type": "string",
98
+ "maxLength": 1024
99
+ }
100
+ },
101
+ "familyName": {
102
+ "type": "string",
103
+ "maxLength": 1024
104
+ },
105
+ "honorificPrefixes": {
106
+ "type": "array",
107
+ "maxItems": 16,
108
+ "items": {
109
+ "type": "string",
110
+ "maxLength": 256
111
+ }
112
+ },
113
+ "honorificSuffixes": {
114
+ "type": "array",
115
+ "maxItems": 16,
116
+ "items": {
117
+ "type": "string",
118
+ "maxLength": 256
119
+ }
120
+ },
121
+ "nickname": {
122
+ "type": "string",
123
+ "maxLength": 1024
124
+ },
125
+ "emails": {
126
+ "type": "array",
127
+ "maxItems": 100,
128
+ "items": {
129
+ "type": "object",
130
+ "required": [
131
+ "value"
132
+ ],
133
+ "additionalProperties": false,
134
+ "properties": {
135
+ "value": {
136
+ "type": "string",
137
+ "minLength": 1,
138
+ "maxLength": 4096
139
+ },
140
+ "types": {
141
+ "type": "array",
142
+ "uniqueItems": true,
143
+ "maxItems": 32,
144
+ "items": {
145
+ "type": "string",
146
+ "minLength": 1,
147
+ "maxLength": 64,
148
+ "pattern": "^[A-Za-z0-9-]+$"
149
+ }
150
+ },
151
+ "preferred": {
152
+ "type": "boolean"
153
+ }
154
+ }
155
+ }
156
+ },
157
+ "telephones": {
158
+ "type": "array",
159
+ "maxItems": 100,
160
+ "items": {
161
+ "type": "object",
162
+ "required": [
163
+ "value"
164
+ ],
165
+ "additionalProperties": false,
166
+ "properties": {
167
+ "value": {
168
+ "type": "string",
169
+ "minLength": 1,
170
+ "maxLength": 4096
171
+ },
172
+ "types": {
173
+ "type": "array",
174
+ "uniqueItems": true,
175
+ "maxItems": 32,
176
+ "items": {
177
+ "type": "string",
178
+ "minLength": 1,
179
+ "maxLength": 64,
180
+ "pattern": "^[A-Za-z0-9-]+$"
181
+ }
182
+ },
183
+ "preferred": {
184
+ "type": "boolean"
185
+ }
186
+ }
187
+ }
188
+ },
189
+ "addresses": {
190
+ "type": "array",
191
+ "maxItems": 100,
192
+ "items": {
193
+ "type": "object",
194
+ "additionalProperties": false,
195
+ "properties": {
196
+ "types": {
197
+ "type": "array",
198
+ "uniqueItems": true,
199
+ "maxItems": 32,
200
+ "items": {
201
+ "type": "string",
202
+ "minLength": 1,
203
+ "maxLength": 64,
204
+ "pattern": "^[A-Za-z0-9-]+$"
205
+ }
206
+ },
207
+ "preferred": {
208
+ "type": "boolean"
209
+ },
210
+ "postOfficeBox": {
211
+ "type": "string",
212
+ "maxLength": 1024
213
+ },
214
+ "extendedAddress": {
215
+ "type": "string",
216
+ "maxLength": 1024
217
+ },
218
+ "street": {
219
+ "type": "string",
220
+ "maxLength": 4096
221
+ },
222
+ "locality": {
223
+ "type": "string",
224
+ "maxLength": 1024
225
+ },
226
+ "region": {
227
+ "type": "string",
228
+ "maxLength": 1024
229
+ },
230
+ "postalCode": {
231
+ "type": "string",
232
+ "maxLength": 256
233
+ },
234
+ "country": {
235
+ "type": "string",
236
+ "maxLength": 1024
237
+ }
238
+ }
239
+ }
240
+ },
241
+ "organization": {
242
+ "type": "string",
243
+ "maxLength": 4096
244
+ },
245
+ "title": {
246
+ "type": "string",
247
+ "maxLength": 1024
248
+ },
249
+ "role": {
250
+ "type": "string",
251
+ "maxLength": 1024
252
+ },
253
+ "urls": {
254
+ "type": "array",
255
+ "maxItems": 100,
256
+ "items": {
257
+ "type": "object",
258
+ "required": [
259
+ "value"
260
+ ],
261
+ "additionalProperties": false,
262
+ "properties": {
263
+ "value": {
264
+ "type": "string",
265
+ "minLength": 1,
266
+ "maxLength": 4096
267
+ },
268
+ "types": {
269
+ "type": "array",
270
+ "uniqueItems": true,
271
+ "maxItems": 32,
272
+ "items": {
273
+ "type": "string",
274
+ "minLength": 1,
275
+ "maxLength": 64,
276
+ "pattern": "^[A-Za-z0-9-]+$"
277
+ }
278
+ },
279
+ "preferred": {
280
+ "type": "boolean"
281
+ }
282
+ }
283
+ }
284
+ },
285
+ "photoUrls": {
286
+ "type": "array",
287
+ "maxItems": 16,
288
+ "items": {
289
+ "type": "string",
290
+ "format": "uri",
291
+ "pattern": "^https?://[^\\r\\n]+$",
292
+ "maxLength": 4096
293
+ }
294
+ },
295
+ "note": {
296
+ "type": "string",
297
+ "maxLength": 65536
298
+ },
299
+ "birthday": {
300
+ "type": "string",
301
+ "minLength": 4,
302
+ "maxLength": 32,
303
+ "pattern": "^[^\\r\\n]+$"
304
+ },
305
+ "vcardVersion": {
306
+ "enum": [
307
+ "3.0",
308
+ "4.0"
309
+ ]
310
+ },
311
+ "updateSupported": {
312
+ "type": "boolean"
313
+ }
314
+ }
315
+ },
316
+ {
317
+ "type": "object",
318
+ "additionalProperties": false,
319
+ "properties": {
320
+ "type": {
321
+ "const": "contactQuery"
322
+ },
323
+ "text": {
324
+ "type": "string",
325
+ "minLength": 1,
326
+ "maxLength": 1024
327
+ },
328
+ "fields": {
329
+ "type": "array",
330
+ "uniqueItems": true,
331
+ "maxItems": 4,
332
+ "items": {
333
+ "enum": [
334
+ "name",
335
+ "email",
336
+ "telephone",
337
+ "organization"
338
+ ]
339
+ }
340
+ },
341
+ "limit": {
342
+ "type": "integer",
343
+ "minimum": 1,
344
+ "maximum": 1000
345
+ }
346
+ }
347
+ },
348
+ {
349
+ "type": "object",
350
+ "required": [
351
+ "id",
352
+ "type",
353
+ "etag"
354
+ ],
355
+ "additionalProperties": false,
356
+ "properties": {
357
+ "id": {
358
+ "type": "string",
359
+ "format": "uri",
360
+ "maxLength": 4096
361
+ },
362
+ "type": {
363
+ "const": "person"
364
+ },
365
+ "etag": {
366
+ "type": "string",
367
+ "minLength": 1,
368
+ "maxLength": 1024
369
+ }
370
+ }
371
+ }
372
+ ]
373
+ }
374
+ }
375
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "required": [
3
+ "type"
4
+ ],
5
+ "properties": {
6
+ "type": {
7
+ "enum": [
8
+ "echo",
9
+ "fail",
10
+ "throw",
11
+ "greet",
12
+ "exit0",
13
+ "exit1",
14
+ "throwTypeError",
15
+ "throwReferenceError",
16
+ "sigterm",
17
+ "sigkill",
18
+ "hang"
19
+ ]
20
+ }
21
+ }
22
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "required": [
3
+ "type"
4
+ ],
5
+ "properties": {
6
+ "type": {
7
+ "type": "string",
8
+ "enum": [
9
+ "fetch"
10
+ ]
11
+ },
12
+ "object": {
13
+ "type": "object",
14
+ "additionalProperties": false,
15
+ "properties": {
16
+ "since": {
17
+ "type": "string",
18
+ "format": "date-time"
19
+ },
20
+ "limit": {
21
+ "type": "integer",
22
+ "minimum": 1
23
+ }
24
+ }
25
+ }
26
+ }
27
+ }
@@ -0,0 +1,118 @@
1
+ {
2
+ "required": [
3
+ "object"
4
+ ],
5
+ "properties": {
6
+ "actor": {
7
+ "type": "object",
8
+ "required": [
9
+ "id"
10
+ ]
11
+ },
12
+ "object": {
13
+ "type": "object",
14
+ "required": [
15
+ "type",
16
+ "nick",
17
+ "server"
18
+ ],
19
+ "additionalProperties": false,
20
+ "not": {
21
+ "required": [
22
+ "password",
23
+ "token"
24
+ ]
25
+ },
26
+ "allOf": [
27
+ {
28
+ "anyOf": [
29
+ {
30
+ "not": {
31
+ "properties": {
32
+ "saslMechanism": {
33
+ "const": "PLAIN"
34
+ }
35
+ },
36
+ "required": [
37
+ "saslMechanism"
38
+ ]
39
+ }
40
+ },
41
+ {
42
+ "required": [
43
+ "password"
44
+ ]
45
+ },
46
+ {
47
+ "required": [
48
+ "token"
49
+ ]
50
+ }
51
+ ]
52
+ },
53
+ {
54
+ "anyOf": [
55
+ {
56
+ "not": {
57
+ "properties": {
58
+ "saslMechanism": {
59
+ "const": "OAUTHBEARER"
60
+ }
61
+ },
62
+ "required": [
63
+ "saslMechanism"
64
+ ]
65
+ }
66
+ },
67
+ {
68
+ "required": [
69
+ "token"
70
+ ]
71
+ }
72
+ ]
73
+ }
74
+ ],
75
+ "properties": {
76
+ "type": {
77
+ "type": "string"
78
+ },
79
+ "nick": {
80
+ "type": "string"
81
+ },
82
+ "username": {
83
+ "type": "string"
84
+ },
85
+ "password": {
86
+ "type": "string",
87
+ "minLength": 1
88
+ },
89
+ "token": {
90
+ "type": "string",
91
+ "minLength": 1
92
+ },
93
+ "server": {
94
+ "type": "string"
95
+ },
96
+ "port": {
97
+ "type": "number"
98
+ },
99
+ "secure": {
100
+ "type": "boolean"
101
+ },
102
+ "sasl": {
103
+ "type": "boolean"
104
+ },
105
+ "saslMechanism": {
106
+ "type": "string",
107
+ "enum": [
108
+ "PLAIN",
109
+ "OAUTHBEARER"
110
+ ]
111
+ },
112
+ "allowInvalidCert": {
113
+ "type": "boolean"
114
+ }
115
+ }
116
+ }
117
+ }
118
+ }