@sockethub/schemas 3.0.0-alpha.12 → 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 (46) 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 +20 -41
  6. package/dist/context.js.map +3 -3
  7. package/dist/helpers/error-parser.d.ts +13 -0
  8. package/dist/helpers/objects.d.ts +122 -0
  9. package/dist/index.d.ts +9 -0
  10. package/dist/index.js +180 -218
  11. package/dist/index.js.map +12 -12
  12. package/dist/maps/context-map.json +2 -2
  13. package/dist/object-types.d.ts +2 -0
  14. package/dist/object-types.js +296 -0
  15. package/dist/object-types.js.map +12 -0
  16. package/dist/schemas/activity-stream.d.ts +161 -0
  17. package/dist/schemas/platform/feeds/v1/messages.schema.json +8 -17
  18. package/dist/schemas/platform/irc/v1/credentials.schema.json +71 -1
  19. package/dist/schemas/platform/irc/v1/messages.schema.json +84 -0
  20. package/dist/schemas/platform/metadata/v1/messages.schema.json +1 -16
  21. package/dist/schemas/platform/xmpp/v1/credentials.schema.json +2 -2
  22. package/dist/schemas/platform/xmpp/v1/messages.schema.json +108 -0
  23. package/dist/schemas/platform.d.ts +62 -0
  24. package/dist/schemas/sockethub-config.d.ts +261 -0
  25. package/{src/types.ts → dist/types.d.ts} +17 -45
  26. package/dist/validator.d.ts +26 -0
  27. package/package.json +13 -8
  28. package/src/context.ts +0 -125
  29. package/src/helpers/error-parser.ts +0 -160
  30. package/src/helpers/objects.ts +0 -283
  31. package/src/index.test.data.credentials.ts +0 -103
  32. package/src/index.test.data.objects.ts +0 -241
  33. package/src/index.test.data.platform.ts +0 -48
  34. package/src/index.test.data.streams.ts +0 -590
  35. package/src/index.test.ts +0 -127
  36. package/src/index.ts +0 -56
  37. package/src/schemas/activity-object.ts +0 -19
  38. package/src/schemas/activity-stream.ts +0 -75
  39. package/src/schemas/json/activity-object.json +0 -405
  40. package/src/schemas/json/activity-stream.json +0 -502
  41. package/src/schemas/json/platform.json +0 -48
  42. package/src/schemas/json/sockethub-config.json +0 -236
  43. package/src/schemas/platform.ts +0 -71
  44. package/src/schemas/sockethub-config.ts +0 -220
  45. package/src/types/ajv-formats-draft2019.d.ts +0 -5
  46. package/src/validator.ts +0 -207
@@ -14,6 +14,90 @@
14
14
  "announce",
15
15
  "disconnect"
16
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
+ }
17
101
  }
18
102
  }
19
103
  }
@@ -9,21 +9,6 @@
9
9
  "fetch"
10
10
  ]
11
11
  },
12
- "object": {
13
- "type": "object",
14
- "oneOf": [
15
- {
16
- "$ref": "#/definitions/objectTypes/feed-parameters-url"
17
- }
18
- ]
19
- }
20
- },
21
- "definitions": {
22
- "objectTypes": {
23
- "feed-parameters-url": {
24
- "type": "object",
25
- "additionalProperties": true
26
- }
27
- }
12
+ "object": false
28
13
  }
29
14
  }
@@ -14,8 +14,8 @@
14
14
  "required": [
15
15
  "type",
16
16
  "userAddress",
17
- "password",
18
- "resource"
17
+ "resource",
18
+ "password"
19
19
  ],
20
20
  "additionalProperties": false,
21
21
  "properties": {
@@ -16,6 +16,114 @@
16
16
  "query",
17
17
  "disconnect"
18
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
+ }
19
127
  }
20
128
  }
21
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
+ };
@@ -0,0 +1,261 @@
1
+ export declare const SockethubConfigSchema: {
2
+ $id: string;
3
+ description: string;
4
+ type: string;
5
+ required: string[];
6
+ additionalProperties: boolean;
7
+ properties: {
8
+ $schema: {
9
+ type: string;
10
+ };
11
+ examples: {
12
+ type: string;
13
+ default: boolean;
14
+ };
15
+ info: {
16
+ type: string;
17
+ default: boolean;
18
+ };
19
+ logging: {
20
+ type: string;
21
+ additionalProperties: boolean;
22
+ properties: {
23
+ level: {
24
+ type: string;
25
+ enum: string[];
26
+ default: string;
27
+ };
28
+ fileLevel: {
29
+ type: string;
30
+ enum: string[];
31
+ default: string;
32
+ };
33
+ file: {
34
+ type: string;
35
+ default: string;
36
+ };
37
+ };
38
+ };
39
+ platforms: {
40
+ type: string;
41
+ items: {
42
+ type: string;
43
+ };
44
+ default: string[];
45
+ };
46
+ packageConfig: {
47
+ type: string;
48
+ properties: {
49
+ "@sockethub/platform-dummy": {
50
+ type: string;
51
+ additionalProperties: boolean;
52
+ properties: {
53
+ greeting: {
54
+ type: string;
55
+ default: string;
56
+ };
57
+ };
58
+ };
59
+ "@sockethub/platform-feeds": {
60
+ type: string;
61
+ additionalProperties: boolean;
62
+ properties: {
63
+ connectTimeoutMs: {
64
+ type: string;
65
+ };
66
+ allowPrivateAddresses: {
67
+ type: string;
68
+ };
69
+ concurrency: {
70
+ type: string;
71
+ minimum: number;
72
+ };
73
+ };
74
+ };
75
+ "@sockethub/platform-irc": {
76
+ type: string;
77
+ additionalProperties: boolean;
78
+ properties: {
79
+ connectTimeoutMs: {
80
+ type: string;
81
+ };
82
+ };
83
+ };
84
+ "@sockethub/platform-xmpp": {
85
+ type: string;
86
+ additionalProperties: boolean;
87
+ properties: {
88
+ connectTimeoutMs: {
89
+ type: string;
90
+ };
91
+ };
92
+ };
93
+ "@sockethub/platform-metadata": {
94
+ type: string;
95
+ additionalProperties: boolean;
96
+ properties: {
97
+ allowPrivateAddresses: {
98
+ type: string;
99
+ };
100
+ concurrency: {
101
+ type: string;
102
+ minimum: number;
103
+ };
104
+ };
105
+ };
106
+ };
107
+ };
108
+ credentialCheck: {
109
+ type: string;
110
+ additionalProperties: boolean;
111
+ properties: {
112
+ reconnectIpSource: {
113
+ type: string;
114
+ enum: string[];
115
+ default: string;
116
+ };
117
+ proxyHeader: {
118
+ type: string;
119
+ default: string;
120
+ };
121
+ };
122
+ };
123
+ public: {
124
+ type: string;
125
+ additionalProperties: boolean;
126
+ properties: {
127
+ protocol: {
128
+ type: string;
129
+ default: string;
130
+ };
131
+ host: {
132
+ type: string;
133
+ default: string;
134
+ };
135
+ port: {
136
+ type: string;
137
+ default: number;
138
+ };
139
+ path: {
140
+ type: string;
141
+ default: string;
142
+ };
143
+ };
144
+ };
145
+ rateLimiter: {
146
+ type: string;
147
+ additionalProperties: boolean;
148
+ properties: {
149
+ windowMs: {
150
+ type: string;
151
+ default: number;
152
+ };
153
+ maxRequests: {
154
+ type: string;
155
+ default: number;
156
+ };
157
+ blockDurationMs: {
158
+ type: string;
159
+ default: number;
160
+ };
161
+ maxConnectionsPerIp: {
162
+ type: string;
163
+ minimum: number;
164
+ default: number;
165
+ };
166
+ };
167
+ };
168
+ limits: {
169
+ type: string;
170
+ additionalProperties: boolean;
171
+ properties: {
172
+ maxPlatformInstances: {
173
+ type: string;
174
+ minimum: number;
175
+ default: number;
176
+ };
177
+ };
178
+ };
179
+ redis: {
180
+ type: string;
181
+ additionalProperties: boolean;
182
+ properties: {
183
+ url: {
184
+ type: string;
185
+ default: string;
186
+ };
187
+ connectTimeout: {
188
+ type: string;
189
+ default: number;
190
+ description: string;
191
+ };
192
+ disconnectTimeout: {
193
+ type: string;
194
+ default: number;
195
+ description: string;
196
+ };
197
+ maxRetriesPerRequest: {
198
+ type: string[];
199
+ default: number | null;
200
+ description: string;
201
+ };
202
+ };
203
+ };
204
+ sentry: {
205
+ type: string;
206
+ additionalProperties: boolean;
207
+ properties: {
208
+ dsn: {
209
+ type: string;
210
+ default: string;
211
+ };
212
+ traceSampleRate: {
213
+ type: string;
214
+ default: number;
215
+ };
216
+ };
217
+ };
218
+ sockethub: {
219
+ type: string;
220
+ additionalProperties: boolean;
221
+ properties: {
222
+ port: {
223
+ type: string;
224
+ default: number;
225
+ };
226
+ host: {
227
+ type: string;
228
+ default: string;
229
+ };
230
+ path: {
231
+ type: string;
232
+ default: string;
233
+ };
234
+ cors: {
235
+ type: string;
236
+ additionalProperties: boolean;
237
+ properties: {
238
+ origin: {
239
+ type: string;
240
+ default: string;
241
+ };
242
+ };
243
+ };
244
+ };
245
+ };
246
+ platformHeartbeat: {
247
+ type: string;
248
+ additionalProperties: boolean;
249
+ properties: {
250
+ intervalMs: {
251
+ type: string;
252
+ default: number;
253
+ };
254
+ timeoutMs: {
255
+ type: string;
256
+ default: number;
257
+ };
258
+ };
259
+ };
260
+ };
261
+ };