@twin.org/trust-models 0.0.3-next.2 → 0.0.3-next.4

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.
@@ -0,0 +1,9 @@
1
+ // Copyright 2025 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ import { Factory } from "@twin.org/core";
4
+ /**
5
+ * Factory for managing generator registration and retrieval.
6
+ */
7
+ // eslint-disable-next-line @typescript-eslint/naming-convention
8
+ export const TrustGeneratorFactory = Factory.createFactory("trust-generator");
9
+ //# sourceMappingURL=trustGeneratorFactory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trustGeneratorFactory.js","sourceRoot":"","sources":["../../../src/factories/trustGeneratorFactory.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAGzC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,qBAAqB,GAAG,OAAO,CAAC,aAAa,CAAkB,iBAAiB,CAAC,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { Factory } from \"@twin.org/core\";\nimport type { ITrustGenerator } from \"../models/ITrustGenerator.js\";\n\n/**\n * Factory for managing generator registration and retrieval.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const TrustGeneratorFactory = Factory.createFactory<ITrustGenerator>(\"trust-generator\");\n"]}
@@ -0,0 +1,31 @@
1
+ // Copyright 2025 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ import { UnauthorizedError } from "@twin.org/core";
4
+ /**
5
+ * Helper class for trust-related operations.
6
+ */
7
+ export class TrustHelper {
8
+ /**
9
+ * Runtime name for the class.
10
+ */
11
+ static CLASS_NAME = "TrustHelper";
12
+ /**
13
+ * Verify the trust payload for the action.
14
+ * @param component The trust component to use.
15
+ * @param trustPayload The trust payload to verify.
16
+ * @param action The action being performed.
17
+ * @param overrideVerifiers List of verifiers to use instead of the default ones.
18
+ * @returns The information from the trust verification.
19
+ */
20
+ static async verifyTrust(component, trustPayload, action, overrideVerifiers) {
21
+ const trustResult = await component.verify(trustPayload, overrideVerifiers);
22
+ if (!trustResult.verified) {
23
+ throw new UnauthorizedError(TrustHelper.CLASS_NAME, "trustVerifyFailed", {
24
+ action,
25
+ errors: trustResult.errors
26
+ });
27
+ }
28
+ return trustResult.info;
29
+ }
30
+ }
31
+ //# sourceMappingURL=trustHelper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trustHelper.js","sourceRoot":"","sources":["../../../src/helpers/trustHelper.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAInD;;GAEG;AACH,MAAM,OAAO,WAAW;IACvB;;OAEG;IACI,MAAM,CAAU,UAAU,iBAAiC;IAElE;;;;;;;OAOG;IACI,MAAM,CAAC,KAAK,CAAC,WAAW,CAC9B,SAA0B,EAC1B,YAAqB,EACrB,MAAc,EACd,iBAA4B;QAE5B,MAAM,WAAW,GAAG,MAAM,SAAS,CAAC,MAAM,CAAC,YAAY,EAAE,iBAAiB,CAAC,CAAC;QAC5E,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC;YAC3B,MAAM,IAAI,iBAAiB,CAAC,WAAW,CAAC,UAAU,EAAE,mBAAmB,EAAE;gBACxE,MAAM;gBACN,MAAM,EAAE,WAAW,CAAC,MAAM;aAC1B,CAAC,CAAC;QACJ,CAAC;QACD,OAAO,WAAW,CAAC,IAAI,CAAC;IACzB,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { UnauthorizedError } from \"@twin.org/core\";\nimport { nameof } from \"@twin.org/nameof\";\nimport type { ITrustComponent } from \"../models/ITrustComponent.js\";\n\n/**\n * Helper class for trust-related operations.\n */\nexport class TrustHelper {\n\t/**\n\t * Runtime name for the class.\n\t */\n\tpublic static readonly CLASS_NAME: string = nameof<TrustHelper>();\n\n\t/**\n\t * Verify the trust payload for the action.\n\t * @param component The trust component to use.\n\t * @param trustPayload The trust payload to verify.\n\t * @param action The action being performed.\n\t * @param overrideVerifiers List of verifiers to use instead of the default ones.\n\t * @returns The information from the trust verification.\n\t */\n\tpublic static async verifyTrust(\n\t\tcomponent: ITrustComponent,\n\t\ttrustPayload: unknown,\n\t\taction: string,\n\t\toverrideVerifiers?: string[]\n\t): Promise<{ [key: string]: unknown } | undefined> {\n\t\tconst trustResult = await component.verify(trustPayload, overrideVerifiers);\n\t\tif (!trustResult.verified) {\n\t\t\tthrow new UnauthorizedError(TrustHelper.CLASS_NAME, \"trustVerifyFailed\", {\n\t\t\t\taction,\n\t\t\t\terrors: trustResult.errors\n\t\t\t});\n\t\t}\n\t\treturn trustResult.info;\n\t}\n}\n"]}
package/dist/es/index.js CHANGED
@@ -1,6 +1,9 @@
1
1
  // Copyright 2025 IOTA Stiftung.
2
2
  // SPDX-License-Identifier: Apache-2.0.
3
+ export * from "./factories/trustGeneratorFactory.js";
3
4
  export * from "./factories/trustVerifierFactory.js";
5
+ export * from "./helpers/trustHelper.js";
4
6
  export * from "./models/ITrustComponent.js";
7
+ export * from "./models/ITrustGenerator.js";
5
8
  export * from "./models/ITrustVerifier.js";
6
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,cAAc,qCAAqC,CAAC;AACpD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nexport * from \"./factories/trustVerifierFactory.js\";\nexport * from \"./models/ITrustComponent.js\";\nexport * from \"./models/ITrustVerifier.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,cAAc,sCAAsC,CAAC;AACrD,cAAc,qCAAqC,CAAC;AACpD,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nexport * from \"./factories/trustGeneratorFactory.js\";\nexport * from \"./factories/trustVerifierFactory.js\";\nexport * from \"./helpers/trustHelper.js\";\nexport * from \"./models/ITrustComponent.js\";\nexport * from \"./models/ITrustGenerator.js\";\nexport * from \"./models/ITrustVerifier.js\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ITrustComponent.js","sourceRoot":"","sources":["../../../src/models/ITrustComponent.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent, IError } from \"@twin.org/core\";\nimport type { IJsonLdNodeObject } from \"@twin.org/data-json-ld\";\n\n/**\n * Interface describing a trust component.\n */\nexport interface ITrustComponent extends IComponent {\n\t/**\n\t * Verify a payload by checking the validity of its structure and content using the registered verifiers.\n\t * @param payload The payload to verify.\n\t * @param overrideVerifiers List of verifiers to use instead of the default ones.\n\t * @returns Whether the payload is verified and any additional information extracted from the payload, or failures per verifier.\n\t */\n\tverify(\n\t\tpayload: unknown,\n\t\toverrideVerifiers?: string[]\n\t): Promise<{\n\t\tverified: boolean;\n\t\tinfo?: IJsonLdNodeObject[];\n\t\tfailures?: { [id: string]: IError[] };\n\t}>;\n}\n"]}
1
+ {"version":3,"file":"ITrustComponent.js","sourceRoot":"","sources":["../../../src/models/ITrustComponent.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent, IError } from \"@twin.org/core\";\n\n/**\n * Interface describing a trust component.\n */\nexport interface ITrustComponent extends IComponent {\n\t/**\n\t * Verify a payload by checking the validity of its structure and content using the registered verifiers.\n\t * @param payload The payload to verify.\n\t * @param overrideVerifiers List of verifiers to use instead of the default ones.\n\t * @returns Whether the payload is verified and any additional information extracted from the payload, or errors.\n\t */\n\tverify(\n\t\tpayload: unknown,\n\t\toverrideVerifiers?: string[]\n\t): Promise<{\n\t\tverified: boolean;\n\t\tinfo?: { [key: string]: unknown };\n\t\terrors?: IError[];\n\t}>;\n\n\t/**\n\t * Generate a payload using the specified generators.\n\t * @param generatorType The type of generator to use.\n\t * @param info Optional information to include in the generated payload.\n\t * @returns The generated payload.\n\t */\n\tgenerate(generatorType: string, info?: { [key: string]: unknown }): Promise<unknown>;\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ITrustGenerator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ITrustGenerator.js","sourceRoot":"","sources":["../../../src/models/ITrustGenerator.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@twin.org/core\";\n\n/**\n * Interface describing a trust generator component.\n */\nexport interface ITrustGenerator extends IComponent {\n\t/**\n\t * Generate a trust payload.\n\t * @param info Information to use in the generation.\n\t * @returns The generated payload.\n\t */\n\tgenerate(info?: { [key: string]: unknown }): Promise<unknown>;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ITrustVerifier.js","sourceRoot":"","sources":["../../../src/models/ITrustVerifier.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent, IError } from \"@twin.org/core\";\nimport type { IJsonLdNodeObject } from \"@twin.org/data-json-ld\";\n\n/**\n * Interface describing a trust verifier component.\n */\nexport interface ITrustVerifier extends IComponent {\n\t/**\n\t * Verify a payload by checking the validity of its structure and content.\n\t * @param payload The payload to verify.\n\t * @param info Information extracted from previous verifiers and to be added by this verifier.\n\t * @returns Whether the payload is verified and possible verification failures, returns undefined if payload not processed.\n\t */\n\tverify(\n\t\tpayload: unknown,\n\t\tinfo: IJsonLdNodeObject[]\n\t): Promise<\n\t\t| {\n\t\t\t\tverified: boolean;\n\t\t\t\tfailures?: IError[];\n\t\t }\n\t\t| undefined\n\t>;\n}\n"]}
1
+ {"version":3,"file":"ITrustVerifier.js","sourceRoot":"","sources":["../../../src/models/ITrustVerifier.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent, IError } from \"@twin.org/core\";\n\n/**\n * Interface describing a trust verifier component.\n */\nexport interface ITrustVerifier extends IComponent {\n\t/**\n\t * Verify a payload by checking the validity of its structure and content.\n\t * @param payload The payload to verify.\n\t * @param info Information extracted from previous verifiers and to be added by this verifier.\n\t * @param errors Array to collect verification errors.\n\t * @returns Whether the payload is verified, returns undefined if payload was not processed.\n\t */\n\tverify(\n\t\tpayload: unknown,\n\t\tinfo: {\n\t\t\t[key: string]: unknown;\n\t\t},\n\t\terrors: IError[]\n\t): Promise<boolean | undefined>;\n}\n"]}
@@ -0,0 +1,6 @@
1
+ import { Factory } from "@twin.org/core";
2
+ import type { ITrustGenerator } from "../models/ITrustGenerator.js";
3
+ /**
4
+ * Factory for managing generator registration and retrieval.
5
+ */
6
+ export declare const TrustGeneratorFactory: Factory<ITrustGenerator>;
@@ -0,0 +1,21 @@
1
+ import type { ITrustComponent } from "../models/ITrustComponent.js";
2
+ /**
3
+ * Helper class for trust-related operations.
4
+ */
5
+ export declare class TrustHelper {
6
+ /**
7
+ * Runtime name for the class.
8
+ */
9
+ static readonly CLASS_NAME: string;
10
+ /**
11
+ * Verify the trust payload for the action.
12
+ * @param component The trust component to use.
13
+ * @param trustPayload The trust payload to verify.
14
+ * @param action The action being performed.
15
+ * @param overrideVerifiers List of verifiers to use instead of the default ones.
16
+ * @returns The information from the trust verification.
17
+ */
18
+ static verifyTrust(component: ITrustComponent, trustPayload: unknown, action: string, overrideVerifiers?: string[]): Promise<{
19
+ [key: string]: unknown;
20
+ } | undefined>;
21
+ }
@@ -1,3 +1,6 @@
1
+ export * from "./factories/trustGeneratorFactory.js";
1
2
  export * from "./factories/trustVerifierFactory.js";
3
+ export * from "./helpers/trustHelper.js";
2
4
  export * from "./models/ITrustComponent.js";
5
+ export * from "./models/ITrustGenerator.js";
3
6
  export * from "./models/ITrustVerifier.js";
@@ -1,5 +1,4 @@
1
1
  import type { IComponent, IError } from "@twin.org/core";
2
- import type { IJsonLdNodeObject } from "@twin.org/data-json-ld";
3
2
  /**
4
3
  * Interface describing a trust component.
5
4
  */
@@ -8,13 +7,22 @@ export interface ITrustComponent extends IComponent {
8
7
  * Verify a payload by checking the validity of its structure and content using the registered verifiers.
9
8
  * @param payload The payload to verify.
10
9
  * @param overrideVerifiers List of verifiers to use instead of the default ones.
11
- * @returns Whether the payload is verified and any additional information extracted from the payload, or failures per verifier.
10
+ * @returns Whether the payload is verified and any additional information extracted from the payload, or errors.
12
11
  */
13
12
  verify(payload: unknown, overrideVerifiers?: string[]): Promise<{
14
13
  verified: boolean;
15
- info?: IJsonLdNodeObject[];
16
- failures?: {
17
- [id: string]: IError[];
14
+ info?: {
15
+ [key: string]: unknown;
18
16
  };
17
+ errors?: IError[];
19
18
  }>;
19
+ /**
20
+ * Generate a payload using the specified generators.
21
+ * @param generatorType The type of generator to use.
22
+ * @param info Optional information to include in the generated payload.
23
+ * @returns The generated payload.
24
+ */
25
+ generate(generatorType: string, info?: {
26
+ [key: string]: unknown;
27
+ }): Promise<unknown>;
20
28
  }
@@ -0,0 +1,14 @@
1
+ import type { IComponent } from "@twin.org/core";
2
+ /**
3
+ * Interface describing a trust generator component.
4
+ */
5
+ export interface ITrustGenerator extends IComponent {
6
+ /**
7
+ * Generate a trust payload.
8
+ * @param info Information to use in the generation.
9
+ * @returns The generated payload.
10
+ */
11
+ generate(info?: {
12
+ [key: string]: unknown;
13
+ }): Promise<unknown>;
14
+ }
@@ -1,5 +1,4 @@
1
1
  import type { IComponent, IError } from "@twin.org/core";
2
- import type { IJsonLdNodeObject } from "@twin.org/data-json-ld";
3
2
  /**
4
3
  * Interface describing a trust verifier component.
5
4
  */
@@ -8,10 +7,10 @@ export interface ITrustVerifier extends IComponent {
8
7
  * Verify a payload by checking the validity of its structure and content.
9
8
  * @param payload The payload to verify.
10
9
  * @param info Information extracted from previous verifiers and to be added by this verifier.
11
- * @returns Whether the payload is verified and possible verification failures, returns undefined if payload not processed.
10
+ * @param errors Array to collect verification errors.
11
+ * @returns Whether the payload is verified, returns undefined if payload was not processed.
12
12
  */
13
- verify(payload: unknown, info: IJsonLdNodeObject[]): Promise<{
14
- verified: boolean;
15
- failures?: IError[];
16
- } | undefined>;
13
+ verify(payload: unknown, info: {
14
+ [key: string]: unknown;
15
+ }, errors: IError[]): Promise<boolean | undefined>;
17
16
  }
package/docs/changelog.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.0.3-next.4](https://github.com/twinfoundation/trust/compare/trust-models-v0.0.3-next.3...trust-models-v0.0.3-next.4) (2025-12-04)
4
+
5
+
6
+ ### Features
7
+
8
+ * add generators ([6228c88](https://github.com/twinfoundation/trust/commit/6228c88a8f0244b7bdfc76b8624c427c81d23f7b))
9
+
10
+ ## [0.0.3-next.3](https://github.com/twinfoundation/trust/compare/trust-models-v0.0.3-next.2...trust-models-v0.0.3-next.3) (2025-12-04)
11
+
12
+
13
+ ### Features
14
+
15
+ * flatten error structure ([5fdd665](https://github.com/twinfoundation/trust/commit/5fdd665d0fc523a655563a0c20d1d82b634534e2))
16
+
3
17
  ## [0.0.3-next.2](https://github.com/twinfoundation/trust/compare/trust-models-v0.0.3-next.1...trust-models-v0.0.3-next.2) (2025-12-03)
4
18
 
5
19
 
@@ -0,0 +1,61 @@
1
+ # Class: TrustHelper
2
+
3
+ Helper class for trust-related operations.
4
+
5
+ ## Constructors
6
+
7
+ ### Constructor
8
+
9
+ > **new TrustHelper**(): `TrustHelper`
10
+
11
+ #### Returns
12
+
13
+ `TrustHelper`
14
+
15
+ ## Properties
16
+
17
+ ### CLASS\_NAME
18
+
19
+ > `readonly` `static` **CLASS\_NAME**: `string`
20
+
21
+ Runtime name for the class.
22
+
23
+ ## Methods
24
+
25
+ ### verifyTrust()
26
+
27
+ > `static` **verifyTrust**(`component`, `trustPayload`, `action`, `overrideVerifiers?`): `Promise`\<\{\[`key`: `string`\]: `unknown`; \} \| `undefined`\>
28
+
29
+ Verify the trust payload for the action.
30
+
31
+ #### Parameters
32
+
33
+ ##### component
34
+
35
+ [`ITrustComponent`](../interfaces/ITrustComponent.md)
36
+
37
+ The trust component to use.
38
+
39
+ ##### trustPayload
40
+
41
+ `unknown`
42
+
43
+ The trust payload to verify.
44
+
45
+ ##### action
46
+
47
+ `string`
48
+
49
+ The action being performed.
50
+
51
+ ##### overrideVerifiers?
52
+
53
+ `string`[]
54
+
55
+ List of verifiers to use instead of the default ones.
56
+
57
+ #### Returns
58
+
59
+ `Promise`\<\{\[`key`: `string`\]: `unknown`; \} \| `undefined`\>
60
+
61
+ The information from the trust verification.
@@ -1,10 +1,16 @@
1
1
  # @twin.org/trust-models
2
2
 
3
+ ## Classes
4
+
5
+ - [TrustHelper](classes/TrustHelper.md)
6
+
3
7
  ## Interfaces
4
8
 
5
9
  - [ITrustComponent](interfaces/ITrustComponent.md)
10
+ - [ITrustGenerator](interfaces/ITrustGenerator.md)
6
11
  - [ITrustVerifier](interfaces/ITrustVerifier.md)
7
12
 
8
13
  ## Variables
9
14
 
15
+ - [TrustGeneratorFactory](variables/TrustGeneratorFactory.md)
10
16
  - [TrustVerifierFactory](variables/TrustVerifierFactory.md)
@@ -10,7 +10,7 @@ Interface describing a trust component.
10
10
 
11
11
  ### verify()
12
12
 
13
- > **verify**(`payload`, `overrideVerifiers?`): `Promise`\<\{ `verified`: `boolean`; `info?`: `IJsonLdNodeObject`[]; `failures?`: \{\[`id`: `string`\]: `IError`[]; \}; \}\>
13
+ > **verify**(`payload`, `overrideVerifiers?`): `Promise`\<\{ `verified`: `boolean`; `info?`: \{\[`key`: `string`\]: `unknown`; \}; `errors?`: `IError`[]; \}\>
14
14
 
15
15
  Verify a payload by checking the validity of its structure and content using the registered verifiers.
16
16
 
@@ -30,6 +30,32 @@ List of verifiers to use instead of the default ones.
30
30
 
31
31
  #### Returns
32
32
 
33
- `Promise`\<\{ `verified`: `boolean`; `info?`: `IJsonLdNodeObject`[]; `failures?`: \{\[`id`: `string`\]: `IError`[]; \}; \}\>
33
+ `Promise`\<\{ `verified`: `boolean`; `info?`: \{\[`key`: `string`\]: `unknown`; \}; `errors?`: `IError`[]; \}\>
34
34
 
35
- Whether the payload is verified and any additional information extracted from the payload, or failures per verifier.
35
+ Whether the payload is verified and any additional information extracted from the payload, or errors.
36
+
37
+ ***
38
+
39
+ ### generate()
40
+
41
+ > **generate**(`generatorType`, `info?`): `Promise`\<`unknown`\>
42
+
43
+ Generate a payload using the specified generators.
44
+
45
+ #### Parameters
46
+
47
+ ##### generatorType
48
+
49
+ `string`
50
+
51
+ The type of generator to use.
52
+
53
+ ##### info?
54
+
55
+ Optional information to include in the generated payload.
56
+
57
+ #### Returns
58
+
59
+ `Promise`\<`unknown`\>
60
+
61
+ The generated payload.
@@ -0,0 +1,27 @@
1
+ # Interface: ITrustGenerator
2
+
3
+ Interface describing a trust generator component.
4
+
5
+ ## Extends
6
+
7
+ - `IComponent`
8
+
9
+ ## Methods
10
+
11
+ ### generate()
12
+
13
+ > **generate**(`info?`): `Promise`\<`unknown`\>
14
+
15
+ Generate a trust payload.
16
+
17
+ #### Parameters
18
+
19
+ ##### info?
20
+
21
+ Information to use in the generation.
22
+
23
+ #### Returns
24
+
25
+ `Promise`\<`unknown`\>
26
+
27
+ The generated payload.
@@ -10,7 +10,7 @@ Interface describing a trust verifier component.
10
10
 
11
11
  ### verify()
12
12
 
13
- > **verify**(`payload`, `info`): `Promise`\<\{ `verified`: `boolean`; `failures?`: `IError`[]; \} \| `undefined`\>
13
+ > **verify**(`payload`, `info`, `errors`): `Promise`\<`boolean` \| `undefined`\>
14
14
 
15
15
  Verify a payload by checking the validity of its structure and content.
16
16
 
@@ -24,12 +24,16 @@ The payload to verify.
24
24
 
25
25
  ##### info
26
26
 
27
- `IJsonLdNodeObject`[]
28
-
29
27
  Information extracted from previous verifiers and to be added by this verifier.
30
28
 
29
+ ##### errors
30
+
31
+ `IError`[]
32
+
33
+ Array to collect verification errors.
34
+
31
35
  #### Returns
32
36
 
33
- `Promise`\<\{ `verified`: `boolean`; `failures?`: `IError`[]; \} \| `undefined`\>
37
+ `Promise`\<`boolean` \| `undefined`\>
34
38
 
35
- Whether the payload is verified and possible verification failures, returns undefined if payload not processed.
39
+ Whether the payload is verified, returns undefined if payload was not processed.
@@ -0,0 +1,5 @@
1
+ # Variable: TrustGeneratorFactory
2
+
3
+ > `const` **TrustGeneratorFactory**: `Factory`\<[`ITrustGenerator`](../interfaces/ITrustGenerator.md)\>
4
+
5
+ Factory for managing generator registration and retrieval.
package/locales/en.json CHANGED
@@ -1,3 +1,7 @@
1
1
  {
2
- "error": {}
2
+ "error": {
3
+ "trustHelper": {
4
+ "trustVerifyFailed": "Trust verification failed for action \"{action}\""
5
+ }
6
+ }
3
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/trust-models",
3
- "version": "0.0.3-next.2",
3
+ "version": "0.0.3-next.4",
4
4
  "description": "Models which define the structure of the trust contracts",
5
5
  "repository": {
6
6
  "type": "git",
@@ -15,7 +15,6 @@
15
15
  },
16
16
  "dependencies": {
17
17
  "@twin.org/core": "next",
18
- "@twin.org/data-json-ld": "next",
19
18
  "@twin.org/nameof": "next"
20
19
  },
21
20
  "main": "./dist/es/index.js",