@sockethub/schemas 3.0.0-alpha.9 → 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
@@ -0,0 +1,769 @@
1
+ {
2
+ "required": [
3
+ "type",
4
+ "actor"
5
+ ],
6
+ "properties": {
7
+ "type": {
8
+ "type": "string",
9
+ "enum": [
10
+ "fetch",
11
+ "read",
12
+ "query",
13
+ "create",
14
+ "update",
15
+ "delete"
16
+ ]
17
+ },
18
+ "actor": {
19
+ "type": "object",
20
+ "required": [
21
+ "id",
22
+ "type"
23
+ ],
24
+ "additionalProperties": false,
25
+ "properties": {
26
+ "id": {
27
+ "type": "string",
28
+ "minLength": 1,
29
+ "maxLength": 1024
30
+ },
31
+ "type": {
32
+ "enum": [
33
+ "person"
34
+ ]
35
+ }
36
+ }
37
+ },
38
+ "target": {
39
+ "oneOf": [
40
+ {
41
+ "type": "object",
42
+ "required": [
43
+ "id",
44
+ "type"
45
+ ],
46
+ "additionalProperties": false,
47
+ "properties": {
48
+ "id": {
49
+ "type": "string",
50
+ "format": "uri",
51
+ "maxLength": 4096
52
+ },
53
+ "type": {
54
+ "enum": [
55
+ "calendar"
56
+ ]
57
+ }
58
+ }
59
+ },
60
+ {
61
+ "type": "object",
62
+ "required": [
63
+ "id",
64
+ "type"
65
+ ],
66
+ "additionalProperties": false,
67
+ "properties": {
68
+ "id": {
69
+ "type": "string",
70
+ "format": "uri",
71
+ "pattern": "^(?:https?|webcal)://",
72
+ "maxLength": 4096
73
+ },
74
+ "type": {
75
+ "enum": [
76
+ "feed"
77
+ ]
78
+ }
79
+ }
80
+ }
81
+ ]
82
+ },
83
+ "object": {
84
+ "oneOf": [
85
+ {
86
+ "type": "object",
87
+ "required": [
88
+ "type",
89
+ "name",
90
+ "startTime"
91
+ ],
92
+ "additionalProperties": false,
93
+ "properties": {
94
+ "id": {
95
+ "type": "string",
96
+ "format": "uri",
97
+ "maxLength": 4096
98
+ },
99
+ "etag": {
100
+ "type": "string",
101
+ "minLength": 1,
102
+ "maxLength": 1024
103
+ },
104
+ "uid": {
105
+ "type": "string",
106
+ "minLength": 1,
107
+ "maxLength": 255
108
+ },
109
+ "sequence": {
110
+ "type": "integer",
111
+ "minimum": 0,
112
+ "maximum": 2147483647
113
+ },
114
+ "name": {
115
+ "type": "string",
116
+ "minLength": 1,
117
+ "maxLength": 4096
118
+ },
119
+ "content": {
120
+ "type": "string",
121
+ "maxLength": 65536
122
+ },
123
+ "location": {
124
+ "type": "string",
125
+ "maxLength": 4096
126
+ },
127
+ "url": {
128
+ "type": "string",
129
+ "format": "uri",
130
+ "maxLength": 4096
131
+ },
132
+ "timeZone": {
133
+ "type": "string",
134
+ "minLength": 1,
135
+ "maxLength": 255
136
+ },
137
+ "recurrence": {
138
+ "type": "object",
139
+ "required": [
140
+ "frequency"
141
+ ],
142
+ "additionalProperties": false,
143
+ "properties": {
144
+ "frequency": {
145
+ "enum": [
146
+ "daily",
147
+ "weekly",
148
+ "monthly",
149
+ "yearly"
150
+ ]
151
+ },
152
+ "interval": {
153
+ "type": "integer",
154
+ "minimum": 1,
155
+ "maximum": 999
156
+ },
157
+ "count": {
158
+ "type": "integer",
159
+ "minimum": 1,
160
+ "maximum": 99999
161
+ },
162
+ "until": {
163
+ "type": "string",
164
+ "format": "date-time"
165
+ },
166
+ "byDay": {
167
+ "type": "array",
168
+ "uniqueItems": true,
169
+ "maxItems": 31,
170
+ "items": {
171
+ "type": "string",
172
+ "pattern": "^(?:[+-]?[1-5])?(?:MO|TU|WE|TH|FR|SA|SU)$"
173
+ }
174
+ },
175
+ "byMonthDay": {
176
+ "type": "array",
177
+ "uniqueItems": true,
178
+ "maxItems": 62,
179
+ "items": {
180
+ "type": "integer",
181
+ "minimum": -31,
182
+ "maximum": 31,
183
+ "not": {
184
+ "const": 0
185
+ }
186
+ }
187
+ }
188
+ },
189
+ "not": {
190
+ "required": [
191
+ "count",
192
+ "until"
193
+ ]
194
+ }
195
+ },
196
+ "organizer": {
197
+ "type": "object",
198
+ "required": [
199
+ "email"
200
+ ],
201
+ "additionalProperties": false,
202
+ "properties": {
203
+ "email": {
204
+ "type": "string",
205
+ "format": "email",
206
+ "maxLength": 1024
207
+ },
208
+ "name": {
209
+ "type": "string",
210
+ "maxLength": 1024
211
+ },
212
+ "role": {
213
+ "enum": [
214
+ "chair",
215
+ "required",
216
+ "optional",
217
+ "non-participant"
218
+ ]
219
+ },
220
+ "status": {
221
+ "enum": [
222
+ "needs-action",
223
+ "accepted",
224
+ "declined",
225
+ "tentative",
226
+ "delegated"
227
+ ]
228
+ },
229
+ "rsvp": {
230
+ "type": "boolean"
231
+ }
232
+ }
233
+ },
234
+ "attendees": {
235
+ "type": "array",
236
+ "maxItems": 1000,
237
+ "items": {
238
+ "type": "object",
239
+ "required": [
240
+ "email"
241
+ ],
242
+ "additionalProperties": false,
243
+ "properties": {
244
+ "email": {
245
+ "type": "string",
246
+ "format": "email",
247
+ "maxLength": 1024
248
+ },
249
+ "name": {
250
+ "type": "string",
251
+ "maxLength": 1024
252
+ },
253
+ "role": {
254
+ "enum": [
255
+ "chair",
256
+ "required",
257
+ "optional",
258
+ "non-participant"
259
+ ]
260
+ },
261
+ "status": {
262
+ "enum": [
263
+ "needs-action",
264
+ "accepted",
265
+ "declined",
266
+ "tentative",
267
+ "delegated"
268
+ ]
269
+ },
270
+ "rsvp": {
271
+ "type": "boolean"
272
+ }
273
+ }
274
+ }
275
+ },
276
+ "reminders": {
277
+ "type": "array",
278
+ "maxItems": 100,
279
+ "items": {
280
+ "type": "object",
281
+ "required": [
282
+ "trigger"
283
+ ],
284
+ "additionalProperties": false,
285
+ "properties": {
286
+ "trigger": {
287
+ "type": "string",
288
+ "minLength": 2,
289
+ "maxLength": 64
290
+ },
291
+ "action": {
292
+ "enum": [
293
+ "display",
294
+ "email"
295
+ ]
296
+ },
297
+ "description": {
298
+ "type": "string",
299
+ "maxLength": 4096
300
+ },
301
+ "recipients": {
302
+ "type": "array",
303
+ "minItems": 1,
304
+ "maxItems": 100,
305
+ "items": {
306
+ "type": "string",
307
+ "format": "email"
308
+ }
309
+ }
310
+ }
311
+ }
312
+ },
313
+ "attachments": {
314
+ "type": "array",
315
+ "maxItems": 100,
316
+ "items": {
317
+ "type": "object",
318
+ "additionalProperties": false,
319
+ "properties": {
320
+ "url": {
321
+ "type": "string",
322
+ "format": "uri",
323
+ "maxLength": 4096
324
+ },
325
+ "data": {
326
+ "type": "string",
327
+ "maxLength": 1048576
328
+ },
329
+ "mediaType": {
330
+ "type": "string",
331
+ "maxLength": 255
332
+ },
333
+ "filename": {
334
+ "type": "string",
335
+ "maxLength": 1024
336
+ }
337
+ },
338
+ "oneOf": [
339
+ {
340
+ "required": [
341
+ "url"
342
+ ]
343
+ },
344
+ {
345
+ "required": [
346
+ "data"
347
+ ]
348
+ }
349
+ ]
350
+ }
351
+ },
352
+ "updateSupported": {
353
+ "type": "boolean"
354
+ },
355
+ "type": {
356
+ "enum": [
357
+ "event"
358
+ ]
359
+ },
360
+ "startTime": {
361
+ "type": "string",
362
+ "minLength": 10,
363
+ "maxLength": 64
364
+ },
365
+ "endTime": {
366
+ "type": "string",
367
+ "minLength": 10,
368
+ "maxLength": 64
369
+ },
370
+ "allDay": {
371
+ "type": "boolean",
372
+ "default": false
373
+ }
374
+ }
375
+ },
376
+ {
377
+ "type": "object",
378
+ "required": [
379
+ "type",
380
+ "name"
381
+ ],
382
+ "additionalProperties": false,
383
+ "properties": {
384
+ "id": {
385
+ "type": "string",
386
+ "format": "uri",
387
+ "maxLength": 4096
388
+ },
389
+ "etag": {
390
+ "type": "string",
391
+ "minLength": 1,
392
+ "maxLength": 1024
393
+ },
394
+ "uid": {
395
+ "type": "string",
396
+ "minLength": 1,
397
+ "maxLength": 255
398
+ },
399
+ "sequence": {
400
+ "type": "integer",
401
+ "minimum": 0,
402
+ "maximum": 2147483647
403
+ },
404
+ "name": {
405
+ "type": "string",
406
+ "minLength": 1,
407
+ "maxLength": 4096
408
+ },
409
+ "content": {
410
+ "type": "string",
411
+ "maxLength": 65536
412
+ },
413
+ "location": {
414
+ "type": "string",
415
+ "maxLength": 4096
416
+ },
417
+ "url": {
418
+ "type": "string",
419
+ "format": "uri",
420
+ "maxLength": 4096
421
+ },
422
+ "timeZone": {
423
+ "type": "string",
424
+ "minLength": 1,
425
+ "maxLength": 255
426
+ },
427
+ "recurrence": {
428
+ "type": "object",
429
+ "required": [
430
+ "frequency"
431
+ ],
432
+ "additionalProperties": false,
433
+ "properties": {
434
+ "frequency": {
435
+ "enum": [
436
+ "daily",
437
+ "weekly",
438
+ "monthly",
439
+ "yearly"
440
+ ]
441
+ },
442
+ "interval": {
443
+ "type": "integer",
444
+ "minimum": 1,
445
+ "maximum": 999
446
+ },
447
+ "count": {
448
+ "type": "integer",
449
+ "minimum": 1,
450
+ "maximum": 99999
451
+ },
452
+ "until": {
453
+ "type": "string",
454
+ "format": "date-time"
455
+ },
456
+ "byDay": {
457
+ "type": "array",
458
+ "uniqueItems": true,
459
+ "maxItems": 31,
460
+ "items": {
461
+ "type": "string",
462
+ "pattern": "^(?:[+-]?[1-5])?(?:MO|TU|WE|TH|FR|SA|SU)$"
463
+ }
464
+ },
465
+ "byMonthDay": {
466
+ "type": "array",
467
+ "uniqueItems": true,
468
+ "maxItems": 62,
469
+ "items": {
470
+ "type": "integer",
471
+ "minimum": -31,
472
+ "maximum": 31,
473
+ "not": {
474
+ "const": 0
475
+ }
476
+ }
477
+ }
478
+ },
479
+ "not": {
480
+ "required": [
481
+ "count",
482
+ "until"
483
+ ]
484
+ }
485
+ },
486
+ "organizer": {
487
+ "type": "object",
488
+ "required": [
489
+ "email"
490
+ ],
491
+ "additionalProperties": false,
492
+ "properties": {
493
+ "email": {
494
+ "type": "string",
495
+ "format": "email",
496
+ "maxLength": 1024
497
+ },
498
+ "name": {
499
+ "type": "string",
500
+ "maxLength": 1024
501
+ },
502
+ "role": {
503
+ "enum": [
504
+ "chair",
505
+ "required",
506
+ "optional",
507
+ "non-participant"
508
+ ]
509
+ },
510
+ "status": {
511
+ "enum": [
512
+ "needs-action",
513
+ "accepted",
514
+ "declined",
515
+ "tentative",
516
+ "delegated"
517
+ ]
518
+ },
519
+ "rsvp": {
520
+ "type": "boolean"
521
+ }
522
+ }
523
+ },
524
+ "attendees": {
525
+ "type": "array",
526
+ "maxItems": 1000,
527
+ "items": {
528
+ "type": "object",
529
+ "required": [
530
+ "email"
531
+ ],
532
+ "additionalProperties": false,
533
+ "properties": {
534
+ "email": {
535
+ "type": "string",
536
+ "format": "email",
537
+ "maxLength": 1024
538
+ },
539
+ "name": {
540
+ "type": "string",
541
+ "maxLength": 1024
542
+ },
543
+ "role": {
544
+ "enum": [
545
+ "chair",
546
+ "required",
547
+ "optional",
548
+ "non-participant"
549
+ ]
550
+ },
551
+ "status": {
552
+ "enum": [
553
+ "needs-action",
554
+ "accepted",
555
+ "declined",
556
+ "tentative",
557
+ "delegated"
558
+ ]
559
+ },
560
+ "rsvp": {
561
+ "type": "boolean"
562
+ }
563
+ }
564
+ }
565
+ },
566
+ "reminders": {
567
+ "type": "array",
568
+ "maxItems": 100,
569
+ "items": {
570
+ "type": "object",
571
+ "required": [
572
+ "trigger"
573
+ ],
574
+ "additionalProperties": false,
575
+ "properties": {
576
+ "trigger": {
577
+ "type": "string",
578
+ "minLength": 2,
579
+ "maxLength": 64
580
+ },
581
+ "action": {
582
+ "enum": [
583
+ "display",
584
+ "email"
585
+ ]
586
+ },
587
+ "description": {
588
+ "type": "string",
589
+ "maxLength": 4096
590
+ },
591
+ "recipients": {
592
+ "type": "array",
593
+ "minItems": 1,
594
+ "maxItems": 100,
595
+ "items": {
596
+ "type": "string",
597
+ "format": "email"
598
+ }
599
+ }
600
+ }
601
+ }
602
+ },
603
+ "attachments": {
604
+ "type": "array",
605
+ "maxItems": 100,
606
+ "items": {
607
+ "type": "object",
608
+ "additionalProperties": false,
609
+ "properties": {
610
+ "url": {
611
+ "type": "string",
612
+ "format": "uri",
613
+ "maxLength": 4096
614
+ },
615
+ "data": {
616
+ "type": "string",
617
+ "maxLength": 1048576
618
+ },
619
+ "mediaType": {
620
+ "type": "string",
621
+ "maxLength": 255
622
+ },
623
+ "filename": {
624
+ "type": "string",
625
+ "maxLength": 1024
626
+ }
627
+ },
628
+ "oneOf": [
629
+ {
630
+ "required": [
631
+ "url"
632
+ ]
633
+ },
634
+ {
635
+ "required": [
636
+ "data"
637
+ ]
638
+ }
639
+ ]
640
+ }
641
+ },
642
+ "updateSupported": {
643
+ "type": "boolean"
644
+ },
645
+ "type": {
646
+ "enum": [
647
+ "task"
648
+ ]
649
+ },
650
+ "startTime": {
651
+ "type": "string",
652
+ "minLength": 10,
653
+ "maxLength": 64
654
+ },
655
+ "due": {
656
+ "type": "string",
657
+ "minLength": 10,
658
+ "maxLength": 64
659
+ },
660
+ "allDay": {
661
+ "type": "boolean",
662
+ "default": false
663
+ },
664
+ "status": {
665
+ "enum": [
666
+ "needs-action",
667
+ "in-process",
668
+ "completed",
669
+ "cancelled"
670
+ ]
671
+ },
672
+ "completedTime": {
673
+ "type": "string",
674
+ "format": "date-time"
675
+ },
676
+ "percentComplete": {
677
+ "type": "integer",
678
+ "minimum": 0,
679
+ "maximum": 100
680
+ }
681
+ },
682
+ "allOf": [
683
+ {
684
+ "if": {
685
+ "properties": {
686
+ "status": {
687
+ "const": "completed"
688
+ }
689
+ },
690
+ "required": [
691
+ "status"
692
+ ]
693
+ },
694
+ "then": {
695
+ "required": [
696
+ "completedTime"
697
+ ]
698
+ }
699
+ },
700
+ {
701
+ "if": {
702
+ "required": [
703
+ "completedTime"
704
+ ]
705
+ },
706
+ "then": {
707
+ "properties": {
708
+ "status": {
709
+ "const": "completed"
710
+ }
711
+ },
712
+ "required": [
713
+ "status"
714
+ ]
715
+ }
716
+ }
717
+ ]
718
+ },
719
+ {
720
+ "type": "object",
721
+ "required": [
722
+ "id",
723
+ "type",
724
+ "etag"
725
+ ],
726
+ "additionalProperties": false,
727
+ "properties": {
728
+ "id": {
729
+ "type": "string",
730
+ "format": "uri",
731
+ "maxLength": 4096
732
+ },
733
+ "type": {
734
+ "enum": [
735
+ "event",
736
+ "task"
737
+ ]
738
+ },
739
+ "etag": {
740
+ "type": "string",
741
+ "minLength": 1,
742
+ "maxLength": 1024
743
+ }
744
+ }
745
+ },
746
+ {
747
+ "type": "object",
748
+ "additionalProperties": false,
749
+ "properties": {
750
+ "type": {
751
+ "enum": [
752
+ "event",
753
+ "task"
754
+ ]
755
+ },
756
+ "startTime": {
757
+ "type": "string",
758
+ "format": "date-time"
759
+ },
760
+ "endTime": {
761
+ "type": "string",
762
+ "format": "date-time"
763
+ }
764
+ }
765
+ }
766
+ ]
767
+ }
768
+ }
769
+ }