@twin.org/hierarchies-models 0.9.0-next.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.
Files changed (148) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +17 -0
  3. package/dist/es/factories/hierarchiesConnectorFactory.js +9 -0
  4. package/dist/es/factories/hierarchiesConnectorFactory.js.map +1 -0
  5. package/dist/es/index.js +37 -0
  6. package/dist/es/index.js.map +1 -0
  7. package/dist/es/models/IAccreditation.js +2 -0
  8. package/dist/es/models/IAccreditation.js.map +1 -0
  9. package/dist/es/models/IFederation.js +2 -0
  10. package/dist/es/models/IFederation.js.map +1 -0
  11. package/dist/es/models/IGovernance.js +2 -0
  12. package/dist/es/models/IGovernance.js.map +1 -0
  13. package/dist/es/models/IHierarchiesComponent.js +2 -0
  14. package/dist/es/models/IHierarchiesComponent.js.map +1 -0
  15. package/dist/es/models/IHierarchiesConnector.js +2 -0
  16. package/dist/es/models/IHierarchiesConnector.js.map +1 -0
  17. package/dist/es/models/IProperty.js +2 -0
  18. package/dist/es/models/IProperty.js.map +1 -0
  19. package/dist/es/models/IPropertyCondition.js +2 -0
  20. package/dist/es/models/IPropertyCondition.js.map +1 -0
  21. package/dist/es/models/IPropertyValue.js +2 -0
  22. package/dist/es/models/IPropertyValue.js.map +1 -0
  23. package/dist/es/models/IRootAuthority.js +4 -0
  24. package/dist/es/models/IRootAuthority.js.map +1 -0
  25. package/dist/es/models/ITimespan.js +4 -0
  26. package/dist/es/models/ITimespan.js.map +1 -0
  27. package/dist/es/models/api/IHierarchiesAccreditationAddRequest.js +2 -0
  28. package/dist/es/models/api/IHierarchiesAccreditationAddRequest.js.map +1 -0
  29. package/dist/es/models/api/IHierarchiesAccreditationGetRequest.js +4 -0
  30. package/dist/es/models/api/IHierarchiesAccreditationGetRequest.js.map +1 -0
  31. package/dist/es/models/api/IHierarchiesAccreditationGetResponse.js +2 -0
  32. package/dist/es/models/api/IHierarchiesAccreditationGetResponse.js.map +1 -0
  33. package/dist/es/models/api/IHierarchiesAccreditationRemoveRequest.js +4 -0
  34. package/dist/es/models/api/IHierarchiesAccreditationRemoveRequest.js.map +1 -0
  35. package/dist/es/models/api/IHierarchiesAccreditationsGetRequest.js +4 -0
  36. package/dist/es/models/api/IHierarchiesAccreditationsGetRequest.js.map +1 -0
  37. package/dist/es/models/api/IHierarchiesAccreditationsGetResponse.js +2 -0
  38. package/dist/es/models/api/IHierarchiesAccreditationsGetResponse.js.map +1 -0
  39. package/dist/es/models/api/IHierarchiesAuthorityAddRequest.js +4 -0
  40. package/dist/es/models/api/IHierarchiesAuthorityAddRequest.js.map +1 -0
  41. package/dist/es/models/api/IHierarchiesAuthorityRemoveRequest.js +4 -0
  42. package/dist/es/models/api/IHierarchiesAuthorityRemoveRequest.js.map +1 -0
  43. package/dist/es/models/api/IHierarchiesFederationCreateRequest.js +4 -0
  44. package/dist/es/models/api/IHierarchiesFederationCreateRequest.js.map +1 -0
  45. package/dist/es/models/api/IHierarchiesFederationGetRequest.js +4 -0
  46. package/dist/es/models/api/IHierarchiesFederationGetRequest.js.map +1 -0
  47. package/dist/es/models/api/IHierarchiesFederationGetResponse.js +2 -0
  48. package/dist/es/models/api/IHierarchiesFederationGetResponse.js.map +1 -0
  49. package/dist/es/models/api/IHierarchiesPropertiesGetRequest.js +4 -0
  50. package/dist/es/models/api/IHierarchiesPropertiesGetRequest.js.map +1 -0
  51. package/dist/es/models/api/IHierarchiesPropertiesGetResponse.js +2 -0
  52. package/dist/es/models/api/IHierarchiesPropertiesGetResponse.js.map +1 -0
  53. package/dist/es/models/api/IHierarchiesPropertiesValidateRequest.js +2 -0
  54. package/dist/es/models/api/IHierarchiesPropertiesValidateRequest.js.map +1 -0
  55. package/dist/es/models/api/IHierarchiesPropertiesValidateResponse.js +4 -0
  56. package/dist/es/models/api/IHierarchiesPropertiesValidateResponse.js.map +1 -0
  57. package/dist/es/models/api/IHierarchiesPropertyAddRequest.js +2 -0
  58. package/dist/es/models/api/IHierarchiesPropertyAddRequest.js.map +1 -0
  59. package/dist/es/models/api/IHierarchiesPropertyGetRequest.js +4 -0
  60. package/dist/es/models/api/IHierarchiesPropertyGetRequest.js.map +1 -0
  61. package/dist/es/models/api/IHierarchiesPropertyGetResponse.js +2 -0
  62. package/dist/es/models/api/IHierarchiesPropertyGetResponse.js.map +1 -0
  63. package/dist/es/models/api/IHierarchiesPropertyRemoveRequest.js +4 -0
  64. package/dist/es/models/api/IHierarchiesPropertyRemoveRequest.js.map +1 -0
  65. package/dist/es/models/api/IHierarchiesPropertyValidateRequest.js +2 -0
  66. package/dist/es/models/api/IHierarchiesPropertyValidateRequest.js.map +1 -0
  67. package/dist/es/models/api/IHierarchiesPropertyValidateResponse.js +4 -0
  68. package/dist/es/models/api/IHierarchiesPropertyValidateResponse.js.map +1 -0
  69. package/dist/es/models/propertyConstraintType.js +29 -0
  70. package/dist/es/models/propertyConstraintType.js.map +1 -0
  71. package/dist/es/models/propertyType.js +17 -0
  72. package/dist/es/models/propertyType.js.map +1 -0
  73. package/dist/types/factories/hierarchiesConnectorFactory.d.ts +6 -0
  74. package/dist/types/index.d.ts +34 -0
  75. package/dist/types/models/IAccreditation.d.ts +18 -0
  76. package/dist/types/models/IFederation.d.ts +24 -0
  77. package/dist/types/models/IGovernance.d.ts +28 -0
  78. package/dist/types/models/IHierarchiesComponent.d.ts +160 -0
  79. package/dist/types/models/IHierarchiesConnector.d.ts +159 -0
  80. package/dist/types/models/IProperty.d.ts +24 -0
  81. package/dist/types/models/IPropertyCondition.d.ts +19 -0
  82. package/dist/types/models/IPropertyValue.d.ts +14 -0
  83. package/dist/types/models/IRootAuthority.d.ts +13 -0
  84. package/dist/types/models/ITimespan.d.ts +13 -0
  85. package/dist/types/models/api/IHierarchiesAccreditationAddRequest.d.ts +19 -0
  86. package/dist/types/models/api/IHierarchiesAccreditationGetRequest.d.ts +22 -0
  87. package/dist/types/models/api/IHierarchiesAccreditationGetResponse.d.ts +10 -0
  88. package/dist/types/models/api/IHierarchiesAccreditationRemoveRequest.d.ts +22 -0
  89. package/dist/types/models/api/IHierarchiesAccreditationsGetRequest.d.ts +18 -0
  90. package/dist/types/models/api/IHierarchiesAccreditationsGetResponse.d.ts +10 -0
  91. package/dist/types/models/api/IHierarchiesAuthorityAddRequest.d.ts +23 -0
  92. package/dist/types/models/api/IHierarchiesAuthorityRemoveRequest.d.ts +18 -0
  93. package/dist/types/models/api/IHierarchiesFederationCreateRequest.d.ts +18 -0
  94. package/dist/types/models/api/IHierarchiesFederationGetRequest.d.ts +23 -0
  95. package/dist/types/models/api/IHierarchiesFederationGetResponse.d.ts +10 -0
  96. package/dist/types/models/api/IHierarchiesPropertiesGetRequest.d.ts +23 -0
  97. package/dist/types/models/api/IHierarchiesPropertiesGetResponse.d.ts +10 -0
  98. package/dist/types/models/api/IHierarchiesPropertiesValidateRequest.d.ts +30 -0
  99. package/dist/types/models/api/IHierarchiesPropertiesValidateResponse.d.ts +14 -0
  100. package/dist/types/models/api/IHierarchiesPropertyAddRequest.d.ts +19 -0
  101. package/dist/types/models/api/IHierarchiesPropertyGetRequest.d.ts +18 -0
  102. package/dist/types/models/api/IHierarchiesPropertyGetResponse.d.ts +10 -0
  103. package/dist/types/models/api/IHierarchiesPropertyRemoveRequest.d.ts +18 -0
  104. package/dist/types/models/api/IHierarchiesPropertyValidateRequest.d.ts +32 -0
  105. package/dist/types/models/api/IHierarchiesPropertyValidateResponse.d.ts +14 -0
  106. package/dist/types/models/propertyConstraintType.d.ts +29 -0
  107. package/dist/types/models/propertyType.d.ts +17 -0
  108. package/docs/changelog.md +11 -0
  109. package/docs/examples.md +74 -0
  110. package/docs/reference/index.md +46 -0
  111. package/docs/reference/interfaces/IAccreditation.md +27 -0
  112. package/docs/reference/interfaces/IFederation.md +36 -0
  113. package/docs/reference/interfaces/IGovernance.md +44 -0
  114. package/docs/reference/interfaces/IHierarchiesAccreditationAddRequest.md +25 -0
  115. package/docs/reference/interfaces/IHierarchiesAccreditationGetRequest.md +29 -0
  116. package/docs/reference/interfaces/IHierarchiesAccreditationGetResponse.md +11 -0
  117. package/docs/reference/interfaces/IHierarchiesAccreditationRemoveRequest.md +29 -0
  118. package/docs/reference/interfaces/IHierarchiesAccreditationsGetRequest.md +23 -0
  119. package/docs/reference/interfaces/IHierarchiesAccreditationsGetResponse.md +11 -0
  120. package/docs/reference/interfaces/IHierarchiesAuthorityAddRequest.md +31 -0
  121. package/docs/reference/interfaces/IHierarchiesAuthorityRemoveRequest.md +23 -0
  122. package/docs/reference/interfaces/IHierarchiesComponent.md +613 -0
  123. package/docs/reference/interfaces/IHierarchiesConnector.md +607 -0
  124. package/docs/reference/interfaces/IHierarchiesFederationCreateRequest.md +23 -0
  125. package/docs/reference/interfaces/IHierarchiesFederationGetRequest.md +31 -0
  126. package/docs/reference/interfaces/IHierarchiesFederationGetResponse.md +11 -0
  127. package/docs/reference/interfaces/IHierarchiesPropertiesGetRequest.md +31 -0
  128. package/docs/reference/interfaces/IHierarchiesPropertiesGetResponse.md +11 -0
  129. package/docs/reference/interfaces/IHierarchiesPropertiesValidateRequest.md +41 -0
  130. package/docs/reference/interfaces/IHierarchiesPropertiesValidateResponse.md +17 -0
  131. package/docs/reference/interfaces/IHierarchiesPropertyAddRequest.md +25 -0
  132. package/docs/reference/interfaces/IHierarchiesPropertyGetRequest.md +23 -0
  133. package/docs/reference/interfaces/IHierarchiesPropertyGetResponse.md +11 -0
  134. package/docs/reference/interfaces/IHierarchiesPropertyRemoveRequest.md +23 -0
  135. package/docs/reference/interfaces/IHierarchiesPropertyValidateRequest.md +43 -0
  136. package/docs/reference/interfaces/IHierarchiesPropertyValidateResponse.md +17 -0
  137. package/docs/reference/interfaces/IProperty.md +35 -0
  138. package/docs/reference/interfaces/IPropertyCondition.md +27 -0
  139. package/docs/reference/interfaces/IPropertyValue.md +19 -0
  140. package/docs/reference/interfaces/IRootAuthority.md +19 -0
  141. package/docs/reference/interfaces/ITimespan.md +19 -0
  142. package/docs/reference/type-aliases/PropertyConstraintType.md +5 -0
  143. package/docs/reference/type-aliases/PropertyType.md +5 -0
  144. package/docs/reference/variables/HierarchiesConnectorFactory.md +5 -0
  145. package/docs/reference/variables/PropertyConstraintType.md +37 -0
  146. package/docs/reference/variables/PropertyType.md +19 -0
  147. package/locales/en.json +3 -0
  148. package/package.json +53 -0
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Request to get federation accreditation.
3
+ */
4
+ export interface IHierarchiesAccreditationGetRequest {
5
+ /**
6
+ * The request path parameters.
7
+ */
8
+ pathParams: {
9
+ /**
10
+ * The id of the federation to get.
11
+ */
12
+ federationId: string;
13
+ /**
14
+ * The id of the authority for which to get the accreditation.
15
+ */
16
+ accreditedById: string;
17
+ /**
18
+ * The id of the permission for which to get the accreditation.
19
+ */
20
+ permissionId: string;
21
+ };
22
+ }
@@ -0,0 +1,10 @@
1
+ import type { IAccreditation } from "../IAccreditation.js";
2
+ /**
3
+ * Response for getting an accreditation.
4
+ */
5
+ export interface IHierarchiesAccreditationGetResponse {
6
+ /**
7
+ * The response body.
8
+ */
9
+ body: IAccreditation;
10
+ }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Request to remove an accreditation from a federation.
3
+ */
4
+ export interface IHierarchiesAccreditationRemoveRequest {
5
+ /**
6
+ * The request path parameters.
7
+ */
8
+ pathParams: {
9
+ /**
10
+ * The id of the federation.
11
+ */
12
+ federationId: string;
13
+ /**
14
+ * The accredited by id.
15
+ */
16
+ accreditedById: string;
17
+ /**
18
+ * The permission id of the accreditation to remove.
19
+ */
20
+ permissionId: string;
21
+ };
22
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Request to get federation accreditations.
3
+ */
4
+ export interface IHierarchiesAccreditationsGetRequest {
5
+ /**
6
+ * The request path parameters.
7
+ */
8
+ pathParams: {
9
+ /**
10
+ * The id of the federation to get.
11
+ */
12
+ federationId: string;
13
+ /**
14
+ * The id of the authority for which to get the accreditations.
15
+ */
16
+ accreditedById: string;
17
+ };
18
+ }
@@ -0,0 +1,10 @@
1
+ import type { IAccreditation } from "../IAccreditation.js";
2
+ /**
3
+ * Response for getting accreditations.
4
+ */
5
+ export interface IHierarchiesAccreditationsGetResponse {
6
+ /**
7
+ * The response body.
8
+ */
9
+ body: IAccreditation[];
10
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Request to add an authority to a federation.
3
+ */
4
+ export interface IHierarchiesAuthorityAddRequest {
5
+ /**
6
+ * The request path parameters.
7
+ */
8
+ pathParams: {
9
+ /**
10
+ * The id of the federation.
11
+ */
12
+ federationId: string;
13
+ };
14
+ /**
15
+ * The request data.
16
+ */
17
+ body: {
18
+ /**
19
+ * The account id of the authority to add.
20
+ */
21
+ accountId: string;
22
+ };
23
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Request to remove an authority from a federation.
3
+ */
4
+ export interface IHierarchiesAuthorityRemoveRequest {
5
+ /**
6
+ * The request path parameters.
7
+ */
8
+ pathParams: {
9
+ /**
10
+ * The id of the federation.
11
+ */
12
+ federationId: string;
13
+ /**
14
+ * The account id of the authority to remove.
15
+ */
16
+ accountId: string;
17
+ };
18
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Request to create a federation.
3
+ */
4
+ export interface IHierarchiesFederationCreateRequest {
5
+ /**
6
+ * The request data.
7
+ */
8
+ body: {
9
+ /**
10
+ * The root authorities to be included in the federation.
11
+ */
12
+ rootAuthorities?: string[];
13
+ /**
14
+ * The namespace of the connector to use for the federation, defaults to component configured namespace.
15
+ */
16
+ namespace?: string;
17
+ };
18
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Request to get a federation.
3
+ */
4
+ export interface IHierarchiesFederationGetRequest {
5
+ /**
6
+ * The request path parameters.
7
+ */
8
+ pathParams: {
9
+ /**
10
+ * The id of the federation to get.
11
+ */
12
+ federationId: string;
13
+ };
14
+ /**
15
+ * The request query parameters.
16
+ */
17
+ query?: {
18
+ /**
19
+ * Whether to include revoked properties in the retrieved federation, defaults to false.
20
+ */
21
+ includeRevokedProperties?: string;
22
+ };
23
+ }
@@ -0,0 +1,10 @@
1
+ import type { IFederation } from "../IFederation.js";
2
+ /**
3
+ * Response for getting a federation.
4
+ */
5
+ export interface IHierarchiesFederationGetResponse {
6
+ /**
7
+ * The response body.
8
+ */
9
+ body: IFederation;
10
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Request to get federation properties.
3
+ */
4
+ export interface IHierarchiesPropertiesGetRequest {
5
+ /**
6
+ * The request path parameters.
7
+ */
8
+ pathParams: {
9
+ /**
10
+ * The id of the federation to get.
11
+ */
12
+ federationId: string;
13
+ };
14
+ /**
15
+ * The request query parameters.
16
+ */
17
+ query?: {
18
+ /**
19
+ * Whether to include revoked properties in the retrieved federation, defaults to false.
20
+ */
21
+ includeRevokedProperties?: string;
22
+ };
23
+ }
@@ -0,0 +1,10 @@
1
+ import type { IProperty } from "../IProperty.js";
2
+ /**
3
+ * Response for getting properties.
4
+ */
5
+ export interface IHierarchiesPropertiesGetResponse {
6
+ /**
7
+ * The response body.
8
+ */
9
+ body: IProperty[];
10
+ }
@@ -0,0 +1,30 @@
1
+ import type { IPropertyValue } from "../IPropertyValue.js";
2
+ /**
3
+ * Request to validate properties for a federation.
4
+ */
5
+ export interface IHierarchiesPropertiesValidateRequest {
6
+ /**
7
+ * The request path parameters.
8
+ */
9
+ pathParams: {
10
+ /**
11
+ * The id of the federation.
12
+ */
13
+ federationId: string;
14
+ };
15
+ /**
16
+ * The request data.
17
+ */
18
+ body: {
19
+ /**
20
+ * The accredited by id.
21
+ */
22
+ accreditedById: string;
23
+ /**
24
+ * The properties to validate.
25
+ */
26
+ propertiesToValidate: {
27
+ [propertyName: string]: IPropertyValue;
28
+ };
29
+ };
30
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Response for properties validation.
3
+ */
4
+ export interface IHierarchiesPropertiesValidateResponse {
5
+ /**
6
+ * The response body.
7
+ */
8
+ body: {
9
+ /**
10
+ * Whether all provided properties are valid.
11
+ */
12
+ valid: boolean;
13
+ };
14
+ }
@@ -0,0 +1,19 @@
1
+ import type { IProperty } from "../IProperty.js";
2
+ /**
3
+ * Request to add a property to a federation.
4
+ */
5
+ export interface IHierarchiesPropertyAddRequest {
6
+ /**
7
+ * The request path parameters.
8
+ */
9
+ pathParams: {
10
+ /**
11
+ * The id of the federation.
12
+ */
13
+ federationId: string;
14
+ };
15
+ /**
16
+ * The request data.
17
+ */
18
+ body: IProperty;
19
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Request to get a property from a federation.
3
+ */
4
+ export interface IHierarchiesPropertyGetRequest {
5
+ /**
6
+ * The request path parameters.
7
+ */
8
+ pathParams: {
9
+ /**
10
+ * The id of the federation.
11
+ */
12
+ federationId: string;
13
+ /**
14
+ * The property name to get.
15
+ */
16
+ propertyName: string;
17
+ };
18
+ }
@@ -0,0 +1,10 @@
1
+ import type { IProperty } from "../IProperty.js";
2
+ /**
3
+ * Response for getting a property.
4
+ */
5
+ export interface IHierarchiesPropertyGetResponse {
6
+ /**
7
+ * The response body.
8
+ */
9
+ body: IProperty;
10
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Request to remove a property from a federation.
3
+ */
4
+ export interface IHierarchiesPropertyRemoveRequest {
5
+ /**
6
+ * The request path parameters.
7
+ */
8
+ pathParams: {
9
+ /**
10
+ * The id of the federation.
11
+ */
12
+ federationId: string;
13
+ /**
14
+ * The property name to remove.
15
+ */
16
+ propertyName: string;
17
+ };
18
+ }
@@ -0,0 +1,32 @@
1
+ import type { IPropertyValue } from "../IPropertyValue.js";
2
+ /**
3
+ * Request to validate a property for a federation.
4
+ */
5
+ export interface IHierarchiesPropertyValidateRequest {
6
+ /**
7
+ * The request path parameters.
8
+ */
9
+ pathParams: {
10
+ /**
11
+ * The id of the federation.
12
+ */
13
+ federationId: string;
14
+ };
15
+ /**
16
+ * The request data.
17
+ */
18
+ body: {
19
+ /**
20
+ * The accredited by id.
21
+ */
22
+ accreditedById: string;
23
+ /**
24
+ * The property name to validate.
25
+ */
26
+ propertyName: string;
27
+ /**
28
+ * The property value to validate.
29
+ */
30
+ propertyValue: IPropertyValue;
31
+ };
32
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Response for property validation.
3
+ */
4
+ export interface IHierarchiesPropertyValidateResponse {
5
+ /**
6
+ * The response body.
7
+ */
8
+ body: {
9
+ /**
10
+ * Whether the provided property is valid.
11
+ */
12
+ valid: boolean;
13
+ };
14
+ }
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Defines the types of constraints that can be applied to federation properties.
3
+ */
4
+ export declare const PropertyConstraintType: {
5
+ /**
6
+ * Value must contain a specific substring.
7
+ */
8
+ readonly Contains: "Contains";
9
+ /**
10
+ * Value must start with a specific substring.
11
+ */
12
+ readonly StartsWith: "StartsWith";
13
+ /**
14
+ * Value must end with a specific substring.
15
+ */
16
+ readonly EndsWith: "EndsWith";
17
+ /**
18
+ * Value must be greater than a specific value.
19
+ */
20
+ readonly GreaterThan: "GreaterThan";
21
+ /**
22
+ * Value must be less than a specific value.
23
+ */
24
+ readonly LessThan: "LessThan";
25
+ };
26
+ /**
27
+ * Type representing the possible condition types.
28
+ */
29
+ export type PropertyConstraintType = (typeof PropertyConstraintType)[keyof typeof PropertyConstraintType];
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Defines the supported data types for property values.
3
+ */
4
+ export declare const PropertyType: {
5
+ /**
6
+ * Value is a string.
7
+ */
8
+ readonly String: "String";
9
+ /**
10
+ * Value is a bigint.
11
+ */
12
+ readonly BigInt: "BigInt";
13
+ };
14
+ /**
15
+ * Type representing the possible property types.
16
+ */
17
+ export type PropertyType = (typeof PropertyType)[keyof typeof PropertyType];
@@ -0,0 +1,11 @@
1
+ # Changelog
2
+
3
+ ## [0.9.0-next.1](https://github.com/iotaledger/twin-hierarchies/compare/hierarchies-models-v0.9.0-next.0...hierarchies-models-v0.9.0-next.1) (2026-06-23)
4
+
5
+
6
+ ### Features
7
+
8
+ * initial commit ([ac40c22](https://github.com/iotaledger/twin-hierarchies/commit/ac40c2293568c8e08fd0a9b86c7ae54d202f8091))
9
+ * typescript 6 update ([a9b3e37](https://github.com/iotaledger/twin-hierarchies/commit/a9b3e374df98413b2a98bccbd1bc95cf48a9e210))
10
+
11
+ ## Changelog
@@ -0,0 +1,74 @@
1
+ # Hierarchies Models Examples
2
+
3
+ This package provides interfaces and types for working with federations, properties, accreditations, and connector factories in digital asset hierarchies.
4
+
5
+ ## HierarchiesConnectorFactory
6
+
7
+ ```typescript
8
+ import { HierarchiesConnectorFactory } from '@twin.org/hierarchies-models';
9
+
10
+ // Register a connector implementation
11
+ HierarchiesConnectorFactory.register('custom', () => new CustomHierarchiesConnector());
12
+
13
+ // Create a connector instance
14
+ const connector = HierarchiesConnectorFactory.create('custom');
15
+ ```
16
+
17
+ ## IHierarchiesConnector
18
+
19
+ ```typescript
20
+ import type { IHierarchiesConnector, IProperty } from '@twin.org/hierarchies-models';
21
+
22
+ async function addProperty(
23
+ connector: IHierarchiesConnector,
24
+ federationId: string,
25
+ property: IProperty
26
+ ) {
27
+ await connector.propertyAdd('controller-1', federationId, property);
28
+ }
29
+
30
+ async function getFederation(connector: IHierarchiesConnector, federationId: string) {
31
+ const federation = await connector.federationGet(federationId);
32
+ console.log(federation.id); // "fed-123"
33
+ }
34
+ ```
35
+
36
+ ## IFederation
37
+
38
+ ```typescript
39
+ import type { IFederation } from '@twin.org/hierarchies-models';
40
+
41
+ function printRootAuthorities(federation: IFederation) {
42
+ federation.rootAuthorities.forEach(auth => {
43
+ console.log(auth.id); // "root-1"
44
+ });
45
+ }
46
+ ```
47
+
48
+ ## IProperty
49
+
50
+ ```typescript
51
+ import type { IProperty, IPropertyValue } from '@twin.org/hierarchies-models';
52
+ import { PropertyType } from '@twin.org/hierarchies-models';
53
+
54
+ const property: IProperty = {
55
+ name: 'access.level',
56
+ allowedValues: [{ type: PropertyType.String, value: 'admin' }]
57
+ };
58
+
59
+ const value: IPropertyValue = { type: PropertyType.String, value: 'admin' };
60
+ console.log(property.allowedValues?.[0].value); // "admin"
61
+ ```
62
+
63
+ ## IAccreditation
64
+
65
+ ```typescript
66
+ import type { IAccreditation, IProperty } from '@twin.org/hierarchies-models';
67
+
68
+ const accreditation: IAccreditation = {
69
+ permissionId: 'perm-1',
70
+ accreditedBy: 'authority-1',
71
+ properties: [{ name: 'access.level', allowedValues: [{ type: 'String', value: 'admin' }] }]
72
+ };
73
+ console.log(accreditation.accreditedBy); // "authority-1"
74
+ ```
@@ -0,0 +1,46 @@
1
+ # @twin.org/hierarchies-models
2
+
3
+ ## Interfaces
4
+
5
+ - [IAccreditation](interfaces/IAccreditation.md)
6
+ - [IFederation](interfaces/IFederation.md)
7
+ - [IGovernance](interfaces/IGovernance.md)
8
+ - [IHierarchiesComponent](interfaces/IHierarchiesComponent.md)
9
+ - [IHierarchiesConnector](interfaces/IHierarchiesConnector.md)
10
+ - [IProperty](interfaces/IProperty.md)
11
+ - [IPropertyCondition](interfaces/IPropertyCondition.md)
12
+ - [IPropertyValue](interfaces/IPropertyValue.md)
13
+ - [IRootAuthority](interfaces/IRootAuthority.md)
14
+ - [ITimespan](interfaces/ITimespan.md)
15
+ - [IHierarchiesAccreditationAddRequest](interfaces/IHierarchiesAccreditationAddRequest.md)
16
+ - [IHierarchiesAccreditationGetRequest](interfaces/IHierarchiesAccreditationGetRequest.md)
17
+ - [IHierarchiesAccreditationGetResponse](interfaces/IHierarchiesAccreditationGetResponse.md)
18
+ - [IHierarchiesAccreditationRemoveRequest](interfaces/IHierarchiesAccreditationRemoveRequest.md)
19
+ - [IHierarchiesAccreditationsGetRequest](interfaces/IHierarchiesAccreditationsGetRequest.md)
20
+ - [IHierarchiesAccreditationsGetResponse](interfaces/IHierarchiesAccreditationsGetResponse.md)
21
+ - [IHierarchiesAuthorityAddRequest](interfaces/IHierarchiesAuthorityAddRequest.md)
22
+ - [IHierarchiesAuthorityRemoveRequest](interfaces/IHierarchiesAuthorityRemoveRequest.md)
23
+ - [IHierarchiesFederationCreateRequest](interfaces/IHierarchiesFederationCreateRequest.md)
24
+ - [IHierarchiesFederationGetRequest](interfaces/IHierarchiesFederationGetRequest.md)
25
+ - [IHierarchiesFederationGetResponse](interfaces/IHierarchiesFederationGetResponse.md)
26
+ - [IHierarchiesPropertiesGetRequest](interfaces/IHierarchiesPropertiesGetRequest.md)
27
+ - [IHierarchiesPropertiesGetResponse](interfaces/IHierarchiesPropertiesGetResponse.md)
28
+ - [IHierarchiesPropertiesValidateRequest](interfaces/IHierarchiesPropertiesValidateRequest.md)
29
+ - [IHierarchiesPropertiesValidateResponse](interfaces/IHierarchiesPropertiesValidateResponse.md)
30
+ - [IHierarchiesPropertyAddRequest](interfaces/IHierarchiesPropertyAddRequest.md)
31
+ - [IHierarchiesPropertyGetRequest](interfaces/IHierarchiesPropertyGetRequest.md)
32
+ - [IHierarchiesPropertyGetResponse](interfaces/IHierarchiesPropertyGetResponse.md)
33
+ - [IHierarchiesPropertyRemoveRequest](interfaces/IHierarchiesPropertyRemoveRequest.md)
34
+ - [IHierarchiesPropertyValidateRequest](interfaces/IHierarchiesPropertyValidateRequest.md)
35
+ - [IHierarchiesPropertyValidateResponse](interfaces/IHierarchiesPropertyValidateResponse.md)
36
+
37
+ ## Type Aliases
38
+
39
+ - [PropertyConstraintType](type-aliases/PropertyConstraintType.md)
40
+ - [PropertyType](type-aliases/PropertyType.md)
41
+
42
+ ## Variables
43
+
44
+ - [HierarchiesConnectorFactory](variables/HierarchiesConnectorFactory.md)
45
+ - [PropertyConstraintType](variables/PropertyConstraintType.md)
46
+ - [PropertyType](variables/PropertyType.md)
@@ -0,0 +1,27 @@
1
+ # Interface: IAccreditation
2
+
3
+ Represents an accreditation, which is a collection of properties granted by an accreditor.
4
+
5
+ ## Properties
6
+
7
+ ### permissionId {#permissionid}
8
+
9
+ > **permissionId**: `string`
10
+
11
+ Unique identifier for the accreditation.
12
+
13
+ ***
14
+
15
+ ### accreditedBy {#accreditedby}
16
+
17
+ > **accreditedBy**: `string`
18
+
19
+ The identifier of the entity that granted the accreditation.
20
+
21
+ ***
22
+
23
+ ### properties {#properties}
24
+
25
+ > **properties**: [`IProperty`](IProperty.md)[]
26
+
27
+ Properties associated with this accreditation.
@@ -0,0 +1,36 @@
1
+ # Interface: IFederation
2
+
3
+ Represents a federation, which is a group of entities forming a trust hierarchy.
4
+ Federations define the root authorities and the schema for properties they manage.
5
+
6
+ ## Properties
7
+
8
+ ### id {#id}
9
+
10
+ > **id**: `string`
11
+
12
+ Unique identifier for the federation.
13
+
14
+ ***
15
+
16
+ ### rootAuthorities {#rootauthorities}
17
+
18
+ > **rootAuthorities**: [`IRootAuthority`](IRootAuthority.md)[]
19
+
20
+ List of root authority IDs associated with this federation.
21
+
22
+ ***
23
+
24
+ ### revokedRootAuthorities {#revokedrootauthorities}
25
+
26
+ > **revokedRootAuthorities**: `string`[]
27
+
28
+ Account IDs of root authorities that have been revoked and are no longer trusted.
29
+
30
+ ***
31
+
32
+ ### governance {#governance}
33
+
34
+ > **governance**: [`IGovernance`](IGovernance.md)
35
+
36
+ The governance entity that manages accreditations and attestations within the federation.
@@ -0,0 +1,44 @@
1
+ # Interface: IGovernance
2
+
3
+ Represents a governance entity in a federation hierarchy.
4
+ Governance entities are trusted entities that can accredit or revoke delegations.
5
+
6
+ ## Properties
7
+
8
+ ### id {#id}
9
+
10
+ > **id**: `string`
11
+
12
+ Unique identifier for the governance entity.
13
+
14
+ ***
15
+
16
+ ### accreditationsToAccredit {#accreditationstoaccredit}
17
+
18
+ > **accreditationsToAccredit**: `object`
19
+
20
+ Map of accredited-by ID to the list of accreditations that grant the right to accredit others.
21
+
22
+ #### Index Signature
23
+
24
+ \[`id`: `string`\]: [`IAccreditation`](IAccreditation.md)[]
25
+
26
+ ***
27
+
28
+ ### accreditationsToAttest {#accreditationstoattest}
29
+
30
+ > **accreditationsToAttest**: `object`
31
+
32
+ Map of accredited-by ID to the list of accreditations that grant the right to attest properties.
33
+
34
+ #### Index Signature
35
+
36
+ \[`id`: `string`\]: [`IAccreditation`](IAccreditation.md)[]
37
+
38
+ ***
39
+
40
+ ### properties {#properties}
41
+
42
+ > **properties**: [`IProperty`](IProperty.md)[]
43
+
44
+ The set of properties this governance entity covers.