@sockethub/schemas 3.0.0-beta.0 → 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.
@@ -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,28 @@ 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. No-op when
41
+ * code generation is unavailable.
42
+ */
23
43
  export declare function addPlatformSchema(schema: Schema, platform_type: string): void;
44
+ /**
45
+ * Look up a registered platform schema validator, or `undefined` when no such
46
+ * schema is registered or code generation is unavailable.
47
+ */
24
48
  export declare function getPlatformSchema(platform_type: string): import("ajv/dist/core.js").AnyValidateFunction<unknown>;
25
49
  export declare function addPlatformContext(platformId: string, platformContextUrl: string): void;
26
50
  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.1",
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": "928f0c480e4828f492fb29a97712474a8f1bcaef",
75
75
  "types": "./dist/index.d.ts"
76
76
  }