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