@sockethub/schemas 3.0.0-alpha.4 → 3.0.0-alpha.5

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 (43) hide show
  1. package/package.json +16 -32
  2. package/src/index.ts +23 -19
  3. package/src/schemas/activity-object.ts +15 -15
  4. package/src/schemas/activity-stream.ts +40 -41
  5. package/{dist → src}/schemas/json/activity-object.json +1 -1
  6. package/{dist → src}/schemas/json/activity-stream.json +1 -1
  7. package/{dist → src}/schemas/json/platform.json +1 -0
  8. package/src/schemas/json/sockethub-config.json +144 -0
  9. package/src/schemas/platform.ts +22 -22
  10. package/src/schemas/sockethub-config.ts +140 -0
  11. package/dist/helpers/error-parser.d.ts +0 -9
  12. package/dist/helpers/error-parser.js +0 -90
  13. package/dist/helpers/objects.d.ts +0 -206
  14. package/dist/helpers/objects.js +0 -217
  15. package/dist/index.d.ts +0 -15
  16. package/dist/index.js +0 -37
  17. package/dist/index.test.data.credentials.d.ts +0 -37
  18. package/dist/index.test.data.credentials.js +0 -69
  19. package/dist/index.test.data.objects.d.ts +0 -50
  20. package/dist/index.test.data.objects.js +0 -214
  21. package/dist/index.test.data.platform.d.ts +0 -44
  22. package/dist/index.test.data.platform.js +0 -47
  23. package/dist/index.test.data.streams.d.ts +0 -274
  24. package/dist/index.test.data.streams.js +0 -473
  25. package/dist/schemas/activity-object.d.ts +0 -16
  26. package/dist/schemas/activity-object.js +0 -18
  27. package/dist/schemas/activity-stream.d.ts +0 -239
  28. package/dist/schemas/activity-stream.js +0 -53
  29. package/dist/schemas/platform.d.ts +0 -41
  30. package/dist/schemas/platform.js +0 -44
  31. package/dist/types.d.ts +0 -34
  32. package/dist/types.js +0 -2
  33. package/dist/validator.d.ts +0 -8
  34. package/dist/validator.js +0 -80
  35. package/src/helpers/error-parser.ts +0 -96
  36. package/src/helpers/objects.ts +0 -230
  37. package/src/index.test.data.credentials.ts +0 -71
  38. package/src/index.test.data.objects.ts +0 -235
  39. package/src/index.test.data.platform.ts +0 -45
  40. package/src/index.test.data.streams.ts +0 -495
  41. package/src/index.test.ts +0 -85
  42. package/src/types.ts +0 -42
  43. package/src/validator.ts +0 -81
@@ -1,50 +0,0 @@
1
- declare const _default: ((string | boolean | {
2
- id: string;
3
- type: string;
4
- name: string;
5
- })[] | (string | boolean | {
6
- type: string;
7
- })[] | (string | boolean | {
8
- type: string;
9
- user: string;
10
- pass: string;
11
- })[] | (string | boolean | {
12
- type: string;
13
- name: string;
14
- })[] | (string | boolean | {
15
- id: string;
16
- type: string;
17
- })[] | (string | boolean | {
18
- id: string;
19
- type: string;
20
- content: string;
21
- })[] | (string | boolean | {
22
- type: string;
23
- members: string[];
24
- })[] | (string | boolean | {
25
- type: string;
26
- status: string;
27
- })[] | (string | boolean | {
28
- type: string;
29
- presence: string;
30
- content: string;
31
- })[] | (string | boolean | {
32
- type: string;
33
- content: string;
34
- })[] | (string | boolean | {
35
- type: string;
36
- topic: string;
37
- })[] | (string | boolean | {
38
- type: string;
39
- relationship: string;
40
- subject: {
41
- type: string;
42
- role: string;
43
- };
44
- object: {
45
- type: string;
46
- id: string;
47
- name: string;
48
- };
49
- })[])[];
50
- export default _default;
@@ -1,214 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const objects_1 = require("./helpers/objects");
4
- exports.default = [
5
- [
6
- 'room object',
7
- {
8
- id: 'irc.freenode.net/server',
9
- type: 'room',
10
- name: 'sockethub'
11
- },
12
- true,
13
- ``
14
- ],
15
- [
16
- 'credentials with no props',
17
- {
18
- type: 'credentials'
19
- },
20
- false,
21
- `/object: must match exactly one schema in oneOf: ${objects_1.ObjectTypesList.join(', ')}`
22
- ],
23
- [
24
- 'credentials with props',
25
- {
26
- type: 'credentials',
27
- user: "foo",
28
- pass: "bar"
29
- },
30
- false,
31
- `/object: must match exactly one schema in oneOf: ${objects_1.ObjectTypesList.join(', ')}`
32
- ],
33
- [
34
- 'bad target',
35
- {
36
- type: 'person',
37
- name: 'bob'
38
- },
39
- false,
40
- '/object: must have required property \'id\''
41
- ],
42
- [
43
- 'bad iri in object id',
44
- {
45
- id: 'example.org/some/path.html',
46
- type: 'website'
47
- },
48
- false,
49
- '/object/id: must match format "iri"'
50
- ],
51
- [
52
- 'valid iri in object id',
53
- {
54
- id: 'https://example.org/some/path.html',
55
- type: 'website'
56
- },
57
- true,
58
- ''
59
- ],
60
- [
61
- 'wrong actor type',
62
- {
63
- id: 'doobar@freenode.net/channel',
64
- type: 'foo',
65
- content: 'hi there'
66
- },
67
- false,
68
- `/object: must match exactly one schema in oneOf: ${objects_1.ObjectTypesList.join(', ')}`
69
- ],
70
- [
71
- 'missing actor id',
72
- {
73
- type: 'person',
74
- name: 'dood'
75
- },
76
- false,
77
- '/object: must have required property \'id\''
78
- ],
79
- [
80
- 'attendance request',
81
- {
82
- type: 'attendance',
83
- },
84
- true,
85
- ''
86
- ],
87
- [
88
- 'attendance response',
89
- {
90
- type: 'attendance',
91
- members: ['bill', 'bob', 'hank']
92
- },
93
- true,
94
- ''
95
- ],
96
- [
97
- 'invalid attendance request',
98
- {
99
- type: 'attendance',
100
- status: 'foobar'
101
- },
102
- false,
103
- '/object: must NOT have additional properties: status'
104
- ],
105
- [
106
- 'setting presence',
107
- {
108
- type: 'presence',
109
- presence: 'away',
110
- content: 'forgot the milk'
111
- },
112
- true,
113
- ''
114
- ],
115
- [
116
- 'setting invalid presence',
117
- {
118
- type: 'presence',
119
- presence: 'afk',
120
- content: 'forgot the milk'
121
- },
122
- false,
123
- '/object/presence: must be equal to one of the allowed values: ' +
124
- 'away, chat, dnd, xa, offline, online'
125
- ],
126
- [
127
- 'setting topic',
128
- {
129
- type: 'topic',
130
- content: 'the topic is goats'
131
- },
132
- true,
133
- ''
134
- ],
135
- [
136
- 'setting topic incorrectly',
137
- {
138
- type: 'topic',
139
- topic: 'the topic is goats'
140
- },
141
- false,
142
- '/object: must NOT have additional properties: topic'
143
- ],
144
- [
145
- 'send message',
146
- {
147
- type: 'message',
148
- content: 'the message is goats'
149
- },
150
- true,
151
- ''
152
- ],
153
- [
154
- 'change user address',
155
- {
156
- type: 'address'
157
- },
158
- true,
159
- ''
160
- ],
161
- [
162
- 'change user address incorrectly',
163
- {
164
- type: 'address',
165
- id: 'futurebar@example.com',
166
- },
167
- false,
168
- '/object: must NOT have additional properties: id'
169
- ],
170
- [
171
- 'invalid room',
172
- {
173
- "type": "room",
174
- "name": "sh-9K3Vk"
175
- },
176
- false,
177
- '/object: must have required property \'id\''
178
- ],
179
- [
180
- 'relationship',
181
- {
182
- "type": "relationship",
183
- "relationship": "role",
184
- "subject": {
185
- "type": "presence",
186
- "role": "owner"
187
- },
188
- "object": {
189
- "type": "room",
190
- "id": "localhost/#Finnish",
191
- "name": "#Finnish"
192
- }
193
- },
194
- true, ""
195
- ],
196
- [
197
- 'invalid role in relationship',
198
- {
199
- "type": "relationship",
200
- "relationship": "role",
201
- "subject": {
202
- "type": "presence",
203
- "role": "manager"
204
- },
205
- "object": {
206
- "type": "room",
207
- "id": "localhost/#Finnish",
208
- "name": "#Finnish"
209
- }
210
- },
211
- false, "/object/subject/role: must be equal to one of the allowed values: " +
212
- "owner, member, participant, admin"
213
- ]
214
- ];
@@ -1,44 +0,0 @@
1
- declare const _default: {
2
- name: string;
3
- version: string;
4
- messages: {
5
- required: string[];
6
- properties: {
7
- type: {
8
- enum: string[];
9
- };
10
- };
11
- };
12
- credentials: {
13
- required: string[];
14
- properties: {
15
- actor: {
16
- type: string;
17
- required: string[];
18
- };
19
- object: {
20
- type: string;
21
- required: string[];
22
- additionalProperties: boolean;
23
- properties: {
24
- type: {
25
- type: string;
26
- };
27
- username: {
28
- type: string;
29
- };
30
- password: {
31
- type: string;
32
- };
33
- host: {
34
- type: string;
35
- };
36
- port: {
37
- type: string;
38
- };
39
- };
40
- };
41
- };
42
- };
43
- };
44
- export default _default;
@@ -1,47 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = {
4
- "name": "fake",
5
- "version": "1.0",
6
- "messages": {
7
- "required": ['type'],
8
- "properties": {
9
- "type": {
10
- "enum": ['connect', 'update', 'send', 'join', 'query', 'foo']
11
- }
12
- }
13
- },
14
- "credentials": {
15
- "required": ['object'],
16
- "properties": {
17
- // TODO platforms shouldn't have to define the actor property if
18
- // they don't want to, just credential specifics
19
- "actor": {
20
- "type": "object",
21
- "required": ["id"]
22
- },
23
- "object": {
24
- "type": "object",
25
- "required": ['type', 'username', 'password', 'host'],
26
- "additionalProperties": false,
27
- "properties": {
28
- "type": {
29
- "type": "string"
30
- },
31
- "username": {
32
- "type": "string"
33
- },
34
- "password": {
35
- "type": "string"
36
- },
37
- "host": {
38
- "type": "string"
39
- },
40
- "port": {
41
- "type": "number"
42
- }
43
- }
44
- }
45
- }
46
- }
47
- };
@@ -1,274 +0,0 @@
1
- declare const _default: ((string | boolean | {
2
- type: string;
3
- context: string;
4
- actor: {
5
- id: string;
6
- type: string;
7
- name: string;
8
- };
9
- target: {
10
- id: string;
11
- type: string;
12
- name: string;
13
- };
14
- object: {
15
- type: string;
16
- content: string;
17
- };
18
- })[] | (string | boolean | {
19
- type: string;
20
- context: string;
21
- published: string;
22
- actor: {
23
- id: string;
24
- type: string;
25
- name: string;
26
- };
27
- target: {
28
- id: string;
29
- type: string;
30
- name: string;
31
- };
32
- object: {
33
- type: string;
34
- content: string;
35
- };
36
- })[] | (string | boolean | {
37
- type: string;
38
- context: string;
39
- actor: {
40
- id: string;
41
- type: string;
42
- name: string;
43
- };
44
- target: {
45
- id: string;
46
- type: string;
47
- name: string;
48
- };
49
- object: {
50
- type: string;
51
- };
52
- })[] | (string | boolean | {
53
- context: string;
54
- type: string;
55
- actor: {
56
- id: string;
57
- type: string;
58
- name: string;
59
- };
60
- object: {
61
- type: string;
62
- user: string;
63
- pass: string;
64
- };
65
- })[] | (string | boolean | {
66
- id: string;
67
- type: string;
68
- context: string;
69
- actor: {
70
- id: string;
71
- type: string;
72
- name: string;
73
- };
74
- target: {
75
- type: string;
76
- name: string;
77
- };
78
- object: {
79
- type: string;
80
- };
81
- })[] | (string | boolean | {
82
- type: string;
83
- context: string;
84
- actor: {
85
- id: string;
86
- type: string;
87
- };
88
- object: {
89
- id: string;
90
- type: string;
91
- };
92
- })[] | (string | boolean | {
93
- type: string;
94
- context: string;
95
- actor: {
96
- id: string;
97
- type: string;
98
- content: string;
99
- };
100
- object: {
101
- type: string;
102
- id: string;
103
- };
104
- })[] | (string | boolean | {
105
- id: string;
106
- type: string;
107
- context: string;
108
- actor: {
109
- type: string;
110
- name: string;
111
- };
112
- target: {
113
- id: string;
114
- type: string;
115
- name: string;
116
- };
117
- object: {
118
- type: string;
119
- id: string;
120
- };
121
- })[] | (string | boolean | {
122
- id: string;
123
- type: string;
124
- context: string;
125
- actor: {
126
- id: string;
127
- type: string;
128
- };
129
- target: {
130
- id: string;
131
- type: string;
132
- };
133
- object: {
134
- type: string;
135
- };
136
- })[] | (string | boolean | {
137
- id: string;
138
- type: string;
139
- context: string;
140
- actor: {
141
- id: string;
142
- type: string;
143
- name: string;
144
- };
145
- object: {
146
- type: string;
147
- members: string[];
148
- };
149
- })[] | (string | boolean | {
150
- id: string;
151
- type: string;
152
- context: string;
153
- actor: {
154
- id: string;
155
- type: string;
156
- };
157
- target: {
158
- id: string;
159
- type: string;
160
- };
161
- object: {
162
- type: string;
163
- status: string;
164
- };
165
- })[] | (string | boolean | {
166
- id: string;
167
- type: string;
168
- context: string;
169
- actor: {
170
- id: string;
171
- type: string;
172
- };
173
- object: {
174
- type: string;
175
- presence: string;
176
- content: string;
177
- };
178
- target: {
179
- id: string;
180
- type: string;
181
- };
182
- })[] | (string | boolean | {
183
- id: string;
184
- type: string;
185
- context: string;
186
- actor: {
187
- id: string;
188
- type: string;
189
- };
190
- object: {
191
- type: string;
192
- content: string;
193
- };
194
- target: {
195
- id: string;
196
- type: string;
197
- };
198
- })[] | (string | boolean | {
199
- id: string;
200
- type: string;
201
- context: string;
202
- actor: {
203
- id: string;
204
- type: string;
205
- };
206
- object: {
207
- type: string;
208
- topic: string;
209
- };
210
- target: {
211
- id: string;
212
- type: string;
213
- };
214
- })[] | (string | boolean | {
215
- id: string;
216
- type: string;
217
- context: string;
218
- actor: {
219
- id: string;
220
- type: string;
221
- };
222
- object: {
223
- type: string;
224
- content: string;
225
- };
226
- })[] | (string | boolean | {
227
- actor: {
228
- id: string;
229
- type: string;
230
- };
231
- context: string;
232
- target: {
233
- id: string;
234
- type: string;
235
- };
236
- })[] | (string | boolean | {
237
- context: string;
238
- type: string;
239
- actor: {
240
- id: string;
241
- type: string;
242
- };
243
- target: {
244
- type: string;
245
- name: string;
246
- };
247
- })[] | (string | boolean | {
248
- context: string;
249
- type: string;
250
- actor: {
251
- type: string;
252
- id: string;
253
- name: string;
254
- };
255
- target: {
256
- type: string;
257
- id: string;
258
- name: string;
259
- };
260
- object: {
261
- type: string;
262
- relationship: string;
263
- subject: {
264
- type: string;
265
- role: string;
266
- };
267
- object: {
268
- type: string;
269
- id: string;
270
- name: string;
271
- };
272
- };
273
- })[])[];
274
- export default _default;