@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/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[];
@@ -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.0",
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": "a17e337ee7d2dd496d225c0d6e8ae48f4f4ce73c",
74
+ "gitHead": "d241420f9743f66a15ed083a1390595b331a96ac",
75
75
  "types": "./dist/index.d.ts"
76
76
  }