@sockethub/schemas 3.0.0-alpha.8 → 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,466 @@
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
+ description: string;
15
+ };
16
+ about: {
17
+ type: string;
18
+ additionalProperties: boolean;
19
+ description: string;
20
+ properties: {
21
+ name: {
22
+ type: string;
23
+ default: string;
24
+ description: string;
25
+ };
26
+ description: {
27
+ type: string;
28
+ default: string;
29
+ description: string;
30
+ };
31
+ contact: {
32
+ type: string;
33
+ default: string;
34
+ description: string;
35
+ };
36
+ links: {
37
+ type: string;
38
+ default: any[];
39
+ description: string;
40
+ items: {
41
+ type: string;
42
+ additionalProperties: boolean;
43
+ required: string[];
44
+ properties: {
45
+ label: {
46
+ type: string;
47
+ minLength: number;
48
+ };
49
+ url: {
50
+ type: string;
51
+ pattern: string;
52
+ };
53
+ };
54
+ };
55
+ };
56
+ showVersion: {
57
+ type: string;
58
+ default: boolean;
59
+ description: string;
60
+ };
61
+ showUptime: {
62
+ type: string;
63
+ default: boolean;
64
+ description: string;
65
+ };
66
+ };
67
+ };
68
+ logging: {
69
+ type: string;
70
+ additionalProperties: boolean;
71
+ properties: {
72
+ level: {
73
+ type: string;
74
+ enum: string[];
75
+ default: string;
76
+ };
77
+ fileLevel: {
78
+ type: string;
79
+ enum: string[];
80
+ default: string;
81
+ };
82
+ file: {
83
+ type: string;
84
+ default: string;
85
+ };
86
+ };
87
+ };
88
+ platforms: {
89
+ type: string;
90
+ items: {
91
+ type: string;
92
+ };
93
+ description: string;
94
+ default: string[];
95
+ };
96
+ packageConfig: {
97
+ type: string;
98
+ default: {};
99
+ description: string;
100
+ properties: {
101
+ "@sockethub/platform-carddav": {
102
+ type: string;
103
+ additionalProperties: boolean;
104
+ properties: {
105
+ connectTimeoutMs: {
106
+ type: string;
107
+ minimum: number;
108
+ };
109
+ allowPrivateAddresses: {
110
+ type: string;
111
+ };
112
+ allowInsecureHttp: {
113
+ type: string;
114
+ };
115
+ concurrency: {
116
+ type: string;
117
+ minimum: number;
118
+ };
119
+ };
120
+ };
121
+ "@sockethub/platform-caldav": {
122
+ type: string;
123
+ additionalProperties: boolean;
124
+ properties: {
125
+ connectTimeoutMs: {
126
+ type: string;
127
+ minimum: number;
128
+ };
129
+ allowPrivateAddresses: {
130
+ type: string;
131
+ };
132
+ allowInsecureHttp: {
133
+ type: string;
134
+ };
135
+ concurrency: {
136
+ type: string;
137
+ minimum: number;
138
+ };
139
+ };
140
+ };
141
+ "@sockethub/platform-dummy": {
142
+ type: string;
143
+ additionalProperties: boolean;
144
+ properties: {
145
+ greeting: {
146
+ type: string;
147
+ default: string;
148
+ };
149
+ };
150
+ };
151
+ "@sockethub/platform-feeds": {
152
+ type: string;
153
+ additionalProperties: boolean;
154
+ properties: {
155
+ connectTimeoutMs: {
156
+ type: string;
157
+ };
158
+ allowPrivateAddresses: {
159
+ type: string;
160
+ };
161
+ concurrency: {
162
+ type: string;
163
+ minimum: number;
164
+ };
165
+ };
166
+ };
167
+ "@sockethub/platform-irc": {
168
+ type: string;
169
+ additionalProperties: boolean;
170
+ properties: {
171
+ connectTimeoutMs: {
172
+ type: string;
173
+ };
174
+ };
175
+ };
176
+ "@sockethub/platform-xmpp": {
177
+ type: string;
178
+ additionalProperties: boolean;
179
+ properties: {
180
+ connectTimeoutMs: {
181
+ type: string;
182
+ };
183
+ };
184
+ };
185
+ "@sockethub/platform-metadata": {
186
+ type: string;
187
+ additionalProperties: boolean;
188
+ properties: {
189
+ allowPrivateAddresses: {
190
+ type: string;
191
+ };
192
+ concurrency: {
193
+ type: string;
194
+ minimum: number;
195
+ };
196
+ };
197
+ };
198
+ };
199
+ };
200
+ credentials: {
201
+ type: string;
202
+ additionalProperties: boolean;
203
+ properties: {
204
+ ttlMs: {
205
+ type: string;
206
+ minimum: number;
207
+ default: number;
208
+ description: string;
209
+ };
210
+ };
211
+ };
212
+ credentialCheck: {
213
+ type: string;
214
+ additionalProperties: boolean;
215
+ properties: {
216
+ reconnectIpSource: {
217
+ type: string;
218
+ enum: string[];
219
+ default: string;
220
+ };
221
+ proxyHeader: {
222
+ type: string;
223
+ default: string;
224
+ };
225
+ };
226
+ };
227
+ public: {
228
+ type: string;
229
+ additionalProperties: boolean;
230
+ properties: {
231
+ protocol: {
232
+ type: string;
233
+ default: string;
234
+ };
235
+ host: {
236
+ type: string;
237
+ default: string;
238
+ };
239
+ port: {
240
+ type: string;
241
+ default: number;
242
+ };
243
+ path: {
244
+ type: string;
245
+ default: string;
246
+ };
247
+ };
248
+ };
249
+ rateLimiter: {
250
+ type: string;
251
+ additionalProperties: boolean;
252
+ properties: {
253
+ windowMs: {
254
+ type: string;
255
+ default: number;
256
+ };
257
+ maxRequests: {
258
+ type: string;
259
+ default: number;
260
+ };
261
+ blockDurationMs: {
262
+ type: string;
263
+ default: number;
264
+ };
265
+ maxConnectionsPerIp: {
266
+ type: string;
267
+ minimum: number;
268
+ default: number;
269
+ description: string;
270
+ };
271
+ };
272
+ };
273
+ limits: {
274
+ type: string;
275
+ additionalProperties: boolean;
276
+ properties: {
277
+ maxPlatformInstances: {
278
+ type: string;
279
+ minimum: number;
280
+ default: number;
281
+ description: string;
282
+ };
283
+ };
284
+ };
285
+ redis: {
286
+ type: string;
287
+ additionalProperties: boolean;
288
+ properties: {
289
+ url: {
290
+ type: string;
291
+ default: string;
292
+ };
293
+ connectTimeout: {
294
+ type: string;
295
+ default: number;
296
+ description: string;
297
+ };
298
+ disconnectTimeout: {
299
+ type: string;
300
+ default: number;
301
+ description: string;
302
+ };
303
+ maxRetriesPerRequest: {
304
+ type: string[];
305
+ default: number | null;
306
+ description: string;
307
+ };
308
+ };
309
+ };
310
+ sentry: {
311
+ type: string;
312
+ additionalProperties: boolean;
313
+ properties: {
314
+ dsn: {
315
+ type: string;
316
+ default: string;
317
+ };
318
+ environment: {
319
+ type: string;
320
+ default: string;
321
+ };
322
+ release: {
323
+ type: string;
324
+ default: string;
325
+ };
326
+ enableLogs: {
327
+ type: string;
328
+ default: boolean;
329
+ };
330
+ logLevels: {
331
+ type: string;
332
+ items: {
333
+ type: string;
334
+ enum: string[];
335
+ };
336
+ default: string[];
337
+ };
338
+ enableMetrics: {
339
+ type: string;
340
+ default: boolean;
341
+ };
342
+ tracesSampleRate: {
343
+ type: string;
344
+ minimum: number;
345
+ maximum: number;
346
+ default: number;
347
+ };
348
+ profileSessionSampleRate: {
349
+ type: string;
350
+ minimum: number;
351
+ maximum: number;
352
+ default: number;
353
+ };
354
+ sendDefaultPii: {
355
+ type: string;
356
+ default: boolean;
357
+ };
358
+ };
359
+ };
360
+ sockethub: {
361
+ type: string;
362
+ additionalProperties: boolean;
363
+ properties: {
364
+ port: {
365
+ type: string;
366
+ default: number;
367
+ };
368
+ host: {
369
+ type: string;
370
+ default: string;
371
+ };
372
+ path: {
373
+ type: string;
374
+ default: string;
375
+ };
376
+ maxPayloadBytes: {
377
+ type: string;
378
+ minimum: number;
379
+ default: number;
380
+ description: string;
381
+ };
382
+ trustProxy: {
383
+ type: string[];
384
+ default: boolean;
385
+ description: string;
386
+ };
387
+ cors: {
388
+ type: string;
389
+ additionalProperties: boolean;
390
+ properties: {
391
+ origin: {
392
+ type: string;
393
+ default: string;
394
+ description: string;
395
+ };
396
+ };
397
+ };
398
+ };
399
+ };
400
+ httpActions: {
401
+ type: string;
402
+ additionalProperties: boolean;
403
+ properties: {
404
+ enabled: {
405
+ type: string;
406
+ default: boolean;
407
+ description: string;
408
+ };
409
+ path: {
410
+ type: string;
411
+ default: string;
412
+ };
413
+ requireRequestId: {
414
+ type: string;
415
+ default: boolean;
416
+ };
417
+ maxMessagesPerRequest: {
418
+ type: string;
419
+ minimum: number;
420
+ default: number;
421
+ };
422
+ maxPayloadBytes: {
423
+ type: string;
424
+ minimum: number;
425
+ default: number;
426
+ };
427
+ idempotencyTtlMs: {
428
+ type: string;
429
+ minimum: number;
430
+ default: number;
431
+ };
432
+ requestTimeoutMs: {
433
+ type: string;
434
+ minimum: number;
435
+ default: number;
436
+ };
437
+ idleTimeoutMs: {
438
+ type: string;
439
+ minimum: number;
440
+ default: number;
441
+ };
442
+ };
443
+ };
444
+ platformHeartbeat: {
445
+ type: string;
446
+ additionalProperties: boolean;
447
+ properties: {
448
+ intervalMs: {
449
+ type: string;
450
+ default: number;
451
+ };
452
+ timeoutMs: {
453
+ type: string;
454
+ default: number;
455
+ };
456
+ };
457
+ };
458
+ };
459
+ };
460
+ /**
461
+ * The versioned canonical URL of this schema, matching the `$id` written into
462
+ * the published JSON artifact (`dist/schemas/json/sockethub-config.json`) by
463
+ * the build's version substitution. Suitable as the `$schema` value in
464
+ * generated config files.
465
+ */
466
+ export declare const SockethubConfigSchemaId: string;
@@ -0,0 +1,4 @@
1
+ import { type ServiceDescriptor, ServiceDescriptorSchema, type ServiceEndpoints } from "./schemas/service-descriptor.js";
2
+ export declare function validateServiceDescriptor(descriptor: unknown): descriptor is ServiceDescriptor;
3
+ export { ServiceDescriptorSchema };
4
+ export type { ServiceDescriptor, ServiceEndpoints };