@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
@@ -0,0 +1,481 @@
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
+ allowPrivateAddresses: {
184
+ type: string;
185
+ };
186
+ };
187
+ };
188
+ "@sockethub/platform-metadata": {
189
+ type: string;
190
+ additionalProperties: boolean;
191
+ properties: {
192
+ allowPrivateAddresses: {
193
+ type: string;
194
+ };
195
+ concurrency: {
196
+ type: string;
197
+ minimum: number;
198
+ };
199
+ };
200
+ };
201
+ };
202
+ };
203
+ credentials: {
204
+ type: string;
205
+ additionalProperties: boolean;
206
+ properties: {
207
+ ttlMs: {
208
+ type: string;
209
+ minimum: number;
210
+ default: number;
211
+ description: string;
212
+ };
213
+ };
214
+ };
215
+ credentialCheck: {
216
+ type: string;
217
+ additionalProperties: boolean;
218
+ properties: {
219
+ reconnectIpSource: {
220
+ type: string;
221
+ enum: string[];
222
+ default: string;
223
+ };
224
+ proxyHeader: {
225
+ type: string;
226
+ default: string;
227
+ };
228
+ };
229
+ };
230
+ public: {
231
+ type: string;
232
+ additionalProperties: boolean;
233
+ properties: {
234
+ protocol: {
235
+ type: string;
236
+ default: string;
237
+ };
238
+ host: {
239
+ type: string;
240
+ default: string;
241
+ };
242
+ port: {
243
+ type: string;
244
+ default: number;
245
+ };
246
+ path: {
247
+ type: string;
248
+ default: string;
249
+ };
250
+ };
251
+ };
252
+ rateLimiter: {
253
+ type: string;
254
+ additionalProperties: boolean;
255
+ properties: {
256
+ windowMs: {
257
+ type: string;
258
+ default: number;
259
+ };
260
+ maxRequests: {
261
+ type: string;
262
+ default: number;
263
+ };
264
+ blockDurationMs: {
265
+ type: string;
266
+ default: number;
267
+ };
268
+ maxConnectionsPerIp: {
269
+ type: string;
270
+ minimum: number;
271
+ default: number;
272
+ description: string;
273
+ };
274
+ };
275
+ };
276
+ limits: {
277
+ type: string;
278
+ additionalProperties: boolean;
279
+ properties: {
280
+ maxInstancesPerSession: {
281
+ type: string;
282
+ minimum: number;
283
+ default: number;
284
+ description: string;
285
+ };
286
+ maxInstancesPerIp: {
287
+ type: string;
288
+ minimum: number;
289
+ default: number;
290
+ description: string;
291
+ };
292
+ maxPlatformInstances: {
293
+ type: string;
294
+ minimum: number;
295
+ default: number;
296
+ description: string;
297
+ };
298
+ };
299
+ };
300
+ redis: {
301
+ type: string;
302
+ additionalProperties: boolean;
303
+ properties: {
304
+ url: {
305
+ type: string;
306
+ default: string;
307
+ };
308
+ connectTimeout: {
309
+ type: string;
310
+ default: number;
311
+ description: string;
312
+ };
313
+ disconnectTimeout: {
314
+ type: string;
315
+ default: number;
316
+ description: string;
317
+ };
318
+ maxRetriesPerRequest: {
319
+ type: string[];
320
+ default: number | null;
321
+ description: string;
322
+ };
323
+ };
324
+ };
325
+ sentry: {
326
+ type: string;
327
+ additionalProperties: boolean;
328
+ properties: {
329
+ dsn: {
330
+ type: string;
331
+ default: string;
332
+ };
333
+ environment: {
334
+ type: string;
335
+ default: string;
336
+ };
337
+ release: {
338
+ type: string;
339
+ default: string;
340
+ };
341
+ enableLogs: {
342
+ type: string;
343
+ default: boolean;
344
+ };
345
+ logLevels: {
346
+ type: string;
347
+ items: {
348
+ type: string;
349
+ enum: string[];
350
+ };
351
+ default: string[];
352
+ };
353
+ enableMetrics: {
354
+ type: string;
355
+ default: boolean;
356
+ };
357
+ tracesSampleRate: {
358
+ type: string;
359
+ minimum: number;
360
+ maximum: number;
361
+ default: number;
362
+ };
363
+ profileSessionSampleRate: {
364
+ type: string;
365
+ minimum: number;
366
+ maximum: number;
367
+ default: number;
368
+ };
369
+ sendDefaultPii: {
370
+ type: string;
371
+ default: boolean;
372
+ };
373
+ };
374
+ };
375
+ sockethub: {
376
+ type: string;
377
+ additionalProperties: boolean;
378
+ properties: {
379
+ port: {
380
+ type: string;
381
+ default: number;
382
+ };
383
+ host: {
384
+ type: string;
385
+ default: string;
386
+ };
387
+ path: {
388
+ type: string;
389
+ default: string;
390
+ };
391
+ maxPayloadBytes: {
392
+ type: string;
393
+ minimum: number;
394
+ default: number;
395
+ description: string;
396
+ };
397
+ trustProxy: {
398
+ type: string[];
399
+ default: boolean;
400
+ description: string;
401
+ };
402
+ cors: {
403
+ type: string;
404
+ additionalProperties: boolean;
405
+ properties: {
406
+ origin: {
407
+ type: string;
408
+ default: string;
409
+ description: string;
410
+ };
411
+ };
412
+ };
413
+ };
414
+ };
415
+ httpActions: {
416
+ type: string;
417
+ additionalProperties: boolean;
418
+ properties: {
419
+ enabled: {
420
+ type: string;
421
+ default: boolean;
422
+ description: string;
423
+ };
424
+ path: {
425
+ type: string;
426
+ default: string;
427
+ };
428
+ requireRequestId: {
429
+ type: string;
430
+ default: boolean;
431
+ };
432
+ maxMessagesPerRequest: {
433
+ type: string;
434
+ minimum: number;
435
+ default: number;
436
+ };
437
+ maxPayloadBytes: {
438
+ type: string;
439
+ minimum: number;
440
+ default: number;
441
+ };
442
+ idempotencyTtlMs: {
443
+ type: string;
444
+ minimum: number;
445
+ default: number;
446
+ };
447
+ requestTimeoutMs: {
448
+ type: string;
449
+ minimum: number;
450
+ default: number;
451
+ };
452
+ idleTimeoutMs: {
453
+ type: string;
454
+ minimum: number;
455
+ default: number;
456
+ };
457
+ };
458
+ };
459
+ platformHeartbeat: {
460
+ type: string;
461
+ additionalProperties: boolean;
462
+ properties: {
463
+ intervalMs: {
464
+ type: string;
465
+ default: number;
466
+ };
467
+ timeoutMs: {
468
+ type: string;
469
+ default: number;
470
+ };
471
+ };
472
+ };
473
+ };
474
+ };
475
+ /**
476
+ * The versioned canonical URL of this schema, matching the `$id` written into
477
+ * the published JSON artifact (`dist/schemas/json/sockethub-config.json`) by
478
+ * the build's version substitution. Suitable as the `$schema` value in
479
+ * generated config files.
480
+ */
481
+ export declare const SockethubConfigSchemaId: string;
@@ -0,0 +1,9 @@
1
+ import { type ServiceDescriptor, ServiceDescriptorSchema, type ServiceEndpoints } from "./schemas/service-descriptor.js";
2
+ /**
3
+ * Type guard for a server's service descriptor. Validates with Ajv when code
4
+ * generation is available and falls back to a structural check when a Content
5
+ * Security Policy blocks it.
6
+ */
7
+ export declare function validateServiceDescriptor(descriptor: unknown): descriptor is ServiceDescriptor;
8
+ export { ServiceDescriptorSchema };
9
+ export type { ServiceDescriptor, ServiceEndpoints };