@sockethub/schemas 3.0.0-beta.0 → 3.0.0-beta.2
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/contexts/platform/email/v1.jsonld +8 -0
- package/dist/contexts/platform/instagram/v1.jsonld +8 -0
- package/dist/contexts/platform/messenger/v1.jsonld +8 -0
- package/dist/helpers/codegen.d.ts +23 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +195 -36
- package/dist/index.js.map +8 -7
- package/dist/maps/context-map.json +11 -2
- package/dist/schemas/json/activity-stream.json +1 -1
- package/dist/schemas/json/platform.json +1 -1
- package/dist/schemas/json/service-descriptor.json +1 -1
- package/dist/schemas/json/sockethub-config.json +51 -2
- package/dist/schemas/platform/caldav/v1/messages.schema.json +7 -0
- package/dist/schemas/platform/email/v1/credentials.schema.json +139 -0
- package/dist/schemas/platform/email/v1/messages.schema.json +289 -0
- package/dist/schemas/platform/instagram/v1/credentials.schema.json +67 -0
- package/dist/schemas/platform/instagram/v1/messages.schema.json +72 -0
- package/dist/schemas/platform/messenger/v1/credentials.schema.json +31 -0
- package/dist/schemas/platform/messenger/v1/messages.schema.json +72 -0
- package/dist/schemas/platform/xmpp/v1/credentials.schema.json +3 -1
- package/dist/schemas/sockethub-config.d.ts +46 -0
- package/dist/service-descriptor.d.ts +5 -0
- package/dist/service-descriptor.js +77 -2
- package/dist/service-descriptor.js.map +5 -4
- package/dist/types.d.ts +4 -0
- package/dist/validator.d.ts +25 -0
- package/package.json +2 -2
package/dist/types.d.ts
CHANGED
|
@@ -111,6 +111,10 @@ export interface StatelessPlatformConfig extends BasePlatformConfig {
|
|
|
111
111
|
* These always require credentials because persistent state is actor-specific.
|
|
112
112
|
*/
|
|
113
113
|
export interface PersistentPlatformConfig extends BasePlatformConfig {
|
|
114
|
+
/** Disable connection sharing when state belongs to a single client session. */
|
|
115
|
+
shareConnections?: boolean;
|
|
116
|
+
/** Disable replay after a worker crash for actions such as SMTP submission. */
|
|
117
|
+
retryStalledJobs?: boolean;
|
|
114
118
|
persist: true;
|
|
115
119
|
/** Message types requiring credentials (must be non-empty for persistent platforms) */
|
|
116
120
|
requireCredentials: string[];
|
package/dist/validator.d.ts
CHANGED
|
@@ -11,6 +11,11 @@ export declare function setValidationErrorOptions(options: ValidationErrorOption
|
|
|
11
11
|
* rather than reaching a platform wrong-typed.
|
|
12
12
|
*/
|
|
13
13
|
export declare function validateSockethubConfig(config: unknown): string;
|
|
14
|
+
/**
|
|
15
|
+
* Validate an inbound activity stream against the shared envelope and its
|
|
16
|
+
* registered platform message schema. Returns "" when valid; skipped (also "")
|
|
17
|
+
* when code generation is unavailable.
|
|
18
|
+
*/
|
|
14
19
|
export declare function validateActivityStream(msg: ActivityStream): string;
|
|
15
20
|
/**
|
|
16
21
|
* Validate an outbound platform response against that platform's `responses`
|
|
@@ -18,9 +23,29 @@ export declare function validateActivityStream(msg: ActivityStream): string;
|
|
|
18
23
|
* so outbound validation can be adopted platform-by-platform.
|
|
19
24
|
*/
|
|
20
25
|
export declare function validateActivityStreamResponse(msg: ActivityStream): string;
|
|
26
|
+
/**
|
|
27
|
+
* Validate a credentials activity stream against the shared envelope and its
|
|
28
|
+
* registered platform credentials schema. Returns "" when valid; skipped (also
|
|
29
|
+
* "") when code generation is unavailable.
|
|
30
|
+
*/
|
|
21
31
|
export declare function validateCredentials(msg: ActivityStream): string;
|
|
32
|
+
/**
|
|
33
|
+
* Validate a platform schema: its structural shape via Ajv (when available)
|
|
34
|
+
* and that its actor/target types are registered in the shared ActivityStreams
|
|
35
|
+
* envelope. Returns "" when valid, otherwise an error string.
|
|
36
|
+
*/
|
|
22
37
|
export declare function validatePlatformSchema(schema: Schema): string;
|
|
38
|
+
/**
|
|
39
|
+
* Register a platform's message or credentials schema with the validators, so
|
|
40
|
+
* local validation uses the same canonical sources as the server. Replaces any
|
|
41
|
+
* schema already registered for the same platform type. No-op when
|
|
42
|
+
* code generation is unavailable.
|
|
43
|
+
*/
|
|
23
44
|
export declare function addPlatformSchema(schema: Schema, platform_type: string): void;
|
|
45
|
+
/**
|
|
46
|
+
* Look up a registered platform schema validator, or `undefined` when no such
|
|
47
|
+
* schema is registered or code generation is unavailable.
|
|
48
|
+
*/
|
|
24
49
|
export declare function getPlatformSchema(platform_type: string): import("ajv/dist/core.js").AnyValidateFunction<unknown>;
|
|
25
50
|
export declare function addPlatformContext(platformId: string, platformContextUrl: string): void;
|
|
26
51
|
export declare function resolvePlatformId(msg: ActivityStream): string | null;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sockethub/schemas",
|
|
3
3
|
"description": "JSON schema files for validating Sockethub Activity Streams",
|
|
4
|
-
"version": "3.0.0-beta.
|
|
4
|
+
"version": "3.0.0-beta.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
7
7
|
"author": "Nick Jennings <nick@silverbucket.net>",
|
|
@@ -71,6 +71,6 @@
|
|
|
71
71
|
"ajv-formats": "^2.1.1",
|
|
72
72
|
"ajv-formats-draft2019": "^1.6.1"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "d241420f9743f66a15ed083a1390595b331a96ac",
|
|
75
75
|
"types": "./dist/index.d.ts"
|
|
76
76
|
}
|