@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
@@ -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
+ }
@@ -0,0 +1,103 @@
1
+ {
2
+ "required": [
3
+ "type"
4
+ ],
5
+ "properties": {
6
+ "type": {
7
+ "enum": [
8
+ "connect",
9
+ "update",
10
+ "join",
11
+ "leave",
12
+ "send",
13
+ "query",
14
+ "announce",
15
+ "disconnect"
16
+ ]
17
+ },
18
+ "object": {
19
+ "oneOf": [
20
+ {
21
+ "$ref": "#/definitions/objectTypes/message"
22
+ },
23
+ {
24
+ "$ref": "#/definitions/objectTypes/topic"
25
+ },
26
+ {
27
+ "$ref": "#/definitions/objectTypes/address"
28
+ },
29
+ {
30
+ "$ref": "#/definitions/objectTypes/attendance"
31
+ }
32
+ ]
33
+ }
34
+ },
35
+ "definitions": {
36
+ "objectTypes": {
37
+ "message": {
38
+ "type": "object",
39
+ "required": [
40
+ "type",
41
+ "content"
42
+ ],
43
+ "additionalProperties": false,
44
+ "properties": {
45
+ "type": {
46
+ "enum": [
47
+ "message"
48
+ ]
49
+ },
50
+ "content": {
51
+ "type": "string"
52
+ }
53
+ }
54
+ },
55
+ "topic": {
56
+ "type": "object",
57
+ "required": [
58
+ "type",
59
+ "content"
60
+ ],
61
+ "additionalProperties": false,
62
+ "properties": {
63
+ "type": {
64
+ "enum": [
65
+ "topic"
66
+ ]
67
+ },
68
+ "content": {
69
+ "type": "string"
70
+ }
71
+ }
72
+ },
73
+ "address": {
74
+ "type": "object",
75
+ "required": [
76
+ "type"
77
+ ],
78
+ "additionalProperties": false,
79
+ "properties": {
80
+ "type": {
81
+ "enum": [
82
+ "address"
83
+ ]
84
+ }
85
+ }
86
+ },
87
+ "attendance": {
88
+ "type": "object",
89
+ "required": [
90
+ "type"
91
+ ],
92
+ "additionalProperties": false,
93
+ "properties": {
94
+ "type": {
95
+ "enum": [
96
+ "attendance"
97
+ ]
98
+ }
99
+ }
100
+ }
101
+ }
102
+ }
103
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "required": [
3
+ "type"
4
+ ],
5
+ "properties": {
6
+ "type": {
7
+ "type": "string",
8
+ "enum": [
9
+ "fetch"
10
+ ]
11
+ },
12
+ "object": false
13
+ }
14
+ }
@@ -0,0 +1,43 @@
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
+ "userAddress",
17
+ "resource",
18
+ "password"
19
+ ],
20
+ "additionalProperties": false,
21
+ "properties": {
22
+ "type": {
23
+ "type": "string"
24
+ },
25
+ "userAddress": {
26
+ "type": "string"
27
+ },
28
+ "password": {
29
+ "type": "string"
30
+ },
31
+ "server": {
32
+ "type": "string"
33
+ },
34
+ "port": {
35
+ "type": "number"
36
+ },
37
+ "resource": {
38
+ "type": "string"
39
+ }
40
+ }
41
+ }
42
+ }
43
+ }
@@ -0,0 +1,129 @@
1
+ {
2
+ "required": [
3
+ "type"
4
+ ],
5
+ "properties": {
6
+ "type": {
7
+ "enum": [
8
+ "connect",
9
+ "join",
10
+ "leave",
11
+ "send",
12
+ "update",
13
+ "request-friend",
14
+ "remove-friend",
15
+ "make-friend",
16
+ "query",
17
+ "disconnect"
18
+ ]
19
+ },
20
+ "object": {
21
+ "oneOf": [
22
+ {
23
+ "$ref": "#/definitions/objectTypes/message"
24
+ },
25
+ {
26
+ "$ref": "#/definitions/objectTypes/presence"
27
+ },
28
+ {
29
+ "$ref": "#/definitions/objectTypes/attendance"
30
+ },
31
+ {
32
+ "$ref": "#/definitions/objectTypes/room-info"
33
+ }
34
+ ]
35
+ }
36
+ },
37
+ "definitions": {
38
+ "objectTypes": {
39
+ "message": {
40
+ "type": "object",
41
+ "required": [
42
+ "type",
43
+ "content"
44
+ ],
45
+ "additionalProperties": false,
46
+ "properties": {
47
+ "type": {
48
+ "enum": [
49
+ "message"
50
+ ]
51
+ },
52
+ "id": {
53
+ "type": "string"
54
+ },
55
+ "content": {
56
+ "type": "string"
57
+ },
58
+ "xmpp:replace": {
59
+ "type": "object",
60
+ "required": [
61
+ "id"
62
+ ],
63
+ "additionalProperties": false,
64
+ "properties": {
65
+ "id": {
66
+ "type": "string"
67
+ }
68
+ }
69
+ }
70
+ }
71
+ },
72
+ "presence": {
73
+ "type": "object",
74
+ "required": [
75
+ "type"
76
+ ],
77
+ "additionalProperties": false,
78
+ "properties": {
79
+ "type": {
80
+ "enum": [
81
+ "presence"
82
+ ]
83
+ },
84
+ "presence": {
85
+ "enum": [
86
+ "away",
87
+ "chat",
88
+ "dnd",
89
+ "xa",
90
+ "offline",
91
+ "online"
92
+ ]
93
+ },
94
+ "content": {
95
+ "type": "string"
96
+ }
97
+ }
98
+ },
99
+ "attendance": {
100
+ "type": "object",
101
+ "required": [
102
+ "type"
103
+ ],
104
+ "additionalProperties": false,
105
+ "properties": {
106
+ "type": {
107
+ "enum": [
108
+ "attendance"
109
+ ]
110
+ }
111
+ }
112
+ },
113
+ "room-info": {
114
+ "type": "object",
115
+ "required": [
116
+ "type"
117
+ ],
118
+ "additionalProperties": false,
119
+ "properties": {
120
+ "type": {
121
+ "enum": [
122
+ "room-info"
123
+ ]
124
+ }
125
+ }
126
+ }
127
+ }
128
+ }
129
+ }
@@ -0,0 +1,62 @@
1
+ /**
2
+ * This file is part of Sockethub.
3
+ *
4
+ * Developed by Nick Jennings (https://github.com/silverbucket)
5
+ *
6
+ * server is licensed under the LGPL.
7
+ * See the LICENSE file for details.
8
+ *
9
+ * The latest version of server can be found here:
10
+ * git://github.com/sockethub/sockethub.git
11
+ *
12
+ * For more information about Sockethub visit https://sockethub.org/.
13
+ *
14
+ * This program is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17
+ */
18
+ export declare const PlatformSchema: {
19
+ $id: string;
20
+ type: string;
21
+ required: string[];
22
+ additionalProperties: boolean;
23
+ properties: {
24
+ contextUrl: {
25
+ title: string;
26
+ type: string;
27
+ format: string;
28
+ };
29
+ contextVersion: {
30
+ title: string;
31
+ type: string;
32
+ };
33
+ schemaVersion: {
34
+ title: string;
35
+ type: string;
36
+ };
37
+ messageConstraints: {
38
+ title: string;
39
+ type: string;
40
+ };
41
+ credentials: {
42
+ title: string;
43
+ type: string;
44
+ };
45
+ messages: {
46
+ title: string;
47
+ type: string;
48
+ };
49
+ responses: {
50
+ title: string;
51
+ type: string;
52
+ };
53
+ name: {
54
+ title: string;
55
+ type: string;
56
+ };
57
+ version: {
58
+ title: string;
59
+ type: string;
60
+ };
61
+ };
62
+ };