@twin.org/identity-models 0.0.1-next.20 → 0.0.1-next.22
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/cjs/index.cjs +9 -0
- package/dist/esm/index.mjs +9 -1
- package/dist/types/factories/identityResolverConnectorFactory.d.ts +6 -0
- package/dist/types/index.d.ts +5 -2
- package/dist/types/models/IIdentityComponent.d.ts +0 -6
- package/dist/types/models/IIdentityConnector.d.ts +0 -7
- package/dist/types/models/IIdentityResolverComponent.d.ts +13 -0
- package/dist/types/models/IIdentityResolverConnector.d.ts +14 -0
- package/docs/changelog.md +1 -1
- package/docs/reference/index.md +5 -2
- package/docs/reference/interfaces/IIdentityComponent.md +0 -22
- package/docs/reference/interfaces/IIdentityConnector.md +0 -26
- package/docs/reference/interfaces/IIdentityResolverComponent.md +29 -0
- package/docs/reference/interfaces/IIdentityResolverConnector.md +33 -0
- package/docs/reference/variables/IdentityResolverConnectorFactory.md +5 -0
- package/package.json +3 -3
- /package/dist/types/models/api/{identity → resolver}/IIdentityResolveRequest.d.ts +0 -0
- /package/dist/types/models/api/{identity → resolver}/IIdentityResolveResponse.d.ts +0 -0
package/dist/cjs/index.cjs
CHANGED
|
@@ -19,6 +19,14 @@ const IdentityConnectorFactory = core.Factory.createFactory("identity-connector"
|
|
|
19
19
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
20
20
|
const IdentityProfileConnectorFactory = core.Factory.createFactory("identity-profile-connector");
|
|
21
21
|
|
|
22
|
+
// Copyright 2024 IOTA Stiftung.
|
|
23
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
24
|
+
/**
|
|
25
|
+
* Factory for creating identity resolver connectors.
|
|
26
|
+
*/
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
28
|
+
const IdentityResolverConnectorFactory = core.Factory.createFactory("identity-resolver-connector");
|
|
29
|
+
|
|
22
30
|
// Copyright 2024 IOTA Stiftung.
|
|
23
31
|
// SPDX-License-Identifier: Apache-2.0.
|
|
24
32
|
/**
|
|
@@ -86,4 +94,5 @@ class JwtHelper {
|
|
|
86
94
|
exports.DocumentHelper = DocumentHelper;
|
|
87
95
|
exports.IdentityConnectorFactory = IdentityConnectorFactory;
|
|
88
96
|
exports.IdentityProfileConnectorFactory = IdentityProfileConnectorFactory;
|
|
97
|
+
exports.IdentityResolverConnectorFactory = IdentityResolverConnectorFactory;
|
|
89
98
|
exports.JwtHelper = JwtHelper;
|
package/dist/esm/index.mjs
CHANGED
|
@@ -17,6 +17,14 @@ const IdentityConnectorFactory = Factory.createFactory("identity-connector");
|
|
|
17
17
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
18
18
|
const IdentityProfileConnectorFactory = Factory.createFactory("identity-profile-connector");
|
|
19
19
|
|
|
20
|
+
// Copyright 2024 IOTA Stiftung.
|
|
21
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
22
|
+
/**
|
|
23
|
+
* Factory for creating identity resolver connectors.
|
|
24
|
+
*/
|
|
25
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
26
|
+
const IdentityResolverConnectorFactory = Factory.createFactory("identity-resolver-connector");
|
|
27
|
+
|
|
20
28
|
// Copyright 2024 IOTA Stiftung.
|
|
21
29
|
// SPDX-License-Identifier: Apache-2.0.
|
|
22
30
|
/**
|
|
@@ -81,4 +89,4 @@ class JwtHelper {
|
|
|
81
89
|
}
|
|
82
90
|
}
|
|
83
91
|
|
|
84
|
-
export { DocumentHelper, IdentityConnectorFactory, IdentityProfileConnectorFactory, JwtHelper };
|
|
92
|
+
export { DocumentHelper, IdentityConnectorFactory, IdentityProfileConnectorFactory, IdentityResolverConnectorFactory, JwtHelper };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Factory } from "@twin.org/core";
|
|
2
|
+
import type { IIdentityResolverConnector } from "../models/IIdentityResolverConnector";
|
|
3
|
+
/**
|
|
4
|
+
* Factory for creating identity resolver connectors.
|
|
5
|
+
*/
|
|
6
|
+
export declare const IdentityResolverConnectorFactory: Factory<IIdentityResolverConnector>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export * from "./factories/identityConnectorFactory";
|
|
2
2
|
export * from "./factories/identityProfileConnectorFactory";
|
|
3
|
-
export * from "./
|
|
4
|
-
export * from "./models/api/identity/IIdentityResolveResponse";
|
|
3
|
+
export * from "./factories/identityResolverConnectorFactory";
|
|
5
4
|
export * from "./models/api/profile/IIdentityProfileCreateRequest";
|
|
6
5
|
export * from "./models/api/profile/IIdentityProfileGetPublicRequest";
|
|
7
6
|
export * from "./models/api/profile/IIdentityProfileGetPublicResponse";
|
|
@@ -10,9 +9,13 @@ export * from "./models/api/profile/IIdentityProfileGetResponse";
|
|
|
10
9
|
export * from "./models/api/profile/IIdentityProfileListRequest";
|
|
11
10
|
export * from "./models/api/profile/IIdentityProfileListResponse";
|
|
12
11
|
export * from "./models/api/profile/IIdentityProfileUpdateRequest";
|
|
12
|
+
export * from "./models/api/resolver/IIdentityResolveRequest";
|
|
13
|
+
export * from "./models/api/resolver/IIdentityResolveResponse";
|
|
13
14
|
export * from "./models/IIdentityComponent";
|
|
14
15
|
export * from "./models/IIdentityConnector";
|
|
15
16
|
export * from "./models/IIdentityProfileComponent";
|
|
16
17
|
export * from "./models/IIdentityProfileConnector";
|
|
18
|
+
export * from "./models/IIdentityResolverComponent";
|
|
19
|
+
export * from "./models/IIdentityResolverConnector";
|
|
17
20
|
export * from "./utils/documentHelper";
|
|
18
21
|
export * from "./utils/jwtHelper";
|
|
@@ -12,12 +12,6 @@ export interface IIdentityComponent extends IComponent {
|
|
|
12
12
|
* @returns The created identity document.
|
|
13
13
|
*/
|
|
14
14
|
identityCreate(controller: string, namespace?: string): Promise<IDidDocument>;
|
|
15
|
-
/**
|
|
16
|
-
* Resolve an identity.
|
|
17
|
-
* @param identity The id of the document to resolve.
|
|
18
|
-
* @returns The resolved document.
|
|
19
|
-
*/
|
|
20
|
-
identityResolve(identity: string): Promise<IDidDocument>;
|
|
21
15
|
/**
|
|
22
16
|
* Add a verification method to the document in JSON Web key Format.
|
|
23
17
|
* @param controller The controller of the identity who can make changes.
|
|
@@ -11,13 +11,6 @@ export interface IIdentityConnector extends IComponent {
|
|
|
11
11
|
* @returns The created document.
|
|
12
12
|
*/
|
|
13
13
|
createDocument(controller: string): Promise<IDidDocument>;
|
|
14
|
-
/**
|
|
15
|
-
* Resolve a document from its id.
|
|
16
|
-
* @param documentId The id of the document to resolve.
|
|
17
|
-
* @returns The resolved document.
|
|
18
|
-
* @throws NotFoundError if the id can not be resolved.
|
|
19
|
-
*/
|
|
20
|
-
resolveDocument(documentId: string): Promise<IDidDocument>;
|
|
21
14
|
/**
|
|
22
15
|
* Add a verification method to the document in JSON Web key Format.
|
|
23
16
|
* @param controller The controller of the identity who can make changes.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { IComponent } from "@twin.org/core";
|
|
2
|
+
import type { IDidDocument } from "@twin.org/standards-w3c-did";
|
|
3
|
+
/**
|
|
4
|
+
* Interface describing a contract which provides identity operations.
|
|
5
|
+
*/
|
|
6
|
+
export interface IIdentityResolverComponent extends IComponent {
|
|
7
|
+
/**
|
|
8
|
+
* Resolve an identity.
|
|
9
|
+
* @param identity The id of the document to resolve.
|
|
10
|
+
* @returns The resolved document.
|
|
11
|
+
*/
|
|
12
|
+
identityResolve(identity: string): Promise<IDidDocument>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { IComponent } from "@twin.org/core";
|
|
2
|
+
import type { IDidDocument } from "@twin.org/standards-w3c-did";
|
|
3
|
+
/**
|
|
4
|
+
* Interface describing an identity connector.
|
|
5
|
+
*/
|
|
6
|
+
export interface IIdentityResolverConnector extends IComponent {
|
|
7
|
+
/**
|
|
8
|
+
* Resolve a document from its id.
|
|
9
|
+
* @param documentId The id of the document to resolve.
|
|
10
|
+
* @returns The resolved document.
|
|
11
|
+
* @throws NotFoundError if the id can not be resolved.
|
|
12
|
+
*/
|
|
13
|
+
resolveDocument(documentId: string): Promise<IDidDocument>;
|
|
14
|
+
}
|
package/docs/changelog.md
CHANGED
package/docs/reference/index.md
CHANGED
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
- [IIdentityConnector](interfaces/IIdentityConnector.md)
|
|
12
12
|
- [IIdentityProfileComponent](interfaces/IIdentityProfileComponent.md)
|
|
13
13
|
- [IIdentityProfileConnector](interfaces/IIdentityProfileConnector.md)
|
|
14
|
-
- [
|
|
15
|
-
- [
|
|
14
|
+
- [IIdentityResolverComponent](interfaces/IIdentityResolverComponent.md)
|
|
15
|
+
- [IIdentityResolverConnector](interfaces/IIdentityResolverConnector.md)
|
|
16
16
|
- [IIdentityProfileCreateRequest](interfaces/IIdentityProfileCreateRequest.md)
|
|
17
17
|
- [IIdentityProfileGetPublicRequest](interfaces/IIdentityProfileGetPublicRequest.md)
|
|
18
18
|
- [IIdentityProfileGetPublicResponse](interfaces/IIdentityProfileGetPublicResponse.md)
|
|
@@ -21,8 +21,11 @@
|
|
|
21
21
|
- [IIdentityProfileListRequest](interfaces/IIdentityProfileListRequest.md)
|
|
22
22
|
- [IIdentityProfileListResponse](interfaces/IIdentityProfileListResponse.md)
|
|
23
23
|
- [IIdentityProfileUpdateRequest](interfaces/IIdentityProfileUpdateRequest.md)
|
|
24
|
+
- [IIdentityResolveRequest](interfaces/IIdentityResolveRequest.md)
|
|
25
|
+
- [IIdentityResolveResponse](interfaces/IIdentityResolveResponse.md)
|
|
24
26
|
|
|
25
27
|
## Variables
|
|
26
28
|
|
|
27
29
|
- [IdentityConnectorFactory](variables/IdentityConnectorFactory.md)
|
|
28
30
|
- [IdentityProfileConnectorFactory](variables/IdentityProfileConnectorFactory.md)
|
|
31
|
+
- [IdentityResolverConnectorFactory](variables/IdentityResolverConnectorFactory.md)
|
|
@@ -36,28 +36,6 @@ The created identity document.
|
|
|
36
36
|
|
|
37
37
|
***
|
|
38
38
|
|
|
39
|
-
### identityResolve()
|
|
40
|
-
|
|
41
|
-
> **identityResolve**(`identity`): `Promise`\<`IDidDocument`\>
|
|
42
|
-
|
|
43
|
-
Resolve an identity.
|
|
44
|
-
|
|
45
|
-
#### Parameters
|
|
46
|
-
|
|
47
|
-
##### identity
|
|
48
|
-
|
|
49
|
-
`string`
|
|
50
|
-
|
|
51
|
-
The id of the document to resolve.
|
|
52
|
-
|
|
53
|
-
#### Returns
|
|
54
|
-
|
|
55
|
-
`Promise`\<`IDidDocument`\>
|
|
56
|
-
|
|
57
|
-
The resolved document.
|
|
58
|
-
|
|
59
|
-
***
|
|
60
|
-
|
|
61
39
|
### verificationMethodCreate()
|
|
62
40
|
|
|
63
41
|
> **verificationMethodCreate**(`controller`, `identity`, `verificationMethodType`, `verificationMethodId`?): `Promise`\<`IDidDocumentVerificationMethod`\>
|
|
@@ -30,32 +30,6 @@ The created document.
|
|
|
30
30
|
|
|
31
31
|
***
|
|
32
32
|
|
|
33
|
-
### resolveDocument()
|
|
34
|
-
|
|
35
|
-
> **resolveDocument**(`documentId`): `Promise`\<`IDidDocument`\>
|
|
36
|
-
|
|
37
|
-
Resolve a document from its id.
|
|
38
|
-
|
|
39
|
-
#### Parameters
|
|
40
|
-
|
|
41
|
-
##### documentId
|
|
42
|
-
|
|
43
|
-
`string`
|
|
44
|
-
|
|
45
|
-
The id of the document to resolve.
|
|
46
|
-
|
|
47
|
-
#### Returns
|
|
48
|
-
|
|
49
|
-
`Promise`\<`IDidDocument`\>
|
|
50
|
-
|
|
51
|
-
The resolved document.
|
|
52
|
-
|
|
53
|
-
#### Throws
|
|
54
|
-
|
|
55
|
-
NotFoundError if the id can not be resolved.
|
|
56
|
-
|
|
57
|
-
***
|
|
58
|
-
|
|
59
33
|
### addVerificationMethod()
|
|
60
34
|
|
|
61
35
|
> **addVerificationMethod**(`controller`, `documentId`, `verificationMethodType`, `verificationMethodId`?): `Promise`\<`IDidDocumentVerificationMethod`\>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Interface: IIdentityResolverComponent
|
|
2
|
+
|
|
3
|
+
Interface describing a contract which provides identity operations.
|
|
4
|
+
|
|
5
|
+
## Extends
|
|
6
|
+
|
|
7
|
+
- `IComponent`
|
|
8
|
+
|
|
9
|
+
## Methods
|
|
10
|
+
|
|
11
|
+
### identityResolve()
|
|
12
|
+
|
|
13
|
+
> **identityResolve**(`identity`): `Promise`\<`IDidDocument`\>
|
|
14
|
+
|
|
15
|
+
Resolve an identity.
|
|
16
|
+
|
|
17
|
+
#### Parameters
|
|
18
|
+
|
|
19
|
+
##### identity
|
|
20
|
+
|
|
21
|
+
`string`
|
|
22
|
+
|
|
23
|
+
The id of the document to resolve.
|
|
24
|
+
|
|
25
|
+
#### Returns
|
|
26
|
+
|
|
27
|
+
`Promise`\<`IDidDocument`\>
|
|
28
|
+
|
|
29
|
+
The resolved document.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Interface: IIdentityResolverConnector
|
|
2
|
+
|
|
3
|
+
Interface describing an identity connector.
|
|
4
|
+
|
|
5
|
+
## Extends
|
|
6
|
+
|
|
7
|
+
- `IComponent`
|
|
8
|
+
|
|
9
|
+
## Methods
|
|
10
|
+
|
|
11
|
+
### resolveDocument()
|
|
12
|
+
|
|
13
|
+
> **resolveDocument**(`documentId`): `Promise`\<`IDidDocument`\>
|
|
14
|
+
|
|
15
|
+
Resolve a document from its id.
|
|
16
|
+
|
|
17
|
+
#### Parameters
|
|
18
|
+
|
|
19
|
+
##### documentId
|
|
20
|
+
|
|
21
|
+
`string`
|
|
22
|
+
|
|
23
|
+
The id of the document to resolve.
|
|
24
|
+
|
|
25
|
+
#### Returns
|
|
26
|
+
|
|
27
|
+
`Promise`\<`IDidDocument`\>
|
|
28
|
+
|
|
29
|
+
The resolved document.
|
|
30
|
+
|
|
31
|
+
#### Throws
|
|
32
|
+
|
|
33
|
+
NotFoundError if the id can not be resolved.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/identity-models",
|
|
3
|
-
"version": "0.0.1-next.
|
|
3
|
+
"version": "0.0.1-next.22",
|
|
4
4
|
"description": "Models which define the structure of the contracts and connectors",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"types": "./dist/types/index.d.ts",
|
|
27
27
|
"exports": {
|
|
28
28
|
".": {
|
|
29
|
+
"types": "./dist/types/index.d.ts",
|
|
29
30
|
"require": "./dist/cjs/index.cjs",
|
|
30
|
-
"import": "./dist/esm/index.mjs"
|
|
31
|
-
"types": "./dist/types/index.d.ts"
|
|
31
|
+
"import": "./dist/esm/index.mjs"
|
|
32
32
|
},
|
|
33
33
|
"./locales/*.json": "./locales/*.json"
|
|
34
34
|
},
|
|
File without changes
|
|
File without changes
|