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

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.
@@ -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\";\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"]}
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 identity The identity for which to generate the payload.\n\t * @param generatorType The type of generator to use, defaults to the default generator type or first in factory.\n\t * @param info Optional information to include in the generated payload.\n\t * @returns The generated payload.\n\t */\n\tgenerate(\n\t\tidentity: string,\n\t\tgeneratorType?: string,\n\t\tinfo?: { [key: string]: unknown }\n\t): Promise<unknown>;\n}\n"]}
@@ -1 +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
+ {"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 identity The identity for which to generate the payload.\n\t * @param info Information to use in the generation.\n\t * @returns The generated payload.\n\t */\n\tgenerate(identity: string, info?: { [key: string]: unknown }): Promise<unknown>;\n}\n"]}
@@ -18,11 +18,12 @@ export interface ITrustComponent extends IComponent {
18
18
  }>;
19
19
  /**
20
20
  * Generate a payload using the specified generators.
21
- * @param generatorType The type of generator to use.
21
+ * @param identity The identity for which to generate the payload.
22
+ * @param generatorType The type of generator to use, defaults to the default generator type or first in factory.
22
23
  * @param info Optional information to include in the generated payload.
23
24
  * @returns The generated payload.
24
25
  */
25
- generate(generatorType: string, info?: {
26
+ generate(identity: string, generatorType?: string, info?: {
26
27
  [key: string]: unknown;
27
28
  }): Promise<unknown>;
28
29
  }
@@ -5,10 +5,11 @@ import type { IComponent } from "@twin.org/core";
5
5
  export interface ITrustGenerator extends IComponent {
6
6
  /**
7
7
  * Generate a trust payload.
8
+ * @param identity The identity for which to generate the payload.
8
9
  * @param info Information to use in the generation.
9
10
  * @returns The generated payload.
10
11
  */
11
- generate(info?: {
12
+ generate(identity: string, info?: {
12
13
  [key: string]: unknown;
13
14
  }): Promise<unknown>;
14
15
  }
package/docs/changelog.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.0.3-next.5](https://github.com/twinfoundation/trust/compare/trust-models-v0.0.3-next.4...trust-models-v0.0.3-next.5) (2025-12-04)
4
+
5
+
6
+ ### Features
7
+
8
+ * add default generator config ([54d98ba](https://github.com/twinfoundation/trust/commit/54d98ba53b7450b56337daeda504437be0d21943))
9
+
3
10
  ## [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
11
 
5
12
 
@@ -38,17 +38,23 @@ Whether the payload is verified and any additional information extracted from th
38
38
 
39
39
  ### generate()
40
40
 
41
- > **generate**(`generatorType`, `info?`): `Promise`\<`unknown`\>
41
+ > **generate**(`identity`, `generatorType?`, `info?`): `Promise`\<`unknown`\>
42
42
 
43
43
  Generate a payload using the specified generators.
44
44
 
45
45
  #### Parameters
46
46
 
47
- ##### generatorType
47
+ ##### identity
48
48
 
49
49
  `string`
50
50
 
51
- The type of generator to use.
51
+ The identity for which to generate the payload.
52
+
53
+ ##### generatorType?
54
+
55
+ `string`
56
+
57
+ The type of generator to use, defaults to the default generator type or first in factory.
52
58
 
53
59
  ##### info?
54
60
 
@@ -10,12 +10,18 @@ Interface describing a trust generator component.
10
10
 
11
11
  ### generate()
12
12
 
13
- > **generate**(`info?`): `Promise`\<`unknown`\>
13
+ > **generate**(`identity`, `info?`): `Promise`\<`unknown`\>
14
14
 
15
15
  Generate a trust payload.
16
16
 
17
17
  #### Parameters
18
18
 
19
+ ##### identity
20
+
21
+ `string`
22
+
23
+ The identity for which to generate the payload.
24
+
19
25
  ##### info?
20
26
 
21
27
  Information to use in the generation.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/trust-models",
3
- "version": "0.0.3-next.4",
3
+ "version": "0.0.3-next.5",
4
4
  "description": "Models which define the structure of the trust contracts",
5
5
  "repository": {
6
6
  "type": "git",