@sockethub/schemas 3.0.0-alpha.19 → 3.0.0-alpha.21
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.
- package/dist/activity-stream-helper.js +35 -1
- package/dist/activity-stream-helper.js.map +2 -2
- package/dist/context.js +49 -15
- package/dist/context.js.map +2 -2
- package/dist/contexts/platform/carddav/v1.jsonld +8 -0
- package/dist/examples-config.d.ts +4 -0
- package/dist/examples-config.js +6278 -0
- package/dist/examples-config.js.map +77 -0
- package/dist/helpers/objects.d.ts +13 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +404 -235
- package/dist/index.js.map +8 -6
- package/dist/maps/context-map.json +5 -2
- package/dist/object-types.js +26 -10
- package/dist/object-types.js.map +3 -3
- package/dist/schemas/activity-stream.d.ts +13 -0
- package/dist/schemas/examples-config.d.ts +68 -0
- package/dist/schemas/json/activity-stream.json +22 -1
- package/dist/schemas/json/examples-config.json +66 -0
- package/dist/schemas/json/platform.json +1 -1
- package/dist/schemas/json/sockethub-config.json +76 -5
- package/dist/schemas/platform/carddav/v1/credentials.schema.json +67 -0
- package/dist/schemas/platform/carddav/v1/messages.schema.json +375 -0
- package/dist/schemas/sockethub-config.d.ts +63 -1
- package/package.json +12 -3
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
"schemaVersion": "3.0.0-alpha.
|
|
3
|
-
"generatedAt": "2026-08-
|
|
2
|
+
"schemaVersion": "3.0.0-alpha.21",
|
|
3
|
+
"generatedAt": "2026-08-21T08:37:52.092Z",
|
|
4
4
|
"contextToPlatformId": {
|
|
5
5
|
"https://sockethub.org/ns/context/platform/caldav/v1.jsonld": "caldav",
|
|
6
|
+
"https://sockethub.org/ns/context/platform/carddav/v1.jsonld": "carddav",
|
|
6
7
|
"https://sockethub.org/ns/context/platform/dummy/v1.jsonld": "dummy",
|
|
7
8
|
"https://sockethub.org/ns/context/platform/error/v1.jsonld": "error",
|
|
8
9
|
"https://sockethub.org/ns/context/platform/feeds/v1.jsonld": "feeds",
|
|
@@ -13,6 +14,7 @@
|
|
|
13
14
|
},
|
|
14
15
|
"contextToSchemaId": {
|
|
15
16
|
"https://sockethub.org/ns/context/platform/caldav/v1.jsonld": "https://sockethub.org/schemas/as2/platform/caldav/v1/messages.schema.json",
|
|
17
|
+
"https://sockethub.org/ns/context/platform/carddav/v1.jsonld": "https://sockethub.org/schemas/as2/platform/carddav/v1/messages.schema.json",
|
|
16
18
|
"https://sockethub.org/ns/context/platform/dummy/v1.jsonld": "https://sockethub.org/schemas/as2/platform/dummy/v1/messages.schema.json",
|
|
17
19
|
"https://sockethub.org/ns/context/platform/error/v1.jsonld": "https://sockethub.org/schemas/as2/platform/error/v1/messages.schema.json",
|
|
18
20
|
"https://sockethub.org/ns/context/platform/feeds/v1.jsonld": "https://sockethub.org/schemas/as2/platform/feeds/v1/messages.schema.json",
|
|
@@ -23,6 +25,7 @@
|
|
|
23
25
|
},
|
|
24
26
|
"contextToCredentialsSchemaId": {
|
|
25
27
|
"https://sockethub.org/ns/context/platform/caldav/v1.jsonld": "https://sockethub.org/schemas/as2/platform/caldav/v1/credentials.schema.json",
|
|
28
|
+
"https://sockethub.org/ns/context/platform/carddav/v1.jsonld": "https://sockethub.org/schemas/as2/platform/carddav/v1/credentials.schema.json",
|
|
26
29
|
"https://sockethub.org/ns/context/platform/dummy/v1.jsonld": "https://sockethub.org/schemas/as2/platform/dummy/v1/credentials.schema.json",
|
|
27
30
|
"https://sockethub.org/ns/context/platform/error/v1.jsonld": "https://sockethub.org/schemas/as2/platform/error/v1/credentials.schema.json",
|
|
28
31
|
"https://sockethub.org/ns/context/platform/feeds/v1.jsonld": "https://sockethub.org/schemas/as2/platform/feeds/v1/credentials.schema.json",
|
package/dist/object-types.js
CHANGED
|
@@ -19,12 +19,14 @@ var __toESM = (mod, isNodeMode, target) => {
|
|
|
19
19
|
}
|
|
20
20
|
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
21
21
|
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
if (mod && typeof mod === "object" || typeof mod === "function") {
|
|
23
|
+
for (let key of __getOwnPropNames(mod))
|
|
24
|
+
if (!__hasOwnProp.call(to, key))
|
|
25
|
+
__defProp(to, key, {
|
|
26
|
+
get: __accessProp.bind(mod, key),
|
|
27
|
+
enumerable: true
|
|
28
|
+
});
|
|
29
|
+
}
|
|
28
30
|
if (canCache)
|
|
29
31
|
cache.set(mod, to);
|
|
30
32
|
return to;
|
|
@@ -165,6 +167,19 @@ var ObjectTypesSchema = {
|
|
|
165
167
|
}
|
|
166
168
|
}
|
|
167
169
|
}
|
|
170
|
+
},
|
|
171
|
+
addressBook: {
|
|
172
|
+
required: ["id", "type"],
|
|
173
|
+
additionalProperties: false,
|
|
174
|
+
properties: {
|
|
175
|
+
id: {
|
|
176
|
+
type: "string",
|
|
177
|
+
format: "iri"
|
|
178
|
+
},
|
|
179
|
+
type: {
|
|
180
|
+
enum: ["addressBook"]
|
|
181
|
+
}
|
|
182
|
+
}
|
|
168
183
|
}
|
|
169
184
|
};
|
|
170
185
|
var InternalObjectTypesList = ["platform", "heartbeat"];
|
|
@@ -185,7 +200,8 @@ var TargetTypesList = [
|
|
|
185
200
|
"website",
|
|
186
201
|
"platform",
|
|
187
202
|
"address",
|
|
188
|
-
"calendar"
|
|
203
|
+
"calendar",
|
|
204
|
+
"addressBook"
|
|
189
205
|
];
|
|
190
206
|
var validActorRefs = ActorTypesList.map((type) => ({
|
|
191
207
|
$ref: `#/definitions/type/${type}`
|
|
@@ -312,8 +328,8 @@ var ActivityStreamSchema = {
|
|
|
312
328
|
}
|
|
313
329
|
};
|
|
314
330
|
export {
|
|
315
|
-
|
|
316
|
-
|
|
331
|
+
ActivityStreamSchema,
|
|
332
|
+
ObjectTypesSchema
|
|
317
333
|
};
|
|
318
334
|
|
|
319
|
-
//# debugId=
|
|
335
|
+
//# debugId=6BC7E000C3C7FA9864756E2164756E21
|
package/dist/object-types.js.map
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/helpers/objects.ts", "../src/context.ts", "../src/schemas/activity-stream.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"// The shared actor/target entity vocabulary. Content object types (message,\n// presence, attendance, room-info, topic, …) are owned by each platform's\n// `messages` (inbound) and `responses` (outbound) schemas; the base envelope no\n// longer enumerates a global object vocabulary.\nexport const ObjectTypesSchema = {\n feed: {\n required: [\"id\", \"type\"],\n additionalProperties: true,\n properties: {\n type: {\n enum: [\"feed\"],\n },\n id: {\n type: \"string\",\n format: \"iri\",\n },\n name: {\n type: \"string\",\n },\n description: {\n type: \"string\",\n },\n author: {\n type: \"string\",\n },\n favicon: {\n type: \"string\",\n },\n },\n },\n\n person: {\n required: [\"id\", \"type\"],\n additionalProperties: true,\n properties: {\n id: {\n type: \"string\",\n },\n type: {\n enum: [\"person\"],\n },\n name: {\n type: \"string\",\n },\n },\n },\n\n room: {\n required: [\"id\", \"type\"],\n additionalProperties: true,\n properties: {\n id: {\n type: \"string\",\n },\n type: {\n enum: [\"room\"],\n },\n name: {\n type: \"string\",\n },\n },\n },\n\n service: {\n required: [\"id\", \"type\"],\n additionalProperties: true,\n properties: {\n id: {\n type: \"string\",\n },\n type: {\n enum: [\"service\"],\n },\n name: {\n type: \"string\",\n },\n },\n },\n\n platform: {\n required: [\"id\", \"type\"],\n additionalProperties: true,\n properties: {\n id: {\n type: \"string\",\n },\n type: {\n enum: [\"platform\"],\n },\n name: {\n type: \"string\",\n },\n },\n },\n\n website: {\n required: [\"id\", \"type\"],\n additionalProperties: true,\n properties: {\n id: {\n type: \"string\",\n format: \"iri\",\n },\n type: {\n enum: [\"website\"],\n },\n name: {\n type: \"string\",\n },\n },\n },\n\n address: {\n required: [\"type\"],\n additionalProperties: false,\n properties: {\n type: {\n enum: [\"address\"],\n },\n },\n },\n\n calendar: {\n required: [\"id\", \"type\"],\n additionalProperties: true,\n properties: {\n id: {\n type: \"string\",\n format: \"iri\",\n },\n type: {\n enum: [\"calendar\"],\n },\n name: {\n type: \"string\",\n },\n components: {\n type: \"array\",\n items: {\n enum: [\"event\", \"task\"],\n },\n },\n },\n },\n};\n\n// Internal AS object types reserved for Sockethub IPC/housekeeping.\nexport const InternalObjectTypesList = [\"platform\", \"heartbeat\"];\nexport const ObjectTypesList = Object.keys(ObjectTypesSchema);\nexport const ActorTypesList = [\n \"person\",\n \"room\",\n \"service\",\n \"feed\",\n \"website\",\n \"platform\",\n];\nexport const TargetTypesList = [\n \"person\",\n \"room\",\n \"service\",\n \"feed\",\n \"website\",\n \"platform\",\n \"address\",\n \"calendar\",\n];\nexport const validActorRefs = ActorTypesList.map((type) => ({\n $ref: `#/definitions/type/${type}`,\n}));\nexport const validTargetRefs = TargetTypesList.map((type) => ({\n $ref: `#/definitions/type/${type}`,\n}));\n",
|
|
5
|
+
"// The shared actor/target entity vocabulary. Content object types (message,\n// presence, attendance, room-info, topic, …) are owned by each platform's\n// `messages` (inbound) and `responses` (outbound) schemas; the base envelope no\n// longer enumerates a global object vocabulary.\nexport const ObjectTypesSchema = {\n feed: {\n required: [\"id\", \"type\"],\n additionalProperties: true,\n properties: {\n type: {\n enum: [\"feed\"],\n },\n id: {\n type: \"string\",\n format: \"iri\",\n },\n name: {\n type: \"string\",\n },\n description: {\n type: \"string\",\n },\n author: {\n type: \"string\",\n },\n favicon: {\n type: \"string\",\n },\n },\n },\n\n person: {\n required: [\"id\", \"type\"],\n additionalProperties: true,\n properties: {\n id: {\n type: \"string\",\n },\n type: {\n enum: [\"person\"],\n },\n name: {\n type: \"string\",\n },\n },\n },\n\n room: {\n required: [\"id\", \"type\"],\n additionalProperties: true,\n properties: {\n id: {\n type: \"string\",\n },\n type: {\n enum: [\"room\"],\n },\n name: {\n type: \"string\",\n },\n },\n },\n\n service: {\n required: [\"id\", \"type\"],\n additionalProperties: true,\n properties: {\n id: {\n type: \"string\",\n },\n type: {\n enum: [\"service\"],\n },\n name: {\n type: \"string\",\n },\n },\n },\n\n platform: {\n required: [\"id\", \"type\"],\n additionalProperties: true,\n properties: {\n id: {\n type: \"string\",\n },\n type: {\n enum: [\"platform\"],\n },\n name: {\n type: \"string\",\n },\n },\n },\n\n website: {\n required: [\"id\", \"type\"],\n additionalProperties: true,\n properties: {\n id: {\n type: \"string\",\n format: \"iri\",\n },\n type: {\n enum: [\"website\"],\n },\n name: {\n type: \"string\",\n },\n },\n },\n\n address: {\n required: [\"type\"],\n additionalProperties: false,\n properties: {\n type: {\n enum: [\"address\"],\n },\n },\n },\n\n calendar: {\n required: [\"id\", \"type\"],\n additionalProperties: true,\n properties: {\n id: {\n type: \"string\",\n format: \"iri\",\n },\n type: {\n enum: [\"calendar\"],\n },\n name: {\n type: \"string\",\n },\n components: {\n type: \"array\",\n items: {\n enum: [\"event\", \"task\"],\n },\n },\n },\n },\n\n addressBook: {\n required: [\"id\", \"type\"],\n additionalProperties: false,\n properties: {\n id: {\n type: \"string\",\n format: \"iri\",\n },\n type: {\n enum: [\"addressBook\"],\n },\n },\n },\n};\n\n// Internal AS object types reserved for Sockethub IPC/housekeeping.\nexport const InternalObjectTypesList = [\"platform\", \"heartbeat\"];\nexport const ObjectTypesList = Object.keys(ObjectTypesSchema);\nexport const ActorTypesList = [\n \"person\",\n \"room\",\n \"service\",\n \"feed\",\n \"website\",\n \"platform\",\n];\nexport const TargetTypesList = [\n \"person\",\n \"room\",\n \"service\",\n \"feed\",\n \"website\",\n \"platform\",\n \"address\",\n \"calendar\",\n \"addressBook\",\n];\nexport const validActorRefs = ActorTypesList.map((type) => ({\n $ref: `#/definitions/type/${type}`,\n}));\nexport const validTargetRefs = TargetTypesList.map((type) => ({\n $ref: `#/definitions/type/${type}`,\n}));\n",
|
|
6
6
|
"import type { ActivityStream, JsonLdContext } from \"./types.js\";\n\n/**\n * Canonical AS2 base vocabulary URL.\n */\nexport const AS2_BASE_CONTEXT_URL = \"https://www.w3.org/ns/activitystreams\";\n\n/**\n * Sockethub base vocabulary URL for shared platform terms.\n */\nexport const SOCKETHUB_BASE_CONTEXT_URL =\n \"https://sockethub.org/ns/context/v1.jsonld\";\n\n/**\n * URL prefix for per-platform context URLs.\n */\nexport const PLATFORM_CONTEXT_PREFIX =\n \"https://sockethub.org/ns/context/platform/\";\n\n/**\n * Built-in pseudo-platform used for server-side error payloads.\n */\nexport const ERROR_PLATFORM_ID = \"error\";\nexport const ERROR_PLATFORM_CONTEXT_URL =\n \"https://sockethub.org/ns/context/platform/error/v1.jsonld\";\n\n/**\n * Built-in pseudo-platform used for internal control messages.\n */\nexport const INTERNAL_PLATFORM_ID = \"sockethub:internal\";\nexport const INTERNAL_PLATFORM_CONTEXT_URL =\n \"https://sockethub.org/ns/context/platform/sockethub:internal/v1.jsonld\";\n\nconst platformContextToPlatformId = new Map<string, string>();\nconst platformContextToSchemaId = new Map<string, string>();\nconst platformContextToCredentialsSchemaId = new Map<string, string>();\n\n/**\n * Build the canonical Sockethub @context array from a platform id or full context URL.\n */\nexport function buildCanonicalContext(platform: string): JsonLdContext {\n const platformUrl = platform.startsWith(\"https://\")\n ? platform\n : `${PLATFORM_CONTEXT_PREFIX}${platform}/v1.jsonld`;\n return [AS2_BASE_CONTEXT_URL, SOCKETHUB_BASE_CONTEXT_URL, platformUrl];\n}\n\n/**\n * Extract the platform ID from a canonical @context array.\n */\nexport function platformIdFromContext(\n context: string[] | unknown,\n): string | undefined {\n if (!Array.isArray(context)) {\n return undefined;\n }\n for (const entry of context) {\n if (\n typeof entry === \"string\" &&\n entry.startsWith(PLATFORM_CONTEXT_PREFIX)\n ) {\n const rest = entry.slice(PLATFORM_CONTEXT_PREFIX.length);\n const slashIdx = rest.indexOf(\"/\");\n if (slashIdx > 0) {\n return rest.slice(0, slashIdx);\n }\n }\n }\n return undefined;\n}\n\n/**\n * Normalize unknown @context input into a string-only array.\n */\nfunction normalizeContextArray(value: unknown): Array<string> {\n if (!Array.isArray(value)) {\n return [];\n }\n return value.filter((entry): entry is string => typeof entry === \"string\");\n}\n\n/**\n * Get a normalized @context array from an activity stream.\n */\nexport function getContextArray(msg: ActivityStream): Array<string> {\n return normalizeContextArray(msg[\"@context\"]);\n}\n\n/**\n * Register a platform context URL and its schema IDs for runtime resolution.\n */\nexport function registerPlatformContext(\n platformId: string,\n platformContextUrl: string,\n schemaId: string,\n credentialsSchemaId: string,\n) {\n platformContextToPlatformId.set(platformContextUrl, platformId);\n platformContextToSchemaId.set(platformContextUrl, schemaId);\n platformContextToCredentialsSchemaId.set(\n platformContextUrl,\n credentialsSchemaId,\n );\n}\n\n/**\n * Resolve the single registered platform context URL from a message.\n * Returns null when there are zero or multiple registered platform contexts.\n */\nexport function resolvePlatformContextUrl(msg: ActivityStream): string | null {\n const contexts = getContextArray(msg);\n const matches = contexts.filter((contextUrl) =>\n platformContextToPlatformId.has(contextUrl),\n );\n if (matches.length !== 1) {\n return null;\n }\n return matches[0];\n}\n\n/**\n * Resolve a platform ID from a platform context URL.\n */\nexport function getPlatformIdByContextUrl(\n platformContextUrl: string,\n): string | undefined {\n return platformContextToPlatformId.get(platformContextUrl);\n}\n\n/**\n * Resolve a message schema ID from a platform context URL.\n */\nexport function getSchemaIdByContextUrl(\n platformContextUrl: string,\n): string | undefined {\n return platformContextToSchemaId.get(platformContextUrl);\n}\n\n/**\n * Resolve a credentials schema ID from a platform context URL.\n */\nexport function getCredentialsSchemaIdByContextUrl(\n platformContextUrl: string,\n): string | undefined {\n return platformContextToCredentialsSchemaId.get(platformContextUrl);\n}\n",
|
|
7
7
|
"import {\n AS2_BASE_CONTEXT_URL,\n SOCKETHUB_BASE_CONTEXT_URL,\n} from \"../context.js\";\nimport {\n ObjectTypesSchema,\n validActorRefs,\n validTargetRefs,\n} from \"../helpers/objects.js\";\n\nconst contextSchema = {\n type: \"array\",\n minItems: 3,\n maxItems: 3,\n items: {\n type: \"string\",\n },\n allOf: [\n {\n contains: {\n const: AS2_BASE_CONTEXT_URL,\n },\n },\n {\n contains: {\n const: SOCKETHUB_BASE_CONTEXT_URL,\n },\n },\n ],\n};\nconst typeSchema = {\n type: \"string\",\n};\n\nexport const ActivityStreamSchema = {\n $id: \"https://sockethub.org/schemas/v/activity-stream.json\",\n description: \"Schema for Sockethub Activity Streams\",\n\n type: \"object\",\n required: [\"@context\", \"type\", \"actor\"],\n // Reject unknown top-level message properties. Inbound messages carry only\n // the properties below; `error`/`sessionSecret` are added server-side after\n // validation, so they never reach this schema.\n additionalProperties: false,\n properties: {\n \"@context\": contextSchema,\n id: {\n type: \"string\",\n },\n type: typeSchema,\n actor: {\n type: \"object\",\n oneOf: validActorRefs,\n },\n target: {\n type: \"object\",\n oneOf: validTargetRefs,\n },\n // Object shape is validated per-platform by each platform's `messages`\n // (inbound) and `responses` (outbound) schemas, which own their object\n // vocabulary. The base envelope only requires it to be an object.\n object: {\n type: \"object\",\n },\n published: {\n type: \"string\",\n format: \"date-time\",\n },\n },\n\n definitions: {\n type: ObjectTypesSchema,\n },\n};\n"
|
|
8
8
|
],
|
|
9
|
-
"mappings": "
|
|
10
|
-
"debugId": "
|
|
9
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIO,IAAM,oBAAoB;AAAA,EAC7B,MAAM;AAAA,IACF,UAAU,CAAC,MAAM,MAAM;AAAA,IACvB,sBAAsB;AAAA,IACtB,YAAY;AAAA,MACR,MAAM;AAAA,QACF,MAAM,CAAC,MAAM;AAAA,MACjB;AAAA,MACA,IAAI;AAAA,QACA,MAAM;AAAA,QACN,QAAQ;AAAA,MACZ;AAAA,MACA,MAAM;AAAA,QACF,MAAM;AAAA,MACV;AAAA,MACA,aAAa;AAAA,QACT,MAAM;AAAA,MACV;AAAA,MACA,QAAQ;AAAA,QACJ,MAAM;AAAA,MACV;AAAA,MACA,SAAS;AAAA,QACL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A,MAAM;AAAA,IACN,OAAO;AAAA,MACH,MAAM;AAAA,MACN,OAAO;AAAA,IACX;AAAA,IACA,QAAQ;AAAA,MACJ,MAAM;AAAA,MACN,OAAO;AAAA,IACX;AAAA,IAIA,QAAQ;AAAA,MACJ,MAAM;AAAA,IACV;AAAA,IACA,WAAW;AAAA,MACP,MAAM;AAAA,MACN,QAAQ;AAAA,IACZ;AAAA,EACJ;AAAA,EAEA,aAAa;AAAA,IACT,MAAM;AAAA,EACV;AACJ;",
|
|
10
|
+
"debugId": "6BC7E000C3C7FA9864756E2164756E21",
|
|
11
11
|
"names": []
|
|
12
12
|
}
|
|
@@ -178,6 +178,19 @@ export declare const ActivityStreamSchema: {
|
|
|
178
178
|
};
|
|
179
179
|
};
|
|
180
180
|
};
|
|
181
|
+
addressBook: {
|
|
182
|
+
required: string[];
|
|
183
|
+
additionalProperties: boolean;
|
|
184
|
+
properties: {
|
|
185
|
+
id: {
|
|
186
|
+
type: string;
|
|
187
|
+
format: string;
|
|
188
|
+
};
|
|
189
|
+
type: {
|
|
190
|
+
enum: string[];
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
};
|
|
181
194
|
};
|
|
182
195
|
};
|
|
183
196
|
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export interface ExamplesConfig {
|
|
2
|
+
sockethub: {
|
|
3
|
+
port: number;
|
|
4
|
+
host: string;
|
|
5
|
+
path: string;
|
|
6
|
+
};
|
|
7
|
+
public: {
|
|
8
|
+
protocol: string;
|
|
9
|
+
host: string;
|
|
10
|
+
port: number;
|
|
11
|
+
path: string;
|
|
12
|
+
};
|
|
13
|
+
platforms?: string[];
|
|
14
|
+
}
|
|
15
|
+
export declare const ExamplesConfigSchema: {
|
|
16
|
+
readonly $id: "https://sockethub.org/schemas/v/examples-config.json";
|
|
17
|
+
readonly description: "Sockethub examples runtime configuration";
|
|
18
|
+
readonly type: "object";
|
|
19
|
+
readonly required: readonly ["sockethub", "public"];
|
|
20
|
+
readonly additionalProperties: false;
|
|
21
|
+
readonly properties: {
|
|
22
|
+
readonly sockethub: {
|
|
23
|
+
readonly type: "object";
|
|
24
|
+
readonly required: readonly ["port", "host", "path"];
|
|
25
|
+
readonly additionalProperties: false;
|
|
26
|
+
readonly properties: {
|
|
27
|
+
readonly port: {
|
|
28
|
+
readonly type: "integer";
|
|
29
|
+
readonly minimum: 1;
|
|
30
|
+
readonly maximum: 65535;
|
|
31
|
+
};
|
|
32
|
+
readonly host: {
|
|
33
|
+
readonly type: "string";
|
|
34
|
+
};
|
|
35
|
+
readonly path: {
|
|
36
|
+
readonly type: "string";
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
readonly public: {
|
|
41
|
+
readonly type: "object";
|
|
42
|
+
readonly required: readonly ["protocol", "host", "port", "path"];
|
|
43
|
+
readonly additionalProperties: false;
|
|
44
|
+
readonly properties: {
|
|
45
|
+
readonly protocol: {
|
|
46
|
+
readonly type: "string";
|
|
47
|
+
};
|
|
48
|
+
readonly host: {
|
|
49
|
+
readonly type: "string";
|
|
50
|
+
};
|
|
51
|
+
readonly port: {
|
|
52
|
+
readonly type: "integer";
|
|
53
|
+
readonly minimum: 1;
|
|
54
|
+
readonly maximum: 65535;
|
|
55
|
+
};
|
|
56
|
+
readonly path: {
|
|
57
|
+
readonly type: "string";
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
readonly platforms: {
|
|
62
|
+
readonly type: "array";
|
|
63
|
+
readonly items: {
|
|
64
|
+
readonly type: "string";
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://sockethub.org/schemas/3.0.0-alpha.
|
|
2
|
+
"$id": "https://sockethub.org/schemas/3.0.0-alpha.21/activity-stream.json",
|
|
3
3
|
"description": "Schema for Sockethub Activity Streams",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"required": [
|
|
@@ -84,6 +84,9 @@
|
|
|
84
84
|
},
|
|
85
85
|
{
|
|
86
86
|
"$ref": "#/definitions/type/calendar"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"$ref": "#/definitions/type/addressBook"
|
|
87
90
|
}
|
|
88
91
|
]
|
|
89
92
|
},
|
|
@@ -270,6 +273,24 @@
|
|
|
270
273
|
}
|
|
271
274
|
}
|
|
272
275
|
}
|
|
276
|
+
},
|
|
277
|
+
"addressBook": {
|
|
278
|
+
"required": [
|
|
279
|
+
"id",
|
|
280
|
+
"type"
|
|
281
|
+
],
|
|
282
|
+
"additionalProperties": false,
|
|
283
|
+
"properties": {
|
|
284
|
+
"id": {
|
|
285
|
+
"type": "string",
|
|
286
|
+
"format": "iri"
|
|
287
|
+
},
|
|
288
|
+
"type": {
|
|
289
|
+
"enum": [
|
|
290
|
+
"addressBook"
|
|
291
|
+
]
|
|
292
|
+
}
|
|
293
|
+
}
|
|
273
294
|
}
|
|
274
295
|
}
|
|
275
296
|
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$id": "https://sockethub.org/schemas/3.0.0-alpha.21/examples-config.json",
|
|
3
|
+
"description": "Sockethub examples runtime configuration",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"required": [
|
|
6
|
+
"sockethub",
|
|
7
|
+
"public"
|
|
8
|
+
],
|
|
9
|
+
"additionalProperties": false,
|
|
10
|
+
"properties": {
|
|
11
|
+
"sockethub": {
|
|
12
|
+
"type": "object",
|
|
13
|
+
"required": [
|
|
14
|
+
"port",
|
|
15
|
+
"host",
|
|
16
|
+
"path"
|
|
17
|
+
],
|
|
18
|
+
"additionalProperties": false,
|
|
19
|
+
"properties": {
|
|
20
|
+
"port": {
|
|
21
|
+
"type": "integer",
|
|
22
|
+
"minimum": 1,
|
|
23
|
+
"maximum": 65535
|
|
24
|
+
},
|
|
25
|
+
"host": {
|
|
26
|
+
"type": "string"
|
|
27
|
+
},
|
|
28
|
+
"path": {
|
|
29
|
+
"type": "string"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"public": {
|
|
34
|
+
"type": "object",
|
|
35
|
+
"required": [
|
|
36
|
+
"protocol",
|
|
37
|
+
"host",
|
|
38
|
+
"port",
|
|
39
|
+
"path"
|
|
40
|
+
],
|
|
41
|
+
"additionalProperties": false,
|
|
42
|
+
"properties": {
|
|
43
|
+
"protocol": {
|
|
44
|
+
"type": "string"
|
|
45
|
+
},
|
|
46
|
+
"host": {
|
|
47
|
+
"type": "string"
|
|
48
|
+
},
|
|
49
|
+
"port": {
|
|
50
|
+
"type": "integer",
|
|
51
|
+
"minimum": 1,
|
|
52
|
+
"maximum": 65535
|
|
53
|
+
},
|
|
54
|
+
"path": {
|
|
55
|
+
"type": "string"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"platforms": {
|
|
60
|
+
"type": "array",
|
|
61
|
+
"items": {
|
|
62
|
+
"type": "string"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://sockethub.org/schemas/3.0.0-alpha.
|
|
2
|
+
"$id": "https://sockethub.org/schemas/3.0.0-alpha.21/sockethub-config.json",
|
|
3
3
|
"description": "Sockethub Config Schema",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"required": [
|
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
},
|
|
58
58
|
"description": "Platform packages to load",
|
|
59
59
|
"default": [
|
|
60
|
+
"@sockethub/platform-carddav",
|
|
60
61
|
"@sockethub/platform-caldav",
|
|
61
62
|
"@sockethub/platform-dummy",
|
|
62
63
|
"@sockethub/platform-feeds",
|
|
@@ -70,6 +71,26 @@
|
|
|
70
71
|
"default": {},
|
|
71
72
|
"description": "Per-platform config keyed by package name, validated against each platform's config schema and forwarded to its child process",
|
|
72
73
|
"properties": {
|
|
74
|
+
"@sockethub/platform-carddav": {
|
|
75
|
+
"type": "object",
|
|
76
|
+
"additionalProperties": false,
|
|
77
|
+
"properties": {
|
|
78
|
+
"connectTimeoutMs": {
|
|
79
|
+
"type": "integer",
|
|
80
|
+
"minimum": 1
|
|
81
|
+
},
|
|
82
|
+
"allowPrivateAddresses": {
|
|
83
|
+
"type": "boolean"
|
|
84
|
+
},
|
|
85
|
+
"allowInsecureHttp": {
|
|
86
|
+
"type": "boolean"
|
|
87
|
+
},
|
|
88
|
+
"concurrency": {
|
|
89
|
+
"type": "integer",
|
|
90
|
+
"minimum": 1
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
},
|
|
73
94
|
"@sockethub/platform-caldav": {
|
|
74
95
|
"type": "object",
|
|
75
96
|
"additionalProperties": false,
|
|
@@ -220,7 +241,7 @@
|
|
|
220
241
|
"maxConnectionsPerIp": {
|
|
221
242
|
"type": "number",
|
|
222
243
|
"minimum": 0,
|
|
223
|
-
"default":
|
|
244
|
+
"default": 20,
|
|
224
245
|
"description": "Maximum concurrent socket connections per client IP. The per-event rate limiter is keyed by socket id, so without a connection cap a client can bypass it by opening more sockets. 0 disables the cap."
|
|
225
246
|
}
|
|
226
247
|
}
|
|
@@ -232,7 +253,7 @@
|
|
|
232
253
|
"maxPlatformInstances": {
|
|
233
254
|
"type": "number",
|
|
234
255
|
"minimum": 0,
|
|
235
|
-
"default":
|
|
256
|
+
"default": 100,
|
|
236
257
|
"description": "Upper bound on concurrently running platform instances (child processes). Each persistent-platform actor forks its own process, so an unbounded count is a resource exhaustion risk on public instances. 0 disables the cap."
|
|
237
258
|
}
|
|
238
259
|
}
|
|
@@ -273,9 +294,53 @@
|
|
|
273
294
|
"type": "string",
|
|
274
295
|
"default": ""
|
|
275
296
|
},
|
|
276
|
-
"
|
|
297
|
+
"environment": {
|
|
298
|
+
"type": "string",
|
|
299
|
+
"default": "production"
|
|
300
|
+
},
|
|
301
|
+
"release": {
|
|
302
|
+
"type": "string",
|
|
303
|
+
"default": ""
|
|
304
|
+
},
|
|
305
|
+
"enableLogs": {
|
|
306
|
+
"type": "boolean",
|
|
307
|
+
"default": false
|
|
308
|
+
},
|
|
309
|
+
"logLevels": {
|
|
310
|
+
"type": "array",
|
|
311
|
+
"items": {
|
|
312
|
+
"type": "string",
|
|
313
|
+
"enum": [
|
|
314
|
+
"debug",
|
|
315
|
+
"info",
|
|
316
|
+
"warn",
|
|
317
|
+
"error"
|
|
318
|
+
]
|
|
319
|
+
},
|
|
320
|
+
"default": [
|
|
321
|
+
"warn",
|
|
322
|
+
"error"
|
|
323
|
+
]
|
|
324
|
+
},
|
|
325
|
+
"enableMetrics": {
|
|
326
|
+
"type": "boolean",
|
|
327
|
+
"default": true
|
|
328
|
+
},
|
|
329
|
+
"tracesSampleRate": {
|
|
277
330
|
"type": "number",
|
|
278
|
-
"
|
|
331
|
+
"minimum": 0,
|
|
332
|
+
"maximum": 1,
|
|
333
|
+
"default": 0.1
|
|
334
|
+
},
|
|
335
|
+
"profileSessionSampleRate": {
|
|
336
|
+
"type": "number",
|
|
337
|
+
"minimum": 0,
|
|
338
|
+
"maximum": 1,
|
|
339
|
+
"default": 0
|
|
340
|
+
},
|
|
341
|
+
"sendDefaultPii": {
|
|
342
|
+
"type": "boolean",
|
|
343
|
+
"default": false
|
|
279
344
|
}
|
|
280
345
|
}
|
|
281
346
|
},
|
|
@@ -295,6 +360,12 @@
|
|
|
295
360
|
"type": "string",
|
|
296
361
|
"default": "/sockethub"
|
|
297
362
|
},
|
|
363
|
+
"maxPayloadBytes": {
|
|
364
|
+
"type": "integer",
|
|
365
|
+
"minimum": 1,
|
|
366
|
+
"default": 262144,
|
|
367
|
+
"description": "Maximum size in bytes of a single Socket.IO message."
|
|
368
|
+
},
|
|
298
369
|
"cors": {
|
|
299
370
|
"type": "object",
|
|
300
371
|
"additionalProperties": false,
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"required": [
|
|
3
|
+
"object"
|
|
4
|
+
],
|
|
5
|
+
"properties": {
|
|
6
|
+
"object": {
|
|
7
|
+
"oneOf": [
|
|
8
|
+
{
|
|
9
|
+
"type": "object",
|
|
10
|
+
"required": [
|
|
11
|
+
"type",
|
|
12
|
+
"url",
|
|
13
|
+
"username",
|
|
14
|
+
"password"
|
|
15
|
+
],
|
|
16
|
+
"additionalProperties": false,
|
|
17
|
+
"properties": {
|
|
18
|
+
"type": {
|
|
19
|
+
"const": "credentials"
|
|
20
|
+
},
|
|
21
|
+
"url": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"format": "uri",
|
|
24
|
+
"pattern": "^https?://",
|
|
25
|
+
"maxLength": 4096
|
|
26
|
+
},
|
|
27
|
+
"username": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"minLength": 1,
|
|
30
|
+
"maxLength": 1024
|
|
31
|
+
},
|
|
32
|
+
"password": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"minLength": 1,
|
|
35
|
+
"maxLength": 4096
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"type": "object",
|
|
41
|
+
"required": [
|
|
42
|
+
"type",
|
|
43
|
+
"url",
|
|
44
|
+
"token"
|
|
45
|
+
],
|
|
46
|
+
"additionalProperties": false,
|
|
47
|
+
"properties": {
|
|
48
|
+
"type": {
|
|
49
|
+
"const": "credentials"
|
|
50
|
+
},
|
|
51
|
+
"url": {
|
|
52
|
+
"type": "string",
|
|
53
|
+
"format": "uri",
|
|
54
|
+
"pattern": "^https?://",
|
|
55
|
+
"maxLength": 4096
|
|
56
|
+
},
|
|
57
|
+
"token": {
|
|
58
|
+
"type": "string",
|
|
59
|
+
"minLength": 1,
|
|
60
|
+
"maxLength": 8192
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|