@twin.org/identity-models 0.0.3-next.2 → 0.0.3-next.20
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/README.md +3 -3
- package/dist/es/contextIdHandlers/didContextIdHandler.js +7 -0
- package/dist/es/contextIdHandlers/didContextIdHandler.js.map +1 -1
- package/dist/es/index.js +4 -0
- package/dist/es/index.js.map +1 -1
- package/dist/es/models/IIdentityComponent.js.map +1 -1
- package/dist/es/models/IIdentityConnector.js.map +1 -1
- package/dist/es/models/api/identity/IIdentityAlsoKnownAsCreateRequest.js +4 -0
- package/dist/es/models/api/identity/IIdentityAlsoKnownAsCreateRequest.js.map +1 -0
- package/dist/es/models/api/identity/IIdentityAlsoKnownAsRemoveRequest.js +4 -0
- package/dist/es/models/api/identity/IIdentityAlsoKnownAsRemoveRequest.js.map +1 -0
- package/dist/es/models/api/identity/IIdentityVerifiableCredentialRevokeRequest.js.map +1 -1
- package/dist/es/models/api/identity/IIdentityVerifiableCredentialUnrevokeRequest.js.map +1 -1
- package/dist/es/models/api/identity/IIdentityVerifiableCredentialVerifyDocumentRequest.js +2 -0
- package/dist/es/models/api/identity/IIdentityVerifiableCredentialVerifyDocumentRequest.js.map +1 -0
- package/dist/es/models/api/identity/IIdentityVerifiablePresentationCreateRequest.js.map +1 -1
- package/dist/es/models/api/identity/IIdentityVerifiablePresentationVerifyDocumentRequest.js +2 -0
- package/dist/es/models/api/identity/IIdentityVerifiablePresentationVerifyDocumentRequest.js.map +1 -0
- package/dist/types/contextIdHandlers/didContextIdHandler.d.ts +5 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/models/IIdentityComponent.d.ts +31 -6
- package/dist/types/models/IIdentityConnector.d.ts +31 -6
- package/dist/types/models/api/identity/IIdentityAlsoKnownAsCreateRequest.d.ts +23 -0
- package/dist/types/models/api/identity/IIdentityAlsoKnownAsRemoveRequest.d.ts +18 -0
- package/dist/types/models/api/identity/IIdentityVerifiableCredentialRevokeRequest.d.ts +1 -1
- package/dist/types/models/api/identity/IIdentityVerifiableCredentialUnrevokeRequest.d.ts +1 -1
- package/dist/types/models/api/identity/IIdentityVerifiableCredentialVerifyDocumentRequest.d.ts +10 -0
- package/dist/types/models/api/identity/IIdentityVerifiablePresentationCreateRequest.d.ts +2 -2
- package/dist/types/models/api/identity/IIdentityVerifiablePresentationVerifyDocumentRequest.d.ts +10 -0
- package/docs/changelog.md +240 -75
- package/docs/examples.md +157 -1
- package/docs/reference/classes/Did.md +4 -4
- package/docs/reference/classes/DidContextIdHandler.md +21 -3
- package/docs/reference/classes/DocumentHelper.md +5 -5
- package/docs/reference/classes/VerificationHelper.md +3 -3
- package/docs/reference/index.md +4 -0
- package/docs/reference/interfaces/IIdentityAlsoKnownAsCreateRequest.md +31 -0
- package/docs/reference/interfaces/IIdentityAlsoKnownAsRemoveRequest.md +23 -0
- package/docs/reference/interfaces/IIdentityComponent.md +126 -36
- package/docs/reference/interfaces/IIdentityConnector.md +126 -36
- package/docs/reference/interfaces/IIdentityCreateRequest.md +3 -3
- package/docs/reference/interfaces/IIdentityCreateResponse.md +1 -1
- package/docs/reference/interfaces/IIdentityProfileComponent.md +6 -6
- package/docs/reference/interfaces/IIdentityProfileConnector.md +5 -5
- package/docs/reference/interfaces/IIdentityProfileCreateRequest.md +3 -3
- package/docs/reference/interfaces/IIdentityProfileGetPublicRequest.md +4 -4
- package/docs/reference/interfaces/IIdentityProfileGetPublicResponse.md +2 -2
- package/docs/reference/interfaces/IIdentityProfileGetRequest.md +4 -4
- package/docs/reference/interfaces/IIdentityProfileGetResponse.md +3 -3
- package/docs/reference/interfaces/IIdentityProfileListRequest.md +6 -6
- package/docs/reference/interfaces/IIdentityProfileListResponse.md +2 -2
- package/docs/reference/interfaces/IIdentityProfileUpdateRequest.md +3 -3
- package/docs/reference/interfaces/IIdentityProofCreateRequest.md +2 -2
- package/docs/reference/interfaces/IIdentityProofCreateResponse.md +1 -1
- package/docs/reference/interfaces/IIdentityProofVerifyRequest.md +1 -1
- package/docs/reference/interfaces/IIdentityProofVerifyResponse.md +1 -1
- package/docs/reference/interfaces/IIdentityRemoveRequest.md +1 -1
- package/docs/reference/interfaces/IIdentityResolveRequest.md +1 -1
- package/docs/reference/interfaces/IIdentityResolveResponse.md +1 -1
- package/docs/reference/interfaces/IIdentityResolverComponent.md +1 -1
- package/docs/reference/interfaces/IIdentityResolverConnector.md +1 -1
- package/docs/reference/interfaces/IIdentityServiceCreateRequest.md +2 -2
- package/docs/reference/interfaces/IIdentityServiceCreateResponse.md +1 -1
- package/docs/reference/interfaces/IIdentityServiceRemoveRequest.md +1 -1
- package/docs/reference/interfaces/IIdentityVerifiableCredentialCreateRequest.md +5 -5
- package/docs/reference/interfaces/IIdentityVerifiableCredentialCreateResponse.md +1 -1
- package/docs/reference/interfaces/IIdentityVerifiableCredentialRevokeRequest.md +2 -2
- package/docs/reference/interfaces/IIdentityVerifiableCredentialUnrevokeRequest.md +2 -2
- package/docs/reference/interfaces/IIdentityVerifiableCredentialVerifyDocumentRequest.md +11 -0
- package/docs/reference/interfaces/IIdentityVerifiableCredentialVerifyRequest.md +1 -1
- package/docs/reference/interfaces/IIdentityVerifiableCredentialVerifyResponse.md +2 -2
- package/docs/reference/interfaces/IIdentityVerifiablePresentationCreateRequest.md +8 -8
- package/docs/reference/interfaces/IIdentityVerifiablePresentationCreateResponse.md +1 -1
- package/docs/reference/interfaces/IIdentityVerifiablePresentationVerifyDocumentRequest.md +11 -0
- package/docs/reference/interfaces/IIdentityVerifiablePresentationVerifyRequest.md +1 -1
- package/docs/reference/interfaces/IIdentityVerifiablePresentationVerifyResponse.md +3 -3
- package/docs/reference/interfaces/IIdentityVerificationMethodCreateRequest.md +3 -3
- package/docs/reference/interfaces/IIdentityVerificationMethodCreateResponse.md +1 -1
- package/docs/reference/interfaces/IIdentityVerificationMethodRemoveRequest.md +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
# TWIN Identity
|
|
1
|
+
# TWIN Identity
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The identity-models package provides shared identity models and contracts that establish a consistent structure for identity workflows across the repository. It helps reduce integration friction between services, connectors, and clients by defining a common representation of identity entities and related payloads.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```shell
|
|
8
|
-
npm install @twin.org/identity-
|
|
8
|
+
npm install @twin.org/identity-models
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## Examples
|
|
@@ -8,6 +8,13 @@ export class DidContextIdHandler {
|
|
|
8
8
|
* Runtime name for the class.
|
|
9
9
|
*/
|
|
10
10
|
static CLASS_NAME = "DidContextIdHandler";
|
|
11
|
+
/**
|
|
12
|
+
* The class name of the component.
|
|
13
|
+
* @returns The class name.
|
|
14
|
+
*/
|
|
15
|
+
className() {
|
|
16
|
+
return DidContextIdHandler.CLASS_NAME;
|
|
17
|
+
}
|
|
11
18
|
/**
|
|
12
19
|
* Get the short form of the DID which is the last part.
|
|
13
20
|
* @param value The full context id value.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"didContextIdHandler.js","sourceRoot":"","sources":["../../../src/contextIdHandlers/didContextIdHandler.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEtD,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEtC;;GAEG;AACH,MAAM,OAAO,mBAAmB;IAC/B;;OAEG;IACI,MAAM,CAAU,UAAU,yBAAyC;IAE1E;;;;OAIG;IACI,KAAK,CAAC,KAAa;QACzB,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC/B,yEAAyE;QACzE,IAAI,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE,CAAC;YACtE,MAAM,KAAK,GAAG,SAAS,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YAC7C,OAAO,SAAS,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;QAC1C,CAAC;QACD,OAAO,KAAK,CAAC,EAAE,CAAC;IACjB,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,KAAa;QACzB,GAAG,CAAC,KAAK,CAAC,mBAAmB,CAAC,UAAU,WAAiB,KAAK,CAAC,CAAC;IACjE,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IContextIdHandler } from \"@twin.org/context\";\nimport { Converter, HexHelper } from \"@twin.org/core\";\nimport { nameof } from \"@twin.org/nameof\";\nimport { Did } from \"../types/did.js\";\n\n/**\n * Context Id handler for testing as a DID.\n */\nexport class DidContextIdHandler implements IContextIdHandler {\n\t/**\n\t * Runtime name for the class.\n\t */\n\tpublic static readonly CLASS_NAME: string = nameof<DidContextIdHandler>();\n\n\t/**\n\t * Get the short form of the DID which is the last part.\n\t * @param value The full context id value.\n\t * @returns Short form string.\n\t */\n\tpublic short(value: string): string {\n\t\tconst parts = Did.parse(value);\n\t\t// If the ID part is hex, convert to base64 for a shorter representation.\n\t\tif (HexHelper.hasPrefix(parts.id) && HexHelper.isHex(parts.id, true)) {\n\t\t\tconst bytes = Converter.hexToBytes(parts.id);\n\t\t\treturn Converter.bytesToBase64Url(bytes);\n\t\t}\n\t\treturn parts.id;\n\t}\n\n\t/**\n\t * Guard the value ensuring length.\n\t * @param value The value to guard.\n\t * @throws GeneralError if the value is too short.\n\t */\n\tpublic guard(value: string): void {\n\t\tDid.guard(DidContextIdHandler.CLASS_NAME, nameof(value), value);\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"didContextIdHandler.js","sourceRoot":"","sources":["../../../src/contextIdHandlers/didContextIdHandler.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEtD,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEtC;;GAEG;AACH,MAAM,OAAO,mBAAmB;IAC/B;;OAEG;IACI,MAAM,CAAU,UAAU,yBAAyC;IAE1E;;;OAGG;IACI,SAAS;QACf,OAAO,mBAAmB,CAAC,UAAU,CAAC;IACvC,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,KAAa;QACzB,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC/B,yEAAyE;QACzE,IAAI,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE,CAAC;YACtE,MAAM,KAAK,GAAG,SAAS,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YAC7C,OAAO,SAAS,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;QAC1C,CAAC;QACD,OAAO,KAAK,CAAC,EAAE,CAAC;IACjB,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,KAAa;QACzB,GAAG,CAAC,KAAK,CAAC,mBAAmB,CAAC,UAAU,WAAiB,KAAK,CAAC,CAAC;IACjE,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IContextIdHandler } from \"@twin.org/context\";\nimport { Converter, HexHelper } from \"@twin.org/core\";\nimport { nameof } from \"@twin.org/nameof\";\nimport { Did } from \"../types/did.js\";\n\n/**\n * Context Id handler for testing as a DID.\n */\nexport class DidContextIdHandler implements IContextIdHandler {\n\t/**\n\t * Runtime name for the class.\n\t */\n\tpublic static readonly CLASS_NAME: string = nameof<DidContextIdHandler>();\n\n\t/**\n\t * The class name of the component.\n\t * @returns The class name.\n\t */\n\tpublic className(): string {\n\t\treturn DidContextIdHandler.CLASS_NAME;\n\t}\n\n\t/**\n\t * Get the short form of the DID which is the last part.\n\t * @param value The full context id value.\n\t * @returns Short form string.\n\t */\n\tpublic short(value: string): string {\n\t\tconst parts = Did.parse(value);\n\t\t// If the ID part is hex, convert to base64 for a shorter representation.\n\t\tif (HexHelper.hasPrefix(parts.id) && HexHelper.isHex(parts.id, true)) {\n\t\t\tconst bytes = Converter.hexToBytes(parts.id);\n\t\t\treturn Converter.bytesToBase64Url(bytes);\n\t\t}\n\t\treturn parts.id;\n\t}\n\n\t/**\n\t * Guard the value ensuring length.\n\t * @param value The value to guard.\n\t * @throws GeneralError if the value is too short.\n\t */\n\tpublic guard(value: string): void {\n\t\tDid.guard(DidContextIdHandler.CLASS_NAME, nameof(value), value);\n\t}\n}\n"]}
|
package/dist/es/index.js
CHANGED
|
@@ -4,6 +4,8 @@ export * from "./contextIdHandlers/didContextIdHandler.js";
|
|
|
4
4
|
export * from "./factories/identityConnectorFactory.js";
|
|
5
5
|
export * from "./factories/identityProfileConnectorFactory.js";
|
|
6
6
|
export * from "./factories/identityResolverConnectorFactory.js";
|
|
7
|
+
export * from "./models/api/identity/IIdentityAlsoKnownAsCreateRequest.js";
|
|
8
|
+
export * from "./models/api/identity/IIdentityAlsoKnownAsRemoveRequest.js";
|
|
7
9
|
export * from "./models/api/identity/IIdentityCreateRequest.js";
|
|
8
10
|
export * from "./models/api/identity/IIdentityCreateResponse.js";
|
|
9
11
|
export * from "./models/api/identity/IIdentityProofCreateRequest.js";
|
|
@@ -18,10 +20,12 @@ export * from "./models/api/identity/IIdentityVerifiableCredentialCreateRequest.
|
|
|
18
20
|
export * from "./models/api/identity/IIdentityVerifiableCredentialCreateResponse.js";
|
|
19
21
|
export * from "./models/api/identity/IIdentityVerifiableCredentialRevokeRequest.js";
|
|
20
22
|
export * from "./models/api/identity/IIdentityVerifiableCredentialUnrevokeRequest.js";
|
|
23
|
+
export * from "./models/api/identity/IIdentityVerifiableCredentialVerifyDocumentRequest.js";
|
|
21
24
|
export * from "./models/api/identity/IIdentityVerifiableCredentialVerifyRequest.js";
|
|
22
25
|
export * from "./models/api/identity/IIdentityVerifiableCredentialVerifyResponse.js";
|
|
23
26
|
export * from "./models/api/identity/IIdentityVerifiablePresentationCreateRequest.js";
|
|
24
27
|
export * from "./models/api/identity/IIdentityVerifiablePresentationCreateResponse.js";
|
|
28
|
+
export * from "./models/api/identity/IIdentityVerifiablePresentationVerifyDocumentRequest.js";
|
|
25
29
|
export * from "./models/api/identity/IIdentityVerifiablePresentationVerifyRequest.js";
|
|
26
30
|
export * from "./models/api/identity/IIdentityVerifiablePresentationVerifyResponse.js";
|
|
27
31
|
export * from "./models/api/identity/IIdentityVerificationMethodCreateRequest.js";
|
package/dist/es/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,cAAc,4CAA4C,CAAC;AAC3D,cAAc,yCAAyC,CAAC;AACxD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,iDAAiD,CAAC;AAChE,cAAc,iDAAiD,CAAC;AAChE,cAAc,kDAAkD,CAAC;AACjE,cAAc,sDAAsD,CAAC;AACrE,cAAc,uDAAuD,CAAC;AACtE,cAAc,sDAAsD,CAAC;AACrE,cAAc,uDAAuD,CAAC;AACtE,cAAc,iDAAiD,CAAC;AAChE,cAAc,wDAAwD,CAAC;AACvE,cAAc,yDAAyD,CAAC;AACxE,cAAc,wDAAwD,CAAC;AACvE,cAAc,qEAAqE,CAAC;AACpF,cAAc,sEAAsE,CAAC;AACrF,cAAc,qEAAqE,CAAC;AACpF,cAAc,uEAAuE,CAAC;AACtF,cAAc,qEAAqE,CAAC;AACpF,cAAc,sEAAsE,CAAC;AACrF,cAAc,uEAAuE,CAAC;AACtF,cAAc,wEAAwE,CAAC;AACvF,cAAc,uEAAuE,CAAC;AACtF,cAAc,wEAAwE,CAAC;AACvF,cAAc,mEAAmE,CAAC;AAClF,cAAc,oEAAoE,CAAC;AACnF,cAAc,mEAAmE,CAAC;AAClF,cAAc,uDAAuD,CAAC;AACtE,cAAc,0DAA0D,CAAC;AACzE,cAAc,2DAA2D,CAAC;AAC1E,cAAc,oDAAoD,CAAC;AACnE,cAAc,qDAAqD,CAAC;AACpE,cAAc,qDAAqD,CAAC;AACpE,cAAc,sDAAsD,CAAC;AACrE,cAAc,uDAAuD,CAAC;AACtE,cAAc,kDAAkD,CAAC;AACjE,cAAc,mDAAmD,CAAC;AAClE,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uCAAuC,CAAC;AACtD,cAAc,uCAAuC,CAAC;AACtD,cAAc,wCAAwC,CAAC;AACvD,cAAc,wCAAwC,CAAC;AACvD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nexport * from \"./contextIdHandlers/didContextIdHandler.js\";\nexport * from \"./factories/identityConnectorFactory.js\";\nexport * from \"./factories/identityProfileConnectorFactory.js\";\nexport * from \"./factories/identityResolverConnectorFactory.js\";\nexport * from \"./models/api/identity/IIdentityCreateRequest.js\";\nexport * from \"./models/api/identity/IIdentityCreateResponse.js\";\nexport * from \"./models/api/identity/IIdentityProofCreateRequest.js\";\nexport * from \"./models/api/identity/IIdentityProofCreateResponse.js\";\nexport * from \"./models/api/identity/IIdentityProofVerifyRequest.js\";\nexport * from \"./models/api/identity/IIdentityProofVerifyResponse.js\";\nexport * from \"./models/api/identity/IIdentityRemoveRequest.js\";\nexport * from \"./models/api/identity/IIdentityServiceCreateRequest.js\";\nexport * from \"./models/api/identity/IIdentityServiceCreateResponse.js\";\nexport * from \"./models/api/identity/IIdentityServiceRemoveRequest.js\";\nexport * from \"./models/api/identity/IIdentityVerifiableCredentialCreateRequest.js\";\nexport * from \"./models/api/identity/IIdentityVerifiableCredentialCreateResponse.js\";\nexport * from \"./models/api/identity/IIdentityVerifiableCredentialRevokeRequest.js\";\nexport * from \"./models/api/identity/IIdentityVerifiableCredentialUnrevokeRequest.js\";\nexport * from \"./models/api/identity/IIdentityVerifiableCredentialVerifyRequest.js\";\nexport * from \"./models/api/identity/IIdentityVerifiableCredentialVerifyResponse.js\";\nexport * from \"./models/api/identity/IIdentityVerifiablePresentationCreateRequest.js\";\nexport * from \"./models/api/identity/IIdentityVerifiablePresentationCreateResponse.js\";\nexport * from \"./models/api/identity/IIdentityVerifiablePresentationVerifyRequest.js\";\nexport * from \"./models/api/identity/IIdentityVerifiablePresentationVerifyResponse.js\";\nexport * from \"./models/api/identity/IIdentityVerificationMethodCreateRequest.js\";\nexport * from \"./models/api/identity/IIdentityVerificationMethodCreateResponse.js\";\nexport * from \"./models/api/identity/IIdentityVerificationMethodRemoveRequest.js\";\nexport * from \"./models/api/profile/IIdentityProfileCreateRequest.js\";\nexport * from \"./models/api/profile/IIdentityProfileGetPublicRequest.js\";\nexport * from \"./models/api/profile/IIdentityProfileGetPublicResponse.js\";\nexport * from \"./models/api/profile/IIdentityProfileGetRequest.js\";\nexport * from \"./models/api/profile/IIdentityProfileGetResponse.js\";\nexport * from \"./models/api/profile/IIdentityProfileListRequest.js\";\nexport * from \"./models/api/profile/IIdentityProfileListResponse.js\";\nexport * from \"./models/api/profile/IIdentityProfileUpdateRequest.js\";\nexport * from \"./models/api/resolver/IIdentityResolveRequest.js\";\nexport * from \"./models/api/resolver/IIdentityResolveResponse.js\";\nexport * from \"./models/IIdentityComponent.js\";\nexport * from \"./models/IIdentityConnector.js\";\nexport * from \"./models/IIdentityProfileComponent.js\";\nexport * from \"./models/IIdentityProfileConnector.js\";\nexport * from \"./models/IIdentityResolverComponent.js\";\nexport * from \"./models/IIdentityResolverConnector.js\";\nexport * from \"./types/did.js\";\nexport * from \"./utils/documentHelper.js\";\nexport * from \"./utils/verificationHelper.js\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,cAAc,4CAA4C,CAAC;AAC3D,cAAc,yCAAyC,CAAC;AACxD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,iDAAiD,CAAC;AAChE,cAAc,4DAA4D,CAAC;AAC3E,cAAc,4DAA4D,CAAC;AAC3E,cAAc,iDAAiD,CAAC;AAChE,cAAc,kDAAkD,CAAC;AACjE,cAAc,sDAAsD,CAAC;AACrE,cAAc,uDAAuD,CAAC;AACtE,cAAc,sDAAsD,CAAC;AACrE,cAAc,uDAAuD,CAAC;AACtE,cAAc,iDAAiD,CAAC;AAChE,cAAc,wDAAwD,CAAC;AACvE,cAAc,yDAAyD,CAAC;AACxE,cAAc,wDAAwD,CAAC;AACvE,cAAc,qEAAqE,CAAC;AACpF,cAAc,sEAAsE,CAAC;AACrF,cAAc,qEAAqE,CAAC;AACpF,cAAc,uEAAuE,CAAC;AACtF,cAAc,6EAA6E,CAAC;AAC5F,cAAc,qEAAqE,CAAC;AACpF,cAAc,sEAAsE,CAAC;AACrF,cAAc,uEAAuE,CAAC;AACtF,cAAc,wEAAwE,CAAC;AACvF,cAAc,+EAA+E,CAAC;AAC9F,cAAc,uEAAuE,CAAC;AACtF,cAAc,wEAAwE,CAAC;AACvF,cAAc,mEAAmE,CAAC;AAClF,cAAc,oEAAoE,CAAC;AACnF,cAAc,mEAAmE,CAAC;AAClF,cAAc,uDAAuD,CAAC;AACtE,cAAc,0DAA0D,CAAC;AACzE,cAAc,2DAA2D,CAAC;AAC1E,cAAc,oDAAoD,CAAC;AACnE,cAAc,qDAAqD,CAAC;AACpE,cAAc,qDAAqD,CAAC;AACpE,cAAc,sDAAsD,CAAC;AACrE,cAAc,uDAAuD,CAAC;AACtE,cAAc,kDAAkD,CAAC;AACjE,cAAc,mDAAmD,CAAC;AAClE,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uCAAuC,CAAC;AACtD,cAAc,uCAAuC,CAAC;AACtD,cAAc,wCAAwC,CAAC;AACvD,cAAc,wCAAwC,CAAC;AACvD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nexport * from \"./contextIdHandlers/didContextIdHandler.js\";\nexport * from \"./factories/identityConnectorFactory.js\";\nexport * from \"./factories/identityProfileConnectorFactory.js\";\nexport * from \"./factories/identityResolverConnectorFactory.js\";\nexport * from \"./models/api/identity/IIdentityAlsoKnownAsCreateRequest.js\";\nexport * from \"./models/api/identity/IIdentityAlsoKnownAsRemoveRequest.js\";\nexport * from \"./models/api/identity/IIdentityCreateRequest.js\";\nexport * from \"./models/api/identity/IIdentityCreateResponse.js\";\nexport * from \"./models/api/identity/IIdentityProofCreateRequest.js\";\nexport * from \"./models/api/identity/IIdentityProofCreateResponse.js\";\nexport * from \"./models/api/identity/IIdentityProofVerifyRequest.js\";\nexport * from \"./models/api/identity/IIdentityProofVerifyResponse.js\";\nexport * from \"./models/api/identity/IIdentityRemoveRequest.js\";\nexport * from \"./models/api/identity/IIdentityServiceCreateRequest.js\";\nexport * from \"./models/api/identity/IIdentityServiceCreateResponse.js\";\nexport * from \"./models/api/identity/IIdentityServiceRemoveRequest.js\";\nexport * from \"./models/api/identity/IIdentityVerifiableCredentialCreateRequest.js\";\nexport * from \"./models/api/identity/IIdentityVerifiableCredentialCreateResponse.js\";\nexport * from \"./models/api/identity/IIdentityVerifiableCredentialRevokeRequest.js\";\nexport * from \"./models/api/identity/IIdentityVerifiableCredentialUnrevokeRequest.js\";\nexport * from \"./models/api/identity/IIdentityVerifiableCredentialVerifyDocumentRequest.js\";\nexport * from \"./models/api/identity/IIdentityVerifiableCredentialVerifyRequest.js\";\nexport * from \"./models/api/identity/IIdentityVerifiableCredentialVerifyResponse.js\";\nexport * from \"./models/api/identity/IIdentityVerifiablePresentationCreateRequest.js\";\nexport * from \"./models/api/identity/IIdentityVerifiablePresentationCreateResponse.js\";\nexport * from \"./models/api/identity/IIdentityVerifiablePresentationVerifyDocumentRequest.js\";\nexport * from \"./models/api/identity/IIdentityVerifiablePresentationVerifyRequest.js\";\nexport * from \"./models/api/identity/IIdentityVerifiablePresentationVerifyResponse.js\";\nexport * from \"./models/api/identity/IIdentityVerificationMethodCreateRequest.js\";\nexport * from \"./models/api/identity/IIdentityVerificationMethodCreateResponse.js\";\nexport * from \"./models/api/identity/IIdentityVerificationMethodRemoveRequest.js\";\nexport * from \"./models/api/profile/IIdentityProfileCreateRequest.js\";\nexport * from \"./models/api/profile/IIdentityProfileGetPublicRequest.js\";\nexport * from \"./models/api/profile/IIdentityProfileGetPublicResponse.js\";\nexport * from \"./models/api/profile/IIdentityProfileGetRequest.js\";\nexport * from \"./models/api/profile/IIdentityProfileGetResponse.js\";\nexport * from \"./models/api/profile/IIdentityProfileListRequest.js\";\nexport * from \"./models/api/profile/IIdentityProfileListResponse.js\";\nexport * from \"./models/api/profile/IIdentityProfileUpdateRequest.js\";\nexport * from \"./models/api/resolver/IIdentityResolveRequest.js\";\nexport * from \"./models/api/resolver/IIdentityResolveResponse.js\";\nexport * from \"./models/IIdentityComponent.js\";\nexport * from \"./models/IIdentityConnector.js\";\nexport * from \"./models/IIdentityProfileComponent.js\";\nexport * from \"./models/IIdentityProfileConnector.js\";\nexport * from \"./models/IIdentityResolverComponent.js\";\nexport * from \"./models/IIdentityResolverConnector.js\";\nexport * from \"./types/did.js\";\nexport * from \"./utils/documentHelper.js\";\nexport * from \"./utils/verificationHelper.js\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IIdentityComponent.js","sourceRoot":"","sources":["../../../src/models/IIdentityComponent.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@twin.org/core\";\nimport type { IJsonLdContextDefinitionRoot, IJsonLdNodeObject } from \"@twin.org/data-json-ld\";\nimport type {\n\tDidVerificationMethodType,\n\tIDidDocument,\n\tIDidDocumentVerificationMethod,\n\tIProof,\n\tIDidService,\n\tIDidVerifiableCredential,\n\tIDidVerifiablePresentation,\n\tProofTypes\n} from \"@twin.org/standards-w3c-did\";\n\n/**\n * Interface describing a contract which provides identity operations.\n */\nexport interface IIdentityComponent extends IComponent {\n\t/**\n\t * Create a new identity.\n\t * @param namespace The namespace of the connector to use for the identity, defaults to service configured namespace.\n\t * @param controller The controller of the identity who can make changes.\n\t * @returns The created identity document.\n\t */\n\tidentityCreate(namespace?: string, controller?: string): Promise<IDidDocument>;\n\n\t/**\n\t * Remove an identity.\n\t * @param identity The id of the document to remove.\n\t * @param controller The controller of the identity who can make changes.\n\t * @returns Nothing.\n\t */\n\tidentityRemove(identity: string, controller?: string): Promise<void>;\n\n\t/**\n\t * Add a verification method to the document in JSON Web key Format.\n\t * @param identity The id of the document to add the verification method to.\n\t * @param verificationMethodType The type of the verification method to add.\n\t * @param verificationMethodId The id of the verification method, if undefined uses the kid of the generated JWK.\n\t * @param controller The controller of the identity who can make changes.\n\t * @returns The verification method.\n\t * @throws NotFoundError if the id can not be resolved.\n\t * @throws NotSupportedError if the platform does not support multiple keys.\n\t */\n\tverificationMethodCreate(\n\t\tidentity: string,\n\t\tverificationMethodType: DidVerificationMethodType,\n\t\tverificationMethodId?: string,\n\t\tcontroller?: string\n\t): Promise<IDidDocumentVerificationMethod>;\n\n\t/**\n\t * Remove a verification method from the document.\n\t * @param verificationMethodId The id of the verification method.\n\t * @param controller The controller of the identity who can make changes.\n\t * @returns Nothing.\n\t * @throws NotFoundError if the id can not be resolved.\n\t * @throws NotSupportedError if the platform does not support multiple revocable keys.\n\t */\n\tverificationMethodRemove(verificationMethodId: string, controller?: string): Promise<void>;\n\n\t/**\n\t * Add a service to the document.\n\t * @param identity The id of the document to add the service to.\n\t * @param serviceId The id of the service.\n\t * @param serviceType The type of the service.\n\t * @param serviceEndpoint The endpoint for the service.\n\t * @param controller The controller of the identity who can make changes.\n\t * @returns The service.\n\t * @throws NotFoundError if the id can not be resolved.\n\t */\n\tserviceCreate(\n\t\tidentity: string,\n\t\tserviceId: string,\n\t\tserviceType: string | string[],\n\t\tserviceEndpoint: string | string[],\n\t\tcontroller?: string\n\t): Promise<IDidService>;\n\n\t/**\n\t * Remove a service from the document.\n\t * @param serviceId The id of the service.\n\t * @param controller The controller of the identity who can make changes.\n\t * @returns Nothing.\n\t * @throws NotFoundError if the id can not be resolved.\n\t */\n\tserviceRemove(serviceId: string, controller?: string): Promise<void>;\n\n\t/**\n\t * Create a verifiable credential for a verification method.\n\t * @param verificationMethodId The verification method id to use.\n\t * @param id The id of the credential.\n\t * @param subject The credential subject to store in the verifiable credential.\n\t * @param options Additional options for creating the verifiable credential.\n\t * @param options.revocationIndex The bitmap revocation index of the credential, if undefined will not have revocation status.\n\t * @param options.expirationDate The date the verifiable credential is valid until.\n\t * @param controller The controller of the identity who can make changes.\n\t * @returns The created verifiable credential and its token.\n\t * @throws NotFoundError if the id can not be resolved.\n\t */\n\tverifiableCredentialCreate(\n\t\tverificationMethodId: string,\n\t\tid: string | undefined,\n\t\tsubject: IJsonLdNodeObject,\n\t\toptions?: {\n\t\t\trevocationIndex?: number;\n\t\t\texpirationDate?: Date;\n\t\t},\n\t\tcontroller?: string\n\t): Promise<{\n\t\tverifiableCredential: IDidVerifiableCredential;\n\t\tjwt: string;\n\t}>;\n\n\t/**\n\t * Verify a verifiable credential is valid.\n\t * @param
|
|
1
|
+
{"version":3,"file":"IIdentityComponent.js","sourceRoot":"","sources":["../../../src/models/IIdentityComponent.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@twin.org/core\";\nimport type { IJsonLdContextDefinitionRoot, IJsonLdNodeObject } from \"@twin.org/data-json-ld\";\nimport type {\n\tDidVerificationMethodType,\n\tIDidDocument,\n\tIDidDocumentVerificationMethod,\n\tIProof,\n\tIDidService,\n\tIDidVerifiableCredential,\n\tIDidVerifiablePresentation,\n\tProofTypes\n} from \"@twin.org/standards-w3c-did\";\n\n/**\n * Interface describing a contract which provides identity operations.\n */\nexport interface IIdentityComponent extends IComponent {\n\t/**\n\t * Create a new identity.\n\t * @param namespace The namespace of the connector to use for the identity, defaults to service configured namespace.\n\t * @param controller The controller of the identity who can make changes.\n\t * @returns The created identity document.\n\t */\n\tidentityCreate(namespace?: string, controller?: string): Promise<IDidDocument>;\n\n\t/**\n\t * Remove an identity.\n\t * @param identity The id of the document to remove.\n\t * @param controller The controller of the identity who can make changes.\n\t * @returns Nothing.\n\t */\n\tidentityRemove(identity: string, controller?: string): Promise<void>;\n\n\t/**\n\t * Add a verification method to the document in JSON Web key Format.\n\t * @param identity The id of the document to add the verification method to.\n\t * @param verificationMethodType The type of the verification method to add.\n\t * @param verificationMethodId The id of the verification method, if undefined uses the kid of the generated JWK.\n\t * @param controller The controller of the identity who can make changes.\n\t * @returns The verification method.\n\t * @throws NotFoundError if the id can not be resolved.\n\t * @throws NotSupportedError if the platform does not support multiple keys.\n\t */\n\tverificationMethodCreate(\n\t\tidentity: string,\n\t\tverificationMethodType: DidVerificationMethodType,\n\t\tverificationMethodId?: string,\n\t\tcontroller?: string\n\t): Promise<IDidDocumentVerificationMethod>;\n\n\t/**\n\t * Remove a verification method from the document.\n\t * @param verificationMethodId The id of the verification method.\n\t * @param controller The controller of the identity who can make changes.\n\t * @returns Nothing.\n\t * @throws NotFoundError if the id can not be resolved.\n\t * @throws NotSupportedError if the platform does not support multiple revocable keys.\n\t */\n\tverificationMethodRemove(verificationMethodId: string, controller?: string): Promise<void>;\n\n\t/**\n\t * Add a service to the document.\n\t * @param identity The id of the document to add the service to.\n\t * @param serviceId The id of the service.\n\t * @param serviceType The type of the service.\n\t * @param serviceEndpoint The endpoint for the service.\n\t * @param controller The controller of the identity who can make changes.\n\t * @returns The service.\n\t * @throws NotFoundError if the id can not be resolved.\n\t */\n\tserviceCreate(\n\t\tidentity: string,\n\t\tserviceId: string,\n\t\tserviceType: string | string[],\n\t\tserviceEndpoint: string | string[],\n\t\tcontroller?: string\n\t): Promise<IDidService>;\n\n\t/**\n\t * Remove a service from the document.\n\t * @param serviceId The id of the service.\n\t * @param controller The controller of the identity who can make changes.\n\t * @returns Nothing.\n\t * @throws NotFoundError if the id can not be resolved.\n\t */\n\tserviceRemove(serviceId: string, controller?: string): Promise<void>;\n\n\t/**\n\t * Add an alias to the alsoKnownAs property on the document.\n\t * If the alias is already present the operation is a no-op.\n\t * @param documentId The id of the document to update.\n\t * @param alias The alias to add. Must be a Url or Urn (typically another DID).\n\t * @param controller The controller of the identity who can make changes.\n\t * @returns Nothing.\n\t * @throws GeneralError if the alias is not a Url or Urn.\n\t * @throws NotFoundError if the id can not be resolved.\n\t */\n\talsoKnownAsAdd(documentId: string, alias: string, controller?: string): Promise<void>;\n\n\t/**\n\t * Remove an alias from the alsoKnownAs property on the document.\n\t * If the alias is not present the operation is a no-op.\n\t * @param documentId The id of the document to update.\n\t * @param alias The alias to remove. Must be a Url or Urn.\n\t * @param controller The controller of the identity who can make changes.\n\t * @returns Nothing.\n\t * @throws GeneralError if the alias is not a Url or Urn.\n\t * @throws NotFoundError if the id can not be resolved.\n\t */\n\talsoKnownAsRemove(documentId: string, alias: string, controller?: string): Promise<void>;\n\n\t/**\n\t * Create a verifiable credential for a verification method.\n\t * @param verificationMethodId The verification method id to use.\n\t * @param id The id of the credential.\n\t * @param subject The credential subject to store in the verifiable credential.\n\t * @param options Additional options for creating the verifiable credential.\n\t * @param options.revocationIndex The bitmap revocation index of the credential, if undefined will not have revocation status.\n\t * @param options.expirationDate The date the verifiable credential is valid until.\n\t * @param controller The controller of the identity who can make changes.\n\t * @returns The created verifiable credential and its token.\n\t * @throws NotFoundError if the id can not be resolved.\n\t */\n\tverifiableCredentialCreate(\n\t\tverificationMethodId: string,\n\t\tid: string | undefined,\n\t\tsubject: IJsonLdNodeObject,\n\t\toptions?: {\n\t\t\trevocationIndex?: number;\n\t\t\texpirationDate?: Date;\n\t\t},\n\t\tcontroller?: string\n\t): Promise<{\n\t\tverifiableCredential: IDidVerifiableCredential;\n\t\tjwt: string;\n\t}>;\n\n\t/**\n\t * Verify a verifiable credential is valid.\n\t * @param credential The credential to verify.\n\t * @returns The credential stored in the jwt and the revocation status.\n\t */\n\tverifiableCredentialVerify(credential: string | IDidVerifiableCredential): Promise<{\n\t\trevoked: boolean;\n\t\tverifiableCredential?: IDidVerifiableCredential;\n\t}>;\n\n\t/**\n\t * Revoke verifiable credential.\n\t * @param issuerId The id of the document to update the revocation list for.\n\t * @param credentialIndex The revocation bitmap index revoke.\n\t * @param controller The controller of the identity who can make changes.\n\t * @returns Nothing.\n\t */\n\tverifiableCredentialRevoke(\n\t\tissuerId: string,\n\t\tcredentialIndex: number,\n\t\tcontroller?: string\n\t): Promise<void>;\n\n\t/**\n\t * Unrevoke verifiable credential.\n\t * @param issuerId The id of the document to update the revocation list for.\n\t * @param credentialIndex The revocation bitmap index to un revoke.\n\t * @param controller The controller of the identity who can make changes.\n\t * @returns Nothing.\n\t */\n\tverifiableCredentialUnrevoke(\n\t\tissuerId: string,\n\t\tcredentialIndex: number,\n\t\tcontroller?: string\n\t): Promise<void>;\n\n\t/**\n\t * Create a verifiable presentation from the supplied verifiable credentials.\n\t * @param verificationMethodId The method to associate with the presentation.\n\t * @param presentationId The id of the presentation.\n\t * @param contexts The contexts for the data stored in the verifiable credential.\n\t * @param types The types for the data stored in the verifiable credential.\n\t * @param verifiableCredentials The credentials to use for creating the presentation in jwt format.\n\t * @param options Additional options for creating the verifiable presentation.\n\t * @param options.expirationDate The date the verifiable presentation is valid until.\n\t * @param controller The controller of the identity who can make changes.\n\t * @returns The created verifiable presentation and its token.\n\t * @throws NotFoundError if the id can not be resolved.\n\t */\n\tverifiablePresentationCreate(\n\t\tverificationMethodId: string,\n\t\tpresentationId: string | undefined,\n\t\tcontexts: IJsonLdContextDefinitionRoot | undefined,\n\t\ttypes: string | string[] | undefined,\n\t\tverifiableCredentials: (string | IDidVerifiableCredential)[],\n\t\toptions?: {\n\t\t\texpirationDate?: Date;\n\t\t},\n\t\tcontroller?: string\n\t): Promise<{\n\t\tverifiablePresentation: IDidVerifiablePresentation;\n\t\tjwt: string;\n\t}>;\n\n\t/**\n\t * Verify a verifiable presentation is valid.\n\t * @param presentation The presentation to verify.\n\t * @returns The presentation stored in the jwt and the revocation status.\n\t */\n\tverifiablePresentationVerify(presentation: string | IDidVerifiablePresentation): Promise<{\n\t\trevoked: boolean;\n\t\tverifiablePresentation?: IDidVerifiablePresentation;\n\t\tissuers?: IDidDocument[];\n\t}>;\n\n\t/**\n\t * Create a proof for a document with the specified verification method.\n\t * @param verificationMethodId The verification method id to use.\n\t * @param proofType The type of proof to create.\n\t * @param unsecureDocument The unsecure document to create the proof for.\n\t * @param controller The controller of the identity who can make changes.\n\t * @returns The proof.\n\t */\n\tproofCreate(\n\t\tverificationMethodId: string,\n\t\tproofType: ProofTypes,\n\t\tunsecureDocument: IJsonLdNodeObject,\n\t\tcontroller?: string\n\t): Promise<IProof>;\n\n\t/**\n\t * Verify proof for a document with the specified verification method.\n\t * @param document The document to verify.\n\t * @param proof The proof to verify.\n\t * @returns True if the proof is verified.\n\t */\n\tproofVerify(document: IJsonLdNodeObject, proof: IProof): Promise<boolean>;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IIdentityConnector.js","sourceRoot":"","sources":["../../../src/models/IIdentityConnector.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@twin.org/core\";\nimport type { IJsonLdContextDefinitionRoot, IJsonLdNodeObject } from \"@twin.org/data-json-ld\";\nimport type {\n\tDidVerificationMethodType,\n\tIDidDocument,\n\tIDidDocumentVerificationMethod,\n\tIProof,\n\tIDidService,\n\tIDidVerifiableCredential,\n\tIDidVerifiablePresentation,\n\tProofTypes\n} from \"@twin.org/standards-w3c-did\";\n\n/**\n * Interface describing an identity connector.\n */\nexport interface IIdentityConnector extends IComponent {\n\t/**\n\t * Create a new document.\n\t * @param controller The controller of the identity who can make changes.\n\t * @returns The created document.\n\t */\n\tcreateDocument(controller: string): Promise<IDidDocument>;\n\n\t/**\n\t * Remove a document.\n\t * @param controller The controller of the identity who can make changes.\n\t * @param documentId The id of the document to remove.\n\t * @returns Nothing.\n\t */\n\tremoveDocument(controller: string, documentId: string): Promise<void>;\n\n\t/**\n\t * Add a verification method to the document in JSON Web key Format.\n\t * @param controller The controller of the identity who can make changes.\n\t * @param documentId The id of the document to add the verification method to.\n\t * @param verificationMethodType The type of the verification method to add.\n\t * @param verificationMethodId The id of the verification method, if undefined uses the kid of the generated JWK.\n\t * @returns The verification method.\n\t * @throws NotFoundError if the id can not be resolved.\n\t * @throws NotSupportedError if the platform does not support multiple keys.\n\t */\n\taddVerificationMethod(\n\t\tcontroller: string,\n\t\tdocumentId: string,\n\t\tverificationMethodType: DidVerificationMethodType,\n\t\tverificationMethodId?: string\n\t): Promise<IDidDocumentVerificationMethod>;\n\n\t/**\n\t * Remove a verification method from the document.\n\t * @param controller The controller of the identity who can make changes.\n\t * @param verificationMethodId The id of the verification method.\n\t * @returns Nothing.\n\t * @throws NotFoundError if the id can not be resolved.\n\t * @throws NotSupportedError if the platform does not support multiple revocable keys.\n\t */\n\tremoveVerificationMethod(controller: string, verificationMethodId: string): Promise<void>;\n\n\t/**\n\t * Add a service to the document.\n\t * @param controller The controller of the identity who can make changes.\n\t * @param documentId The id of the document to add the service to.\n\t * @param serviceId The id of the service.\n\t * @param serviceType The type of the service.\n\t * @param serviceEndpoint The endpoint for the service.\n\t * @returns The service.\n\t * @throws NotFoundError if the id can not be resolved.\n\t */\n\taddService(\n\t\tcontroller: string,\n\t\tdocumentId: string,\n\t\tserviceId: string,\n\t\tserviceType: string | string[],\n\t\tserviceEndpoint: string | string[]\n\t): Promise<IDidService>;\n\n\t/**\n\t * Remove a service from the document.\n\t * @param controller The controller of the identity who can make changes.\n\t * @param serviceId The id of the service.\n\t * @returns Nothing.\n\t * @throws NotFoundError if the id can not be resolved.\n\t */\n\tremoveService(controller: string, serviceId: string): Promise<void>;\n\n\t/**\n\t * Create a verifiable credential for a verification method.\n\t * @param controller The controller of the identity who can make changes.\n\t * @param verificationMethodId The verification method id to use.\n\t * @param id The id of the credential.\n\t * @param subject The credential subject to store in the verifiable credential.\n\t * @param options Additional options for creating the verifiable credential.\n\t * @param options.revocationIndex The bitmap revocation index of the credential, if undefined will not have revocation status.\n\t * @param options.expirationDate The date the verifiable credential is valid until.\n\t * @returns The created verifiable credential and its token.\n\t * @throws NotFoundError if the id can not be resolved.\n\t */\n\tcreateVerifiableCredential(\n\t\tcontroller: string,\n\t\tverificationMethodId: string,\n\t\tid: string | undefined,\n\t\tsubject: IJsonLdNodeObject,\n\t\toptions?: {\n\t\t\trevocationIndex?: number;\n\t\t\texpirationDate?: Date;\n\t\t}\n\t): Promise<{\n\t\tverifiableCredential: IDidVerifiableCredential;\n\t\tjwt: string;\n\t}>;\n\n\t/**\n\t * Check a verifiable credential is valid.\n\t * @param
|
|
1
|
+
{"version":3,"file":"IIdentityConnector.js","sourceRoot":"","sources":["../../../src/models/IIdentityConnector.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@twin.org/core\";\nimport type { IJsonLdContextDefinitionRoot, IJsonLdNodeObject } from \"@twin.org/data-json-ld\";\nimport type {\n\tDidVerificationMethodType,\n\tIDidDocument,\n\tIDidDocumentVerificationMethod,\n\tIProof,\n\tIDidService,\n\tIDidVerifiableCredential,\n\tIDidVerifiablePresentation,\n\tProofTypes\n} from \"@twin.org/standards-w3c-did\";\n\n/**\n * Interface describing an identity connector.\n */\nexport interface IIdentityConnector extends IComponent {\n\t/**\n\t * Create a new document.\n\t * @param controller The controller of the identity who can make changes.\n\t * @returns The created document.\n\t */\n\tcreateDocument(controller: string): Promise<IDidDocument>;\n\n\t/**\n\t * Remove a document.\n\t * @param controller The controller of the identity who can make changes.\n\t * @param documentId The id of the document to remove.\n\t * @returns Nothing.\n\t */\n\tremoveDocument(controller: string, documentId: string): Promise<void>;\n\n\t/**\n\t * Add a verification method to the document in JSON Web key Format.\n\t * @param controller The controller of the identity who can make changes.\n\t * @param documentId The id of the document to add the verification method to.\n\t * @param verificationMethodType The type of the verification method to add.\n\t * @param verificationMethodId The id of the verification method, if undefined uses the kid of the generated JWK.\n\t * @returns The verification method.\n\t * @throws NotFoundError if the id can not be resolved.\n\t * @throws NotSupportedError if the platform does not support multiple keys.\n\t */\n\taddVerificationMethod(\n\t\tcontroller: string,\n\t\tdocumentId: string,\n\t\tverificationMethodType: DidVerificationMethodType,\n\t\tverificationMethodId?: string\n\t): Promise<IDidDocumentVerificationMethod>;\n\n\t/**\n\t * Remove a verification method from the document.\n\t * @param controller The controller of the identity who can make changes.\n\t * @param verificationMethodId The id of the verification method.\n\t * @returns Nothing.\n\t * @throws NotFoundError if the id can not be resolved.\n\t * @throws NotSupportedError if the platform does not support multiple revocable keys.\n\t */\n\tremoveVerificationMethod(controller: string, verificationMethodId: string): Promise<void>;\n\n\t/**\n\t * Add a service to the document.\n\t * @param controller The controller of the identity who can make changes.\n\t * @param documentId The id of the document to add the service to.\n\t * @param serviceId The id of the service.\n\t * @param serviceType The type of the service.\n\t * @param serviceEndpoint The endpoint for the service.\n\t * @returns The service.\n\t * @throws NotFoundError if the id can not be resolved.\n\t */\n\taddService(\n\t\tcontroller: string,\n\t\tdocumentId: string,\n\t\tserviceId: string,\n\t\tserviceType: string | string[],\n\t\tserviceEndpoint: string | string[]\n\t): Promise<IDidService>;\n\n\t/**\n\t * Remove a service from the document.\n\t * @param controller The controller of the identity who can make changes.\n\t * @param serviceId The id of the service.\n\t * @returns Nothing.\n\t * @throws NotFoundError if the id can not be resolved.\n\t */\n\tremoveService(controller: string, serviceId: string): Promise<void>;\n\n\t/**\n\t * Add an alias to the alsoKnownAs property on the document.\n\t * If the alias is already present the operation is a no-op.\n\t * @param controller The controller of the identity who can make changes.\n\t * @param documentId The id of the document to update.\n\t * @param alias The alias to add. Must be a Url or Urn (typically another DID).\n\t * @returns Nothing.\n\t * @throws GeneralError if the alias is not a Url or Urn.\n\t * @throws NotFoundError if the id can not be resolved.\n\t */\n\taddAlsoKnownAs(controller: string, documentId: string, alias: string): Promise<void>;\n\n\t/**\n\t * Remove an alias from the alsoKnownAs property on the document.\n\t * If the alias is not present the operation is a no-op.\n\t * @param controller The controller of the identity who can make changes.\n\t * @param documentId The id of the document to update.\n\t * @param alias The alias to remove. Must be a Url or Urn.\n\t * @returns Nothing.\n\t * @throws GeneralError if the alias is not a Url or Urn.\n\t * @throws NotFoundError if the id can not be resolved.\n\t */\n\tremoveAlsoKnownAs(controller: string, documentId: string, alias: string): Promise<void>;\n\n\t/**\n\t * Create a verifiable credential for a verification method.\n\t * @param controller The controller of the identity who can make changes.\n\t * @param verificationMethodId The verification method id to use.\n\t * @param id The id of the credential.\n\t * @param subject The credential subject to store in the verifiable credential.\n\t * @param options Additional options for creating the verifiable credential.\n\t * @param options.revocationIndex The bitmap revocation index of the credential, if undefined will not have revocation status.\n\t * @param options.expirationDate The date the verifiable credential is valid until.\n\t * @returns The created verifiable credential and its token.\n\t * @throws NotFoundError if the id can not be resolved.\n\t */\n\tcreateVerifiableCredential(\n\t\tcontroller: string,\n\t\tverificationMethodId: string,\n\t\tid: string | undefined,\n\t\tsubject: IJsonLdNodeObject,\n\t\toptions?: {\n\t\t\trevocationIndex?: number;\n\t\t\texpirationDate?: Date;\n\t\t}\n\t): Promise<{\n\t\tverifiableCredential: IDidVerifiableCredential;\n\t\tjwt: string;\n\t}>;\n\n\t/**\n\t * Check a verifiable credential is valid.\n\t * @param credential The credential to verify.\n\t * @returns The credential stored in the jwt and the revocation status.\n\t */\n\tcheckVerifiableCredential(credential: string | IDidVerifiableCredential): Promise<{\n\t\trevoked: boolean;\n\t\tverifiableCredential?: IDidVerifiableCredential;\n\t}>;\n\n\t/**\n\t * Revoke verifiable credential(s).\n\t * @param controller The controller of the identity who can make changes.\n\t * @param issuerDocumentId The id of the document to update the revocation list for.\n\t * @param credentialIndices The revocation bitmap index or indices to revoke.\n\t * @returns Nothing.\n\t */\n\trevokeVerifiableCredentials(\n\t\tcontroller: string,\n\t\tissuerDocumentId: string,\n\t\tcredentialIndices: number[]\n\t): Promise<void>;\n\n\t/**\n\t * Unrevoke verifiable credential(s).\n\t * @param controller The controller of the identity who can make changes.\n\t * @param issuerDocumentId The id of the document to update the revocation list for.\n\t * @param credentialIndices The revocation bitmap index or indices to un revoke.\n\t * @returns Nothing.\n\t */\n\tunrevokeVerifiableCredentials(\n\t\tcontroller: string,\n\t\tissuerDocumentId: string,\n\t\tcredentialIndices: number[]\n\t): Promise<void>;\n\n\t/**\n\t * Create a verifiable presentation from the supplied verifiable credentials.\n\t * @param controller The controller of the identity who can make changes.\n\t * @param verificationMethodId The method to associate with the presentation.\n\t * @param presentationId The id of the presentation.\n\t * @param contexts The contexts for the data stored in the verifiable credential.\n\t * @param types The types for the data stored in the verifiable credential.\n\t * @param verifiableCredentials The credentials to use for creating the presentation in jwt format.\n\t * @param options Additional options for creating the verifiable presentation.\n\t * @param options.expirationDate The date the verifiable presentation is valid until.\n\t * @returns The created verifiable presentation and its token.\n\t * @throws NotFoundError if the id can not be resolved.\n\t */\n\tcreateVerifiablePresentation(\n\t\tcontroller: string,\n\t\tverificationMethodId: string,\n\t\tpresentationId: string | undefined,\n\t\tcontexts: IJsonLdContextDefinitionRoot | undefined,\n\t\ttypes: string | string[] | undefined,\n\t\tverifiableCredentials: (string | IDidVerifiableCredential)[],\n\t\toptions?: { expirationDate?: Date }\n\t): Promise<{\n\t\tverifiablePresentation: IDidVerifiablePresentation;\n\t\tjwt: string;\n\t}>;\n\n\t/**\n\t * Check a verifiable presentation is valid.\n\t * @param presentation The presentation to verify.\n\t * @returns The presentation stored in the jwt and the revocation status.\n\t */\n\tcheckVerifiablePresentation(presentation: string | IDidVerifiablePresentation): Promise<{\n\t\trevoked: boolean;\n\t\tverifiablePresentation?: IDidVerifiablePresentation;\n\t\tissuers?: IDidDocument[];\n\t}>;\n\n\t/**\n\t * Create a proof for arbitrary data with the specified verification method.\n\t * @param controller The controller of the identity who can make changes.\n\t * @param verificationMethodId The verification method id to use.\n\t * @param proofType The type of proof to create.\n\t * @param unsecureDocument The unsecure document to create the proof for.\n\t * @returns The proof.\n\t */\n\tcreateProof(\n\t\tcontroller: string,\n\t\tverificationMethodId: string,\n\t\tproofType: ProofTypes,\n\t\tunsecureDocument: IJsonLdNodeObject\n\t): Promise<IProof>;\n\n\t/**\n\t * Verify proof for arbitrary data with the specified verification method.\n\t * @param document The document to verify.\n\t * @param proof The proof to verify.\n\t * @returns True if the proof is verified.\n\t */\n\tverifyProof(document: IJsonLdNodeObject, proof: IProof): Promise<boolean>;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IIdentityAlsoKnownAsCreateRequest.js","sourceRoot":"","sources":["../../../../../src/models/api/identity/IIdentityAlsoKnownAsCreateRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Request to create an alias for an identity.\n */\nexport interface IIdentityAlsoKnownAsCreateRequest {\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The identity to create the alias for.\n\t\t */\n\t\tidentity: string;\n\t};\n\n\t/**\n\t * The data for the request.\n\t */\n\tbody: {\n\t\t/**\n\t\t * The alias to create for the identity.\n\t\t */\n\t\talias: string;\n\t};\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IIdentityAlsoKnownAsRemoveRequest.js","sourceRoot":"","sources":["../../../../../src/models/api/identity/IIdentityAlsoKnownAsRemoveRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Request to remove an alias from an identity.\n */\nexport interface IIdentityAlsoKnownAsRemoveRequest {\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The identity to remove the alias from.\n\t\t */\n\t\tidentity: string;\n\n\t\t/**\n\t\t * The alias to remove.\n\t\t */\n\t\talias: string;\n\t};\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IIdentityVerifiableCredentialRevokeRequest.js","sourceRoot":"","sources":["../../../../../src/models/api/identity/IIdentityVerifiableCredentialRevokeRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Request to revoke a verifiable credential.\n */\nexport interface IIdentityVerifiableCredentialRevokeRequest {\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The identity to revoke the verification credential for.\n\t\t */\n\t\tidentity: string;\n\n\t\t/**\n\t\t * The revocation index to revoke.\n\t\t */\n\t\trevocationIndex:
|
|
1
|
+
{"version":3,"file":"IIdentityVerifiableCredentialRevokeRequest.js","sourceRoot":"","sources":["../../../../../src/models/api/identity/IIdentityVerifiableCredentialRevokeRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Request to revoke a verifiable credential.\n */\nexport interface IIdentityVerifiableCredentialRevokeRequest {\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The identity to revoke the verification credential for.\n\t\t */\n\t\tidentity: string;\n\n\t\t/**\n\t\t * The revocation index to revoke.\n\t\t */\n\t\trevocationIndex: string;\n\t};\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IIdentityVerifiableCredentialUnrevokeRequest.js","sourceRoot":"","sources":["../../../../../src/models/api/identity/IIdentityVerifiableCredentialUnrevokeRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Request to unrevoke a verifiable credential.\n */\nexport interface IIdentityVerifiableCredentialUnrevokeRequest {\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The identity to unrevoke the verification credential for.\n\t\t */\n\t\tidentity: string;\n\n\t\t/**\n\t\t * The revocation index to unrevoke.\n\t\t */\n\t\trevocationIndex:
|
|
1
|
+
{"version":3,"file":"IIdentityVerifiableCredentialUnrevokeRequest.js","sourceRoot":"","sources":["../../../../../src/models/api/identity/IIdentityVerifiableCredentialUnrevokeRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Request to unrevoke a verifiable credential.\n */\nexport interface IIdentityVerifiableCredentialUnrevokeRequest {\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The identity to unrevoke the verification credential for.\n\t\t */\n\t\tidentity: string;\n\n\t\t/**\n\t\t * The revocation index to unrevoke.\n\t\t */\n\t\trevocationIndex: string;\n\t};\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IIdentityVerifiableCredentialVerifyDocumentRequest.js","sourceRoot":"","sources":["../../../../../src/models/api/identity/IIdentityVerifiableCredentialVerifyDocumentRequest.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IDidVerifiableCredential } from \"@twin.org/standards-w3c-did\";\n\n/**\n * Request to verify a verifiable credential.\n */\nexport interface IIdentityVerifiableCredentialVerifyDocumentRequest {\n\t/**\n\t * The body parameters.\n\t */\n\tbody: IDidVerifiableCredential;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IIdentityVerifiablePresentationCreateRequest.js","sourceRoot":"","sources":["../../../../../src/models/api/identity/IIdentityVerifiablePresentationCreateRequest.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IJsonLdContextDefinitionRoot } from \"@twin.org/data-json-ld\";\nimport type { IDidVerifiableCredential } from \"@twin.org/standards-w3c-did\";\n\n/**\n * Request to create a verifiable presentation.\n */\nexport interface IIdentityVerifiablePresentationCreateRequest {\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The identity to create the verification presentation for.\n\t\t */\n\t\tidentity: string;\n\n\t\t/**\n\t\t * The verification method id to use.\n\t\t */\n\t\tverificationMethodId: string;\n\t};\n\n\t/**\n\t * The data for the request.\n\t */\n\tbody: {\n\t\t/**\n\t\t * The id of the presentation.\n\t\t */\n\t\tpresentationId?: string;\n\n\t\t/**\n\t\t * The context to use for the presentation.\n\t\t */\n\t\tcontexts?: IJsonLdContextDefinitionRoot;\n\n\t\t/**\n\t\t * The types of the presentation.\n\t\t */\n\t\ttypes?: string | string[];\n\n\t\t/**\n\t\t * The verifiable credentials to include in the presentation.\n\t\t */\n\t\tverifiableCredentials: (string | IDidVerifiableCredential)[];\n\n\t\t/**\n\t\t * The expiration time for the presentation.\n\t\t */\n\t\
|
|
1
|
+
{"version":3,"file":"IIdentityVerifiablePresentationCreateRequest.js","sourceRoot":"","sources":["../../../../../src/models/api/identity/IIdentityVerifiablePresentationCreateRequest.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IJsonLdContextDefinitionRoot } from \"@twin.org/data-json-ld\";\nimport type { IDidVerifiableCredential } from \"@twin.org/standards-w3c-did\";\n\n/**\n * Request to create a verifiable presentation.\n */\nexport interface IIdentityVerifiablePresentationCreateRequest {\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The identity to create the verification presentation for.\n\t\t */\n\t\tidentity: string;\n\n\t\t/**\n\t\t * The verification method id to use.\n\t\t */\n\t\tverificationMethodId: string;\n\t};\n\n\t/**\n\t * The data for the request.\n\t */\n\tbody: {\n\t\t/**\n\t\t * The id of the presentation.\n\t\t */\n\t\tpresentationId?: string;\n\n\t\t/**\n\t\t * The context to use for the presentation.\n\t\t */\n\t\tcontexts?: IJsonLdContextDefinitionRoot;\n\n\t\t/**\n\t\t * The types of the presentation.\n\t\t */\n\t\ttypes?: string | string[];\n\n\t\t/**\n\t\t * The verifiable credentials to include in the presentation.\n\t\t */\n\t\tverifiableCredentials: (string | IDidVerifiableCredential)[];\n\n\t\t/**\n\t\t * The expiration date/time for the presentation.\n\t\t */\n\t\texpirationDate?: string;\n\t};\n}\n"]}
|
package/dist/es/models/api/identity/IIdentityVerifiablePresentationVerifyDocumentRequest.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IIdentityVerifiablePresentationVerifyDocumentRequest.js","sourceRoot":"","sources":["../../../../../src/models/api/identity/IIdentityVerifiablePresentationVerifyDocumentRequest.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IDidVerifiablePresentation } from \"@twin.org/standards-w3c-did\";\n\n/**\n * Request to verify a verifiable presentation.\n */\nexport interface IIdentityVerifiablePresentationVerifyDocumentRequest {\n\t/**\n\t * The body parameters.\n\t */\n\tbody: IDidVerifiablePresentation;\n}\n"]}
|
|
@@ -7,6 +7,11 @@ export declare class DidContextIdHandler implements IContextIdHandler {
|
|
|
7
7
|
* Runtime name for the class.
|
|
8
8
|
*/
|
|
9
9
|
static readonly CLASS_NAME: string;
|
|
10
|
+
/**
|
|
11
|
+
* The class name of the component.
|
|
12
|
+
* @returns The class name.
|
|
13
|
+
*/
|
|
14
|
+
className(): string;
|
|
10
15
|
/**
|
|
11
16
|
* Get the short form of the DID which is the last part.
|
|
12
17
|
* @param value The full context id value.
|
package/dist/types/index.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ export * from "./contextIdHandlers/didContextIdHandler.js";
|
|
|
2
2
|
export * from "./factories/identityConnectorFactory.js";
|
|
3
3
|
export * from "./factories/identityProfileConnectorFactory.js";
|
|
4
4
|
export * from "./factories/identityResolverConnectorFactory.js";
|
|
5
|
+
export * from "./models/api/identity/IIdentityAlsoKnownAsCreateRequest.js";
|
|
6
|
+
export * from "./models/api/identity/IIdentityAlsoKnownAsRemoveRequest.js";
|
|
5
7
|
export * from "./models/api/identity/IIdentityCreateRequest.js";
|
|
6
8
|
export * from "./models/api/identity/IIdentityCreateResponse.js";
|
|
7
9
|
export * from "./models/api/identity/IIdentityProofCreateRequest.js";
|
|
@@ -16,10 +18,12 @@ export * from "./models/api/identity/IIdentityVerifiableCredentialCreateRequest.
|
|
|
16
18
|
export * from "./models/api/identity/IIdentityVerifiableCredentialCreateResponse.js";
|
|
17
19
|
export * from "./models/api/identity/IIdentityVerifiableCredentialRevokeRequest.js";
|
|
18
20
|
export * from "./models/api/identity/IIdentityVerifiableCredentialUnrevokeRequest.js";
|
|
21
|
+
export * from "./models/api/identity/IIdentityVerifiableCredentialVerifyDocumentRequest.js";
|
|
19
22
|
export * from "./models/api/identity/IIdentityVerifiableCredentialVerifyRequest.js";
|
|
20
23
|
export * from "./models/api/identity/IIdentityVerifiableCredentialVerifyResponse.js";
|
|
21
24
|
export * from "./models/api/identity/IIdentityVerifiablePresentationCreateRequest.js";
|
|
22
25
|
export * from "./models/api/identity/IIdentityVerifiablePresentationCreateResponse.js";
|
|
26
|
+
export * from "./models/api/identity/IIdentityVerifiablePresentationVerifyDocumentRequest.js";
|
|
23
27
|
export * from "./models/api/identity/IIdentityVerifiablePresentationVerifyRequest.js";
|
|
24
28
|
export * from "./models/api/identity/IIdentityVerifiablePresentationVerifyResponse.js";
|
|
25
29
|
export * from "./models/api/identity/IIdentityVerificationMethodCreateRequest.js";
|
|
@@ -58,6 +58,28 @@ export interface IIdentityComponent extends IComponent {
|
|
|
58
58
|
* @throws NotFoundError if the id can not be resolved.
|
|
59
59
|
*/
|
|
60
60
|
serviceRemove(serviceId: string, controller?: string): Promise<void>;
|
|
61
|
+
/**
|
|
62
|
+
* Add an alias to the alsoKnownAs property on the document.
|
|
63
|
+
* If the alias is already present the operation is a no-op.
|
|
64
|
+
* @param documentId The id of the document to update.
|
|
65
|
+
* @param alias The alias to add. Must be a Url or Urn (typically another DID).
|
|
66
|
+
* @param controller The controller of the identity who can make changes.
|
|
67
|
+
* @returns Nothing.
|
|
68
|
+
* @throws GeneralError if the alias is not a Url or Urn.
|
|
69
|
+
* @throws NotFoundError if the id can not be resolved.
|
|
70
|
+
*/
|
|
71
|
+
alsoKnownAsAdd(documentId: string, alias: string, controller?: string): Promise<void>;
|
|
72
|
+
/**
|
|
73
|
+
* Remove an alias from the alsoKnownAs property on the document.
|
|
74
|
+
* If the alias is not present the operation is a no-op.
|
|
75
|
+
* @param documentId The id of the document to update.
|
|
76
|
+
* @param alias The alias to remove. Must be a Url or Urn.
|
|
77
|
+
* @param controller The controller of the identity who can make changes.
|
|
78
|
+
* @returns Nothing.
|
|
79
|
+
* @throws GeneralError if the alias is not a Url or Urn.
|
|
80
|
+
* @throws NotFoundError if the id can not be resolved.
|
|
81
|
+
*/
|
|
82
|
+
alsoKnownAsRemove(documentId: string, alias: string, controller?: string): Promise<void>;
|
|
61
83
|
/**
|
|
62
84
|
* Create a verifiable credential for a verification method.
|
|
63
85
|
* @param verificationMethodId The verification method id to use.
|
|
@@ -79,10 +101,10 @@ export interface IIdentityComponent extends IComponent {
|
|
|
79
101
|
}>;
|
|
80
102
|
/**
|
|
81
103
|
* Verify a verifiable credential is valid.
|
|
82
|
-
* @param
|
|
104
|
+
* @param credential The credential to verify.
|
|
83
105
|
* @returns The credential stored in the jwt and the revocation status.
|
|
84
106
|
*/
|
|
85
|
-
verifiableCredentialVerify(
|
|
107
|
+
verifiableCredentialVerify(credential: string | IDidVerifiableCredential): Promise<{
|
|
86
108
|
revoked: boolean;
|
|
87
109
|
verifiableCredential?: IDidVerifiableCredential;
|
|
88
110
|
}>;
|
|
@@ -109,21 +131,24 @@ export interface IIdentityComponent extends IComponent {
|
|
|
109
131
|
* @param contexts The contexts for the data stored in the verifiable credential.
|
|
110
132
|
* @param types The types for the data stored in the verifiable credential.
|
|
111
133
|
* @param verifiableCredentials The credentials to use for creating the presentation in jwt format.
|
|
112
|
-
* @param
|
|
134
|
+
* @param options Additional options for creating the verifiable presentation.
|
|
135
|
+
* @param options.expirationDate The date the verifiable presentation is valid until.
|
|
113
136
|
* @param controller The controller of the identity who can make changes.
|
|
114
137
|
* @returns The created verifiable presentation and its token.
|
|
115
138
|
* @throws NotFoundError if the id can not be resolved.
|
|
116
139
|
*/
|
|
117
|
-
verifiablePresentationCreate(verificationMethodId: string, presentationId: string | undefined, contexts: IJsonLdContextDefinitionRoot | undefined, types: string | string[] | undefined, verifiableCredentials: (string | IDidVerifiableCredential)[],
|
|
140
|
+
verifiablePresentationCreate(verificationMethodId: string, presentationId: string | undefined, contexts: IJsonLdContextDefinitionRoot | undefined, types: string | string[] | undefined, verifiableCredentials: (string | IDidVerifiableCredential)[], options?: {
|
|
141
|
+
expirationDate?: Date;
|
|
142
|
+
}, controller?: string): Promise<{
|
|
118
143
|
verifiablePresentation: IDidVerifiablePresentation;
|
|
119
144
|
jwt: string;
|
|
120
145
|
}>;
|
|
121
146
|
/**
|
|
122
147
|
* Verify a verifiable presentation is valid.
|
|
123
|
-
* @param
|
|
148
|
+
* @param presentation The presentation to verify.
|
|
124
149
|
* @returns The presentation stored in the jwt and the revocation status.
|
|
125
150
|
*/
|
|
126
|
-
verifiablePresentationVerify(
|
|
151
|
+
verifiablePresentationVerify(presentation: string | IDidVerifiablePresentation): Promise<{
|
|
127
152
|
revoked: boolean;
|
|
128
153
|
verifiablePresentation?: IDidVerifiablePresentation;
|
|
129
154
|
issuers?: IDidDocument[];
|
|
@@ -57,6 +57,28 @@ export interface IIdentityConnector extends IComponent {
|
|
|
57
57
|
* @throws NotFoundError if the id can not be resolved.
|
|
58
58
|
*/
|
|
59
59
|
removeService(controller: string, serviceId: string): Promise<void>;
|
|
60
|
+
/**
|
|
61
|
+
* Add an alias to the alsoKnownAs property on the document.
|
|
62
|
+
* If the alias is already present the operation is a no-op.
|
|
63
|
+
* @param controller The controller of the identity who can make changes.
|
|
64
|
+
* @param documentId The id of the document to update.
|
|
65
|
+
* @param alias The alias to add. Must be a Url or Urn (typically another DID).
|
|
66
|
+
* @returns Nothing.
|
|
67
|
+
* @throws GeneralError if the alias is not a Url or Urn.
|
|
68
|
+
* @throws NotFoundError if the id can not be resolved.
|
|
69
|
+
*/
|
|
70
|
+
addAlsoKnownAs(controller: string, documentId: string, alias: string): Promise<void>;
|
|
71
|
+
/**
|
|
72
|
+
* Remove an alias from the alsoKnownAs property on the document.
|
|
73
|
+
* If the alias is not present the operation is a no-op.
|
|
74
|
+
* @param controller The controller of the identity who can make changes.
|
|
75
|
+
* @param documentId The id of the document to update.
|
|
76
|
+
* @param alias The alias to remove. Must be a Url or Urn.
|
|
77
|
+
* @returns Nothing.
|
|
78
|
+
* @throws GeneralError if the alias is not a Url or Urn.
|
|
79
|
+
* @throws NotFoundError if the id can not be resolved.
|
|
80
|
+
*/
|
|
81
|
+
removeAlsoKnownAs(controller: string, documentId: string, alias: string): Promise<void>;
|
|
60
82
|
/**
|
|
61
83
|
* Create a verifiable credential for a verification method.
|
|
62
84
|
* @param controller The controller of the identity who can make changes.
|
|
@@ -78,10 +100,10 @@ export interface IIdentityConnector extends IComponent {
|
|
|
78
100
|
}>;
|
|
79
101
|
/**
|
|
80
102
|
* Check a verifiable credential is valid.
|
|
81
|
-
* @param
|
|
103
|
+
* @param credential The credential to verify.
|
|
82
104
|
* @returns The credential stored in the jwt and the revocation status.
|
|
83
105
|
*/
|
|
84
|
-
checkVerifiableCredential(
|
|
106
|
+
checkVerifiableCredential(credential: string | IDidVerifiableCredential): Promise<{
|
|
85
107
|
revoked: boolean;
|
|
86
108
|
verifiableCredential?: IDidVerifiableCredential;
|
|
87
109
|
}>;
|
|
@@ -109,20 +131,23 @@ export interface IIdentityConnector extends IComponent {
|
|
|
109
131
|
* @param contexts The contexts for the data stored in the verifiable credential.
|
|
110
132
|
* @param types The types for the data stored in the verifiable credential.
|
|
111
133
|
* @param verifiableCredentials The credentials to use for creating the presentation in jwt format.
|
|
112
|
-
* @param
|
|
134
|
+
* @param options Additional options for creating the verifiable presentation.
|
|
135
|
+
* @param options.expirationDate The date the verifiable presentation is valid until.
|
|
113
136
|
* @returns The created verifiable presentation and its token.
|
|
114
137
|
* @throws NotFoundError if the id can not be resolved.
|
|
115
138
|
*/
|
|
116
|
-
createVerifiablePresentation(controller: string, verificationMethodId: string, presentationId: string | undefined, contexts: IJsonLdContextDefinitionRoot | undefined, types: string | string[] | undefined, verifiableCredentials: (string | IDidVerifiableCredential)[],
|
|
139
|
+
createVerifiablePresentation(controller: string, verificationMethodId: string, presentationId: string | undefined, contexts: IJsonLdContextDefinitionRoot | undefined, types: string | string[] | undefined, verifiableCredentials: (string | IDidVerifiableCredential)[], options?: {
|
|
140
|
+
expirationDate?: Date;
|
|
141
|
+
}): Promise<{
|
|
117
142
|
verifiablePresentation: IDidVerifiablePresentation;
|
|
118
143
|
jwt: string;
|
|
119
144
|
}>;
|
|
120
145
|
/**
|
|
121
146
|
* Check a verifiable presentation is valid.
|
|
122
|
-
* @param
|
|
147
|
+
* @param presentation The presentation to verify.
|
|
123
148
|
* @returns The presentation stored in the jwt and the revocation status.
|
|
124
149
|
*/
|
|
125
|
-
checkVerifiablePresentation(
|
|
150
|
+
checkVerifiablePresentation(presentation: string | IDidVerifiablePresentation): Promise<{
|
|
126
151
|
revoked: boolean;
|
|
127
152
|
verifiablePresentation?: IDidVerifiablePresentation;
|
|
128
153
|
issuers?: IDidDocument[];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Request to create an alias for an identity.
|
|
3
|
+
*/
|
|
4
|
+
export interface IIdentityAlsoKnownAsCreateRequest {
|
|
5
|
+
/**
|
|
6
|
+
* The path parameters.
|
|
7
|
+
*/
|
|
8
|
+
pathParams: {
|
|
9
|
+
/**
|
|
10
|
+
* The identity to create the alias for.
|
|
11
|
+
*/
|
|
12
|
+
identity: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* The data for the request.
|
|
16
|
+
*/
|
|
17
|
+
body: {
|
|
18
|
+
/**
|
|
19
|
+
* The alias to create for the identity.
|
|
20
|
+
*/
|
|
21
|
+
alias: string;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Request to remove an alias from an identity.
|
|
3
|
+
*/
|
|
4
|
+
export interface IIdentityAlsoKnownAsRemoveRequest {
|
|
5
|
+
/**
|
|
6
|
+
* The path parameters.
|
|
7
|
+
*/
|
|
8
|
+
pathParams: {
|
|
9
|
+
/**
|
|
10
|
+
* The identity to remove the alias from.
|
|
11
|
+
*/
|
|
12
|
+
identity: string;
|
|
13
|
+
/**
|
|
14
|
+
* The alias to remove.
|
|
15
|
+
*/
|
|
16
|
+
alias: string;
|
|
17
|
+
};
|
|
18
|
+
}
|
package/dist/types/models/api/identity/IIdentityVerifiableCredentialVerifyDocumentRequest.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IDidVerifiableCredential } from "@twin.org/standards-w3c-did";
|
|
2
|
+
/**
|
|
3
|
+
* Request to verify a verifiable credential.
|
|
4
|
+
*/
|
|
5
|
+
export interface IIdentityVerifiableCredentialVerifyDocumentRequest {
|
|
6
|
+
/**
|
|
7
|
+
* The body parameters.
|
|
8
|
+
*/
|
|
9
|
+
body: IDidVerifiableCredential;
|
|
10
|
+
}
|
|
@@ -38,8 +38,8 @@ export interface IIdentityVerifiablePresentationCreateRequest {
|
|
|
38
38
|
*/
|
|
39
39
|
verifiableCredentials: (string | IDidVerifiableCredential)[];
|
|
40
40
|
/**
|
|
41
|
-
* The expiration time for the presentation.
|
|
41
|
+
* The expiration date/time for the presentation.
|
|
42
42
|
*/
|
|
43
|
-
|
|
43
|
+
expirationDate?: string;
|
|
44
44
|
};
|
|
45
45
|
}
|
package/dist/types/models/api/identity/IIdentityVerifiablePresentationVerifyDocumentRequest.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IDidVerifiablePresentation } from "@twin.org/standards-w3c-did";
|
|
2
|
+
/**
|
|
3
|
+
* Request to verify a verifiable presentation.
|
|
4
|
+
*/
|
|
5
|
+
export interface IIdentityVerifiablePresentationVerifyDocumentRequest {
|
|
6
|
+
/**
|
|
7
|
+
* The body parameters.
|
|
8
|
+
*/
|
|
9
|
+
body: IDidVerifiablePresentation;
|
|
10
|
+
}
|