@twin.org/identity-models 0.0.3-next.3 → 0.0.3-next.30
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 +6 -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/IIdentityVerifiableCredentialCreateRequest.js.map +1 -1
- 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/es/models/identityMetricIds.js +49 -0
- package/dist/es/models/identityMetricIds.js.map +1 -0
- package/dist/es/models/identityMetrics.js +61 -0
- package/dist/es/models/identityMetrics.js.map +1 -0
- package/dist/types/contextIdHandlers/didContextIdHandler.d.ts +5 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/models/IIdentityComponent.d.ts +47 -6
- package/dist/types/models/IIdentityConnector.d.ts +47 -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/IIdentityVerifiableCredentialCreateRequest.d.ts +12 -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 +14 -2
- package/dist/types/models/api/identity/IIdentityVerifiablePresentationVerifyDocumentRequest.d.ts +10 -0
- package/dist/types/models/identityMetricIds.d.ts +49 -0
- package/dist/types/models/identityMetrics.d.ts +5 -0
- package/docs/changelog.md +304 -76
- 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 +10 -0
- package/docs/reference/interfaces/IIdentityAlsoKnownAsCreateRequest.md +31 -0
- package/docs/reference/interfaces/IIdentityAlsoKnownAsRemoveRequest.md +23 -0
- package/docs/reference/interfaces/IIdentityComponent.md +150 -36
- package/docs/reference/interfaces/IIdentityConnector.md +150 -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 +25 -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 +28 -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/docs/reference/type-aliases/IdentityMetricIds.md +5 -0
- package/docs/reference/variables/IdentityMetricIds.md +67 -0
- package/docs/reference/variables/IdentityMetrics.md +5 -0
- package/package.json +5 -4
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";
|
|
@@ -43,6 +47,8 @@ export * from "./models/IIdentityProfileComponent.js";
|
|
|
43
47
|
export * from "./models/IIdentityProfileConnector.js";
|
|
44
48
|
export * from "./models/IIdentityResolverComponent.js";
|
|
45
49
|
export * from "./models/IIdentityResolverConnector.js";
|
|
50
|
+
export * from "./models/identityMetricIds.js";
|
|
51
|
+
export * from "./models/identityMetrics.js";
|
|
46
52
|
export * from "./types/did.js";
|
|
47
53
|
export * from "./utils/documentHelper.js";
|
|
48
54
|
export * from "./utils/verificationHelper.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,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,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 \"./models/identityMetricIds.js\";\nexport * from \"./models/identityMetrics.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 credentialJwt The credential to verify.\n\t * @returns The credential stored in the jwt and the revocation status.\n\t */\n\tverifiableCredentialVerify(credentialJwt: string): 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 expiresInMinutes The time in minutes for the presentation to expire.\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\texpiresInMinutes?: number,\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 presentationJwt The presentation to verify.\n\t * @returns The presentation stored in the jwt and the revocation status.\n\t */\n\tverifiablePresentationVerify(presentationJwt: string): 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
|
+
{"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 options.jwtHeaderFields Additional fields to include in the JWT header when creating the verifiable credential in jwt format.\n\t * @param options.jwtPayloadFields Additional fields to include in the JWT payload when creating the verifiable credential in jwt format.\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\tjwtHeaderFields?: { [id: string]: string };\n\t\t\tjwtPayloadFields?: { [id: string]: string };\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 options.jwtHeaderFields Additional fields to include in the JWT header when creating the verifiable presentation in jwt format.\n\t * @param options.jwtPayloadFields\tAdditional fields to include in the JWT payload when creating the verifiable presentation in jwt format.\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\tjwtHeaderFields?: { [id: string]: string };\n\t\t\tjwtPayloadFields?: { [id: string]: string };\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 credentialJwt The credential to verify.\n\t * @returns The credential stored in the jwt and the revocation status.\n\t */\n\tcheckVerifiableCredential(credentialJwt: string): 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 expiresInMinutes The time in minutes for the presentation to expire.\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\texpiresInMinutes?: number\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 presentationJwt The presentation to verify.\n\t * @returns The presentation stored in the jwt and the revocation status.\n\t */\n\tcheckVerifiablePresentation(presentationJwt: string): 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"]}
|
|
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 * @param options.jwtHeaderFields Additional fields to include in the JWT header when creating the verifiable credential in jwt format.\n\t * @param options.jwtPayloadFields\tAdditional fields to include in the JWT payload when creating the verifiable credential in jwt format.\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\tjwtHeaderFields?: { [id: string]: string };\n\t\t\tjwtPayloadFields?: { [id: string]: string };\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 * @param options.jwtHeaderFields Additional fields to include in the JWT header when creating the verifiable presentation in jwt format.\n\t * @param options.jwtPayloadFields Additional fields to include in the JWT payload when creating the verifiable presentation in jwt format.\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?: {\n\t\t\texpirationDate?: Date;\n\t\t\tjwtHeaderFields?: { [id: string]: string };\n\t\t\tjwtPayloadFields?: { [id: string]: string };\n\t\t}\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":"IIdentityVerifiableCredentialCreateRequest.js","sourceRoot":"","sources":["../../../../../src/models/api/identity/IIdentityVerifiableCredentialCreateRequest.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IJsonLdNodeObject } from \"@twin.org/data-json-ld\";\n\n/**\n * Request to create a verifiable credential.\n */\nexport interface IIdentityVerifiableCredentialCreateRequest {\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The identity to create the verification credential 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 credential.\n\t\t */\n\t\tcredentialId?: string;\n\n\t\t/**\n\t\t * The credential subject to store in the verifiable credential.\n\t\t */\n\t\tsubject: IJsonLdNodeObject;\n\n\t\t/**\n\t\t * The bitmap revocation index of the credential, if undefined will not have revocation status.\n\t\t */\n\t\trevocationIndex?: number;\n\n\t\t/**\n\t\t * The date the verifiable credential is valid until.\n\t\t */\n\t\texpirationDate?: string;\n\t};\n}\n"]}
|
|
1
|
+
{"version":3,"file":"IIdentityVerifiableCredentialCreateRequest.js","sourceRoot":"","sources":["../../../../../src/models/api/identity/IIdentityVerifiableCredentialCreateRequest.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IJsonLdNodeObject } from \"@twin.org/data-json-ld\";\n\n/**\n * Request to create a verifiable credential.\n */\nexport interface IIdentityVerifiableCredentialCreateRequest {\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The identity to create the verification credential 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 credential.\n\t\t */\n\t\tcredentialId?: string;\n\n\t\t/**\n\t\t * The credential subject to store in the verifiable credential.\n\t\t */\n\t\tsubject: IJsonLdNodeObject;\n\n\t\t/**\n\t\t * The bitmap revocation index of the credential, if undefined will not have revocation status.\n\t\t */\n\t\trevocationIndex?: number;\n\n\t\t/**\n\t\t * The date the verifiable credential is valid until.\n\t\t */\n\t\texpirationDate?: string;\n\n\t\t/**\n\t\t * Additional fields to include in the JWT when creating the verifiable credential in jwt format.\n\t\t */\n\t\tjwtHeaderFields?: { [id: string]: string };\n\n\t\t/**\n\t\t * Additional fields to include in the JWT payload when creating the verifiable credential in jwt format.\n\t\t */\n\t\tjwtPayloadFields?: { [id: string]: 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\n\t\t/**\n\t\t * Additional fields to include in the JWT header when creating the verifiable presentation in jwt format.\n\t\t */\n\t\tjwtHeaderFields?: { [id: string]: string };\n\n\t\t/**\n\t\t * Additional fields to include in the JWT payload when creating the verifiable presentation in jwt format.\n\t\t */\n\t\tjwtPayloadFields?: { [id: string]: 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"]}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Copyright 2026 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
/**
|
|
4
|
+
* Metric IDs for the identity service.
|
|
5
|
+
*/
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
7
|
+
export const IdentityMetricIds = {
|
|
8
|
+
/**
|
|
9
|
+
* Number of DIDs created.
|
|
10
|
+
*/
|
|
11
|
+
DidsCreated: "identity_dids_created",
|
|
12
|
+
/**
|
|
13
|
+
* Number of DIDs removed.
|
|
14
|
+
*/
|
|
15
|
+
DidsRemoved: "identity_dids_removed",
|
|
16
|
+
/**
|
|
17
|
+
* Number of verifiable credentials created.
|
|
18
|
+
*/
|
|
19
|
+
VcsCreated: "identity_vcs_created",
|
|
20
|
+
/**
|
|
21
|
+
* Number of VC verifications succeeded.
|
|
22
|
+
*/
|
|
23
|
+
VcsVerified: "identity_vcs_verified",
|
|
24
|
+
/**
|
|
25
|
+
* Number of VC verifications failed.
|
|
26
|
+
*/
|
|
27
|
+
VcsVerificationFailed: "identity_vcs_verification_failed",
|
|
28
|
+
/**
|
|
29
|
+
* Number of VCs revoked.
|
|
30
|
+
*/
|
|
31
|
+
VcsRevoked: "identity_vcs_revoked",
|
|
32
|
+
/**
|
|
33
|
+
* Number of VCs unrevoked.
|
|
34
|
+
*/
|
|
35
|
+
VcsUnrevoked: "identity_vcs_unrevoked",
|
|
36
|
+
/**
|
|
37
|
+
* Number of verifiable presentations created.
|
|
38
|
+
*/
|
|
39
|
+
VpsCreated: "identity_vps_created",
|
|
40
|
+
/**
|
|
41
|
+
* Number of VP verifications succeeded.
|
|
42
|
+
*/
|
|
43
|
+
VpsVerified: "identity_vps_verified",
|
|
44
|
+
/**
|
|
45
|
+
* Number of VP verifications failed.
|
|
46
|
+
*/
|
|
47
|
+
VpsVerificationFailed: "identity_vps_verification_failed"
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=identityMetricIds.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identityMetricIds.js","sourceRoot":"","sources":["../../../src/models/identityMetricIds.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAChC;;OAEG;IACH,WAAW,EAAE,uBAAuB;IAEpC;;OAEG;IACH,WAAW,EAAE,uBAAuB;IAEpC;;OAEG;IACH,UAAU,EAAE,sBAAsB;IAElC;;OAEG;IACH,WAAW,EAAE,uBAAuB;IAEpC;;OAEG;IACH,qBAAqB,EAAE,kCAAkC;IAEzD;;OAEG;IACH,UAAU,EAAE,sBAAsB;IAElC;;OAEG;IACH,YAAY,EAAE,wBAAwB;IAEtC;;OAEG;IACH,UAAU,EAAE,sBAAsB;IAElC;;OAEG;IACH,WAAW,EAAE,uBAAuB;IAEpC;;OAEG;IACH,qBAAqB,EAAE,kCAAkC;CAChD,CAAC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Metric IDs for the identity service.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const IdentityMetricIds = {\n\t/**\n\t * Number of DIDs created.\n\t */\n\tDidsCreated: \"identity_dids_created\",\n\n\t/**\n\t * Number of DIDs removed.\n\t */\n\tDidsRemoved: \"identity_dids_removed\",\n\n\t/**\n\t * Number of verifiable credentials created.\n\t */\n\tVcsCreated: \"identity_vcs_created\",\n\n\t/**\n\t * Number of VC verifications succeeded.\n\t */\n\tVcsVerified: \"identity_vcs_verified\",\n\n\t/**\n\t * Number of VC verifications failed.\n\t */\n\tVcsVerificationFailed: \"identity_vcs_verification_failed\",\n\n\t/**\n\t * Number of VCs revoked.\n\t */\n\tVcsRevoked: \"identity_vcs_revoked\",\n\n\t/**\n\t * Number of VCs unrevoked.\n\t */\n\tVcsUnrevoked: \"identity_vcs_unrevoked\",\n\n\t/**\n\t * Number of verifiable presentations created.\n\t */\n\tVpsCreated: \"identity_vps_created\",\n\n\t/**\n\t * Number of VP verifications succeeded.\n\t */\n\tVpsVerified: \"identity_vps_verified\",\n\n\t/**\n\t * Number of VP verifications failed.\n\t */\n\tVpsVerificationFailed: \"identity_vps_verification_failed\"\n} as const;\n\n/**\n * Metric IDs for the identity service.\n */\nexport type IdentityMetricIds = (typeof IdentityMetricIds)[keyof typeof IdentityMetricIds];\n"]}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// Copyright 2026 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
import { MetricType } from "@twin.org/telemetry-models";
|
|
4
|
+
import { IdentityMetricIds } from "./identityMetricIds.js";
|
|
5
|
+
/**
|
|
6
|
+
* Metrics registered by the identity service.
|
|
7
|
+
*/
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
9
|
+
export const IdentityMetrics = [
|
|
10
|
+
{
|
|
11
|
+
id: IdentityMetricIds.DidsCreated,
|
|
12
|
+
label: "DIDs created",
|
|
13
|
+
type: MetricType.Counter
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
id: IdentityMetricIds.DidsRemoved,
|
|
17
|
+
label: "DIDs removed",
|
|
18
|
+
type: MetricType.Counter
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
id: IdentityMetricIds.VcsCreated,
|
|
22
|
+
label: "VCs created",
|
|
23
|
+
type: MetricType.Counter
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
id: IdentityMetricIds.VcsVerified,
|
|
27
|
+
label: "VC verifications succeeded",
|
|
28
|
+
type: MetricType.Counter
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: IdentityMetricIds.VcsVerificationFailed,
|
|
32
|
+
label: "VC verifications failed",
|
|
33
|
+
type: MetricType.Counter
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
id: IdentityMetricIds.VcsRevoked,
|
|
37
|
+
label: "VCs revoked",
|
|
38
|
+
type: MetricType.Counter
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
id: IdentityMetricIds.VcsUnrevoked,
|
|
42
|
+
label: "VCs unrevoked",
|
|
43
|
+
type: MetricType.Counter
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
id: IdentityMetricIds.VpsCreated,
|
|
47
|
+
label: "VPs created",
|
|
48
|
+
type: MetricType.Counter
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
id: IdentityMetricIds.VpsVerified,
|
|
52
|
+
label: "VP verifications succeeded",
|
|
53
|
+
type: MetricType.Counter
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
id: IdentityMetricIds.VpsVerificationFailed,
|
|
57
|
+
label: "VP verifications failed",
|
|
58
|
+
type: MetricType.Counter
|
|
59
|
+
}
|
|
60
|
+
];
|
|
61
|
+
//# sourceMappingURL=identityMetrics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identityMetrics.js","sourceRoot":"","sources":["../../../src/models/identityMetrics.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAyB,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,eAAe,GAAuB;IAClD;QACC,EAAE,EAAE,iBAAiB,CAAC,WAAW;QACjC,KAAK,EAAE,cAAc;QACrB,IAAI,EAAE,UAAU,CAAC,OAAO;KACxB;IACD;QACC,EAAE,EAAE,iBAAiB,CAAC,WAAW;QACjC,KAAK,EAAE,cAAc;QACrB,IAAI,EAAE,UAAU,CAAC,OAAO;KACxB;IACD;QACC,EAAE,EAAE,iBAAiB,CAAC,UAAU;QAChC,KAAK,EAAE,aAAa;QACpB,IAAI,EAAE,UAAU,CAAC,OAAO;KACxB;IACD;QACC,EAAE,EAAE,iBAAiB,CAAC,WAAW;QACjC,KAAK,EAAE,4BAA4B;QACnC,IAAI,EAAE,UAAU,CAAC,OAAO;KACxB;IACD;QACC,EAAE,EAAE,iBAAiB,CAAC,qBAAqB;QAC3C,KAAK,EAAE,yBAAyB;QAChC,IAAI,EAAE,UAAU,CAAC,OAAO;KACxB;IACD;QACC,EAAE,EAAE,iBAAiB,CAAC,UAAU;QAChC,KAAK,EAAE,aAAa;QACpB,IAAI,EAAE,UAAU,CAAC,OAAO;KACxB;IACD;QACC,EAAE,EAAE,iBAAiB,CAAC,YAAY;QAClC,KAAK,EAAE,eAAe;QACtB,IAAI,EAAE,UAAU,CAAC,OAAO;KACxB;IACD;QACC,EAAE,EAAE,iBAAiB,CAAC,UAAU;QAChC,KAAK,EAAE,aAAa;QACpB,IAAI,EAAE,UAAU,CAAC,OAAO;KACxB;IACD;QACC,EAAE,EAAE,iBAAiB,CAAC,WAAW;QACjC,KAAK,EAAE,4BAA4B;QACnC,IAAI,EAAE,UAAU,CAAC,OAAO;KACxB;IACD;QACC,EAAE,EAAE,iBAAiB,CAAC,qBAAqB;QAC3C,KAAK,EAAE,yBAAyB;QAChC,IAAI,EAAE,UAAU,CAAC,OAAO;KACxB;CACD,CAAC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { type ITelemetryMetric, MetricType } from \"@twin.org/telemetry-models\";\nimport { IdentityMetricIds } from \"./identityMetricIds.js\";\n\n/**\n * Metrics registered by the identity service.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const IdentityMetrics: ITelemetryMetric[] = [\n\t{\n\t\tid: IdentityMetricIds.DidsCreated,\n\t\tlabel: \"DIDs created\",\n\t\ttype: MetricType.Counter\n\t},\n\t{\n\t\tid: IdentityMetricIds.DidsRemoved,\n\t\tlabel: \"DIDs removed\",\n\t\ttype: MetricType.Counter\n\t},\n\t{\n\t\tid: IdentityMetricIds.VcsCreated,\n\t\tlabel: \"VCs created\",\n\t\ttype: MetricType.Counter\n\t},\n\t{\n\t\tid: IdentityMetricIds.VcsVerified,\n\t\tlabel: \"VC verifications succeeded\",\n\t\ttype: MetricType.Counter\n\t},\n\t{\n\t\tid: IdentityMetricIds.VcsVerificationFailed,\n\t\tlabel: \"VC verifications failed\",\n\t\ttype: MetricType.Counter\n\t},\n\t{\n\t\tid: IdentityMetricIds.VcsRevoked,\n\t\tlabel: \"VCs revoked\",\n\t\ttype: MetricType.Counter\n\t},\n\t{\n\t\tid: IdentityMetricIds.VcsUnrevoked,\n\t\tlabel: \"VCs unrevoked\",\n\t\ttype: MetricType.Counter\n\t},\n\t{\n\t\tid: IdentityMetricIds.VpsCreated,\n\t\tlabel: \"VPs created\",\n\t\ttype: MetricType.Counter\n\t},\n\t{\n\t\tid: IdentityMetricIds.VpsVerified,\n\t\tlabel: \"VP verifications succeeded\",\n\t\ttype: MetricType.Counter\n\t},\n\t{\n\t\tid: IdentityMetricIds.VpsVerificationFailed,\n\t\tlabel: \"VP verifications failed\",\n\t\ttype: MetricType.Counter\n\t}\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";
|
|
@@ -41,6 +45,8 @@ export * from "./models/IIdentityProfileComponent.js";
|
|
|
41
45
|
export * from "./models/IIdentityProfileConnector.js";
|
|
42
46
|
export * from "./models/IIdentityResolverComponent.js";
|
|
43
47
|
export * from "./models/IIdentityResolverConnector.js";
|
|
48
|
+
export * from "./models/identityMetricIds.js";
|
|
49
|
+
export * from "./models/identityMetrics.js";
|
|
44
50
|
export * from "./types/did.js";
|
|
45
51
|
export * from "./utils/documentHelper.js";
|
|
46
52
|
export * from "./utils/verificationHelper.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.
|
|
@@ -66,6 +88,8 @@ export interface IIdentityComponent extends IComponent {
|
|
|
66
88
|
* @param options Additional options for creating the verifiable credential.
|
|
67
89
|
* @param options.revocationIndex The bitmap revocation index of the credential, if undefined will not have revocation status.
|
|
68
90
|
* @param options.expirationDate The date the verifiable credential is valid until.
|
|
91
|
+
* @param options.jwtHeaderFields Additional fields to include in the JWT header when creating the verifiable credential in jwt format.
|
|
92
|
+
* @param options.jwtPayloadFields Additional fields to include in the JWT payload when creating the verifiable credential in jwt format.
|
|
69
93
|
* @param controller The controller of the identity who can make changes.
|
|
70
94
|
* @returns The created verifiable credential and its token.
|
|
71
95
|
* @throws NotFoundError if the id can not be resolved.
|
|
@@ -73,16 +97,22 @@ export interface IIdentityComponent extends IComponent {
|
|
|
73
97
|
verifiableCredentialCreate(verificationMethodId: string, id: string | undefined, subject: IJsonLdNodeObject, options?: {
|
|
74
98
|
revocationIndex?: number;
|
|
75
99
|
expirationDate?: Date;
|
|
100
|
+
jwtHeaderFields?: {
|
|
101
|
+
[id: string]: string;
|
|
102
|
+
};
|
|
103
|
+
jwtPayloadFields?: {
|
|
104
|
+
[id: string]: string;
|
|
105
|
+
};
|
|
76
106
|
}, controller?: string): Promise<{
|
|
77
107
|
verifiableCredential: IDidVerifiableCredential;
|
|
78
108
|
jwt: string;
|
|
79
109
|
}>;
|
|
80
110
|
/**
|
|
81
111
|
* Verify a verifiable credential is valid.
|
|
82
|
-
* @param
|
|
112
|
+
* @param credential The credential to verify.
|
|
83
113
|
* @returns The credential stored in the jwt and the revocation status.
|
|
84
114
|
*/
|
|
85
|
-
verifiableCredentialVerify(
|
|
115
|
+
verifiableCredentialVerify(credential: string | IDidVerifiableCredential): Promise<{
|
|
86
116
|
revoked: boolean;
|
|
87
117
|
verifiableCredential?: IDidVerifiableCredential;
|
|
88
118
|
}>;
|
|
@@ -109,21 +139,32 @@ export interface IIdentityComponent extends IComponent {
|
|
|
109
139
|
* @param contexts The contexts for the data stored in the verifiable credential.
|
|
110
140
|
* @param types The types for the data stored in the verifiable credential.
|
|
111
141
|
* @param verifiableCredentials The credentials to use for creating the presentation in jwt format.
|
|
112
|
-
* @param
|
|
142
|
+
* @param options Additional options for creating the verifiable presentation.
|
|
143
|
+
* @param options.expirationDate The date the verifiable presentation is valid until.
|
|
144
|
+
* @param options.jwtHeaderFields Additional fields to include in the JWT header when creating the verifiable presentation in jwt format.
|
|
145
|
+
* @param options.jwtPayloadFields Additional fields to include in the JWT payload when creating the verifiable presentation in jwt format.
|
|
113
146
|
* @param controller The controller of the identity who can make changes.
|
|
114
147
|
* @returns The created verifiable presentation and its token.
|
|
115
148
|
* @throws NotFoundError if the id can not be resolved.
|
|
116
149
|
*/
|
|
117
|
-
verifiablePresentationCreate(verificationMethodId: string, presentationId: string | undefined, contexts: IJsonLdContextDefinitionRoot | undefined, types: string | string[] | undefined, verifiableCredentials: (string | IDidVerifiableCredential)[],
|
|
150
|
+
verifiablePresentationCreate(verificationMethodId: string, presentationId: string | undefined, contexts: IJsonLdContextDefinitionRoot | undefined, types: string | string[] | undefined, verifiableCredentials: (string | IDidVerifiableCredential)[], options?: {
|
|
151
|
+
expirationDate?: Date;
|
|
152
|
+
jwtHeaderFields?: {
|
|
153
|
+
[id: string]: string;
|
|
154
|
+
};
|
|
155
|
+
jwtPayloadFields?: {
|
|
156
|
+
[id: string]: string;
|
|
157
|
+
};
|
|
158
|
+
}, controller?: string): Promise<{
|
|
118
159
|
verifiablePresentation: IDidVerifiablePresentation;
|
|
119
160
|
jwt: string;
|
|
120
161
|
}>;
|
|
121
162
|
/**
|
|
122
163
|
* Verify a verifiable presentation is valid.
|
|
123
|
-
* @param
|
|
164
|
+
* @param presentation The presentation to verify.
|
|
124
165
|
* @returns The presentation stored in the jwt and the revocation status.
|
|
125
166
|
*/
|
|
126
|
-
verifiablePresentationVerify(
|
|
167
|
+
verifiablePresentationVerify(presentation: string | IDidVerifiablePresentation): Promise<{
|
|
127
168
|
revoked: boolean;
|
|
128
169
|
verifiablePresentation?: IDidVerifiablePresentation;
|
|
129
170
|
issuers?: IDidDocument[];
|