@twin.org/trust-models 0.0.3-next.1 → 0.0.3-next.3
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/es/models/ITrustComponent.js.map +1 -1
- package/dist/es/models/ITrustVerifier.js.map +1 -1
- package/dist/types/models/ITrustComponent.d.ts +2 -4
- package/dist/types/models/ITrustVerifier.d.ts +4 -6
- package/docs/changelog.md +14 -0
- package/docs/reference/interfaces/ITrustComponent.md +3 -3
- package/docs/reference/interfaces/ITrustVerifier.md +15 -3
- package/package.json +1 -1
|
@@ -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
|
|
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 errors.\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\terrors?: IError[];\n\t}>;\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 * @
|
|
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 * @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: IJsonLdNodeObject[],\n\t\terrors: IError[]\n\t): Promise<boolean | undefined>;\n}\n"]}
|
|
@@ -8,13 +8,11 @@ export interface ITrustComponent extends IComponent {
|
|
|
8
8
|
* Verify a payload by checking the validity of its structure and content using the registered verifiers.
|
|
9
9
|
* @param payload The payload to verify.
|
|
10
10
|
* @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
|
|
11
|
+
* @returns Whether the payload is verified and any additional information extracted from the payload, or errors.
|
|
12
12
|
*/
|
|
13
13
|
verify(payload: unknown, overrideVerifiers?: string[]): Promise<{
|
|
14
14
|
verified: boolean;
|
|
15
15
|
info?: IJsonLdNodeObject[];
|
|
16
|
-
|
|
17
|
-
[id: string]: IError[];
|
|
18
|
-
};
|
|
16
|
+
errors?: IError[];
|
|
19
17
|
}>;
|
|
20
18
|
}
|
|
@@ -7,11 +7,9 @@ export interface ITrustVerifier extends IComponent {
|
|
|
7
7
|
/**
|
|
8
8
|
* Verify a payload by checking the validity of its structure and content.
|
|
9
9
|
* @param payload The payload to verify.
|
|
10
|
-
* @
|
|
10
|
+
* @param info Information extracted from previous verifiers and to be added by this verifier.
|
|
11
|
+
* @param errors Array to collect verification errors.
|
|
12
|
+
* @returns Whether the payload is verified, returns undefined if payload was not processed.
|
|
11
13
|
*/
|
|
12
|
-
verify(payload: unknown): Promise<
|
|
13
|
-
verified: boolean;
|
|
14
|
-
info?: IJsonLdNodeObject[];
|
|
15
|
-
failures?: IError[];
|
|
16
|
-
}>;
|
|
14
|
+
verify(payload: unknown, info: IJsonLdNodeObject[], errors: IError[]): Promise<boolean | undefined>;
|
|
17
15
|
}
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [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)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* flatten error structure ([5fdd665](https://github.com/twinfoundation/trust/commit/5fdd665d0fc523a655563a0c20d1d82b634534e2))
|
|
9
|
+
|
|
10
|
+
## [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)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* support pass through of info between verifiers ([1ce64b9](https://github.com/twinfoundation/trust/commit/1ce64b97a949278b447cc12b576ce5de537f30f3))
|
|
16
|
+
|
|
3
17
|
## [0.0.3-next.1](https://github.com/twinfoundation/trust/compare/trust-models-v0.0.3-next.0...trust-models-v0.0.3-next.1) (2025-12-02)
|
|
4
18
|
|
|
5
19
|
|
|
@@ -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`[]; `
|
|
13
|
+
> **verify**(`payload`, `overrideVerifiers?`): `Promise`\<\{ `verified`: `boolean`; `info?`: `IJsonLdNodeObject`[]; `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,6 @@ List of verifiers to use instead of the default ones.
|
|
|
30
30
|
|
|
31
31
|
#### Returns
|
|
32
32
|
|
|
33
|
-
`Promise`\<\{ `verified`: `boolean`; `info?`: `IJsonLdNodeObject`[]; `
|
|
33
|
+
`Promise`\<\{ `verified`: `boolean`; `info?`: `IJsonLdNodeObject`[]; `errors?`: `IError`[]; \}\>
|
|
34
34
|
|
|
35
|
-
Whether the payload is verified and any additional information extracted from the payload, or
|
|
35
|
+
Whether the payload is verified and any additional information extracted from the payload, or errors.
|
|
@@ -10,7 +10,7 @@ Interface describing a trust verifier component.
|
|
|
10
10
|
|
|
11
11
|
### verify()
|
|
12
12
|
|
|
13
|
-
> **verify**(`payload`): `Promise
|
|
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
|
|
|
@@ -22,8 +22,20 @@ Verify a payload by checking the validity of its structure and content.
|
|
|
22
22
|
|
|
23
23
|
The payload to verify.
|
|
24
24
|
|
|
25
|
+
##### info
|
|
26
|
+
|
|
27
|
+
`IJsonLdNodeObject`[]
|
|
28
|
+
|
|
29
|
+
Information extracted from previous verifiers and to be added by this verifier.
|
|
30
|
+
|
|
31
|
+
##### errors
|
|
32
|
+
|
|
33
|
+
`IError`[]
|
|
34
|
+
|
|
35
|
+
Array to collect verification errors.
|
|
36
|
+
|
|
25
37
|
#### Returns
|
|
26
38
|
|
|
27
|
-
`Promise
|
|
39
|
+
`Promise`\<`boolean` \| `undefined`\>
|
|
28
40
|
|
|
29
|
-
Whether the payload is verified
|
|
41
|
+
Whether the payload is verified, returns undefined if payload was not processed.
|