@twin.org/identity-connector-entity-storage 0.0.3-next.9 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"entityStorageIdentityResolverConnector.js","sourceRoot":"","sources":["../../src/entityStorageIdentityResolverConnector.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,EACN,6BAA6B,EAE7B,MAAM,iCAAiC,CAAC;AAIzC,OAAO,EAAE,qBAAqB,EAAwB,MAAM,wBAAwB,CAAC;AAErF,OAAO,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AAGrF;;GAEG;AACH,MAAM,OAAO,sCAAsC;IAClD;;OAEG;IACI,MAAM,CAAU,SAAS,GAAW,gBAAgB,CAAC;IAE5D;;OAEG;IACI,MAAM,CAAU,UAAU,4CAA4D;IAE7F;;;OAGG;IACgB,yBAAyB,CAA4C;IAExF;;;OAGG;IACgB,eAAe,CAAkB;IAEpD;;;OAGG;IACH,YAAY,OAAmE;QAC9E,IAAI,CAAC,yBAAyB,GAAG,6BAA6B,CAAC,GAAG,CACjE,OAAO,EAAE,4BAA4B,IAAI,mBAAmB,CAC5D,CAAC;QACF,IAAI,CAAC,eAAe,GAAG,qBAAqB,CAAC,GAAG,CAAC,OAAO,EAAE,kBAAkB,IAAI,OAAO,CAAC,CAAC;IAC1F,CAAC;IAED;;;OAGG;IACI,SAAS;QACf,OAAO,sCAAsC,CAAC,UAAU,CAAC;IAC1D,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,eAAe,CAAC,UAAkB;QAC9C,MAAM,CAAC,WAAW,CACjB,sCAAsC,CAAC,UAAU,gBAEjD,UAAU,CACV,CAAC;QAEF,IAAI,CAAC;YACJ,MAAM,mBAAmB,GAAG,MAAM,IAAI,CAAC,yBAAyB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YACjF,IAAI,EAAE,CAAC,SAAS,CAAC,mBAAmB,CAAC,EAAE,CAAC;gBACvC,MAAM,IAAI,aAAa,CACtB,sCAAsC,CAAC,UAAU,EACjD,kBAAkB,EAClB,UAAU,CACV,CAAC;YACH,CAAC;YACD,MAAM,8BAA8B,CAAC,cAAc,CAClD,mBAAmB,EACnB,IAAI,CAAC,eAAe,CACpB,CAAC;YAEF,OAAO,mBAAmB,CAAC,QAAQ,CAAC;QACrC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,MAAM,IAAI,YAAY,CACrB,sCAAsC,CAAC,UAAU,EACjD,uBAAuB,EACvB,SAAS,EACT,KAAK,CACL,CAAC;QACH,CAAC;IACF,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { GeneralError, Guards, Is, NotFoundError } from \"@twin.org/core\";\nimport {\n\tEntityStorageConnectorFactory,\n\ttype IEntityStorageConnector\n} from \"@twin.org/entity-storage-models\";\nimport type { IIdentityResolverConnector } from \"@twin.org/identity-models\";\nimport { nameof } from \"@twin.org/nameof\";\nimport type { IDidDocument } from \"@twin.org/standards-w3c-did\";\nimport { VaultConnectorFactory, type IVaultConnector } from \"@twin.org/vault-models\";\nimport type { IdentityDocument } from \"./entities/identityDocument.js\";\nimport { EntityStorageIdentityConnector } from \"./entityStorageIdentityConnector.js\";\nimport type { IEntityStorageIdentityResolverConnectorConstructorOptions } from \"./models/IEntityStorageIdentityResolverConnectorConstructorOptions.js\";\n\n/**\n * Class for performing identity operations using entity storage.\n */\nexport class EntityStorageIdentityResolverConnector implements IIdentityResolverConnector {\n\t/**\n\t * The namespace supported by the identity connector.\n\t */\n\tpublic static readonly NAMESPACE: string = \"entity-storage\";\n\n\t/**\n\t * Runtime name for the class.\n\t */\n\tpublic static readonly CLASS_NAME: string = nameof<EntityStorageIdentityResolverConnector>();\n\n\t/**\n\t * The entity storage for identities.\n\t * @internal\n\t */\n\tprotected readonly _didDocumentEntityStorage: IEntityStorageConnector<IdentityDocument>;\n\n\t/**\n\t * The vault for the keys.\n\t * @internal\n\t */\n\tprotected readonly _vaultConnector: IVaultConnector;\n\n\t/**\n\t * Create a new instance of EntityStorageIdentityResolverConnector.\n\t * @param options The options for the identity connector.\n\t */\n\tconstructor(options?: IEntityStorageIdentityResolverConnectorConstructorOptions) {\n\t\tthis._didDocumentEntityStorage = EntityStorageConnectorFactory.get(\n\t\t\toptions?.didDocumentEntityStorageType ?? \"identity-document\"\n\t\t);\n\t\tthis._vaultConnector = VaultConnectorFactory.get(options?.vaultConnectorType ?? \"vault\");\n\t}\n\n\t/**\n\t * Returns the class name of the component.\n\t * @returns The class name of the component.\n\t */\n\tpublic className(): string {\n\t\treturn EntityStorageIdentityResolverConnector.CLASS_NAME;\n\t}\n\n\t/**\n\t * Resolve a document from its id.\n\t * @param documentId The id of the document to resolve.\n\t * @returns The resolved document.\n\t * @throws NotFoundError if the id can not be resolved.\n\t */\n\tpublic async resolveDocument(documentId: string): Promise<IDidDocument> {\n\t\tGuards.stringValue(\n\t\t\tEntityStorageIdentityResolverConnector.CLASS_NAME,\n\t\t\tnameof(documentId),\n\t\t\tdocumentId\n\t\t);\n\n\t\ttry {\n\t\t\tconst didIdentityDocument = await this._didDocumentEntityStorage.get(documentId);\n\t\t\tif (Is.undefined(didIdentityDocument)) {\n\t\t\t\tthrow new NotFoundError(\n\t\t\t\t\tEntityStorageIdentityResolverConnector.CLASS_NAME,\n\t\t\t\t\t\"documentNotFound\",\n\t\t\t\t\tdocumentId\n\t\t\t\t);\n\t\t\t}\n\t\t\tawait EntityStorageIdentityConnector.verifyDocument(\n\t\t\t\tdidIdentityDocument,\n\t\t\t\tthis._vaultConnector\n\t\t\t);\n\n\t\t\treturn didIdentityDocument.document;\n\t\t} catch (error) {\n\t\t\tthrow new GeneralError(\n\t\t\t\tEntityStorageIdentityResolverConnector.CLASS_NAME,\n\t\t\t\t\"resolveDocumentFailed\",\n\t\t\t\tundefined,\n\t\t\t\terror\n\t\t\t);\n\t\t}\n\t}\n}\n"]}
1
+ {"version":3,"file":"entityStorageIdentityResolverConnector.js","sourceRoot":"","sources":["../../src/entityStorageIdentityResolverConnector.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,EACN,6BAA6B,EAE7B,MAAM,iCAAiC,CAAC;AAIzC,OAAO,EAAE,qBAAqB,EAAwB,MAAM,wBAAwB,CAAC;AAErF,OAAO,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AAGrF;;GAEG;AACH,MAAM,OAAO,sCAAsC;IAClD;;OAEG;IACI,MAAM,CAAU,SAAS,GAAW,gBAAgB,CAAC;IAE5D;;OAEG;IACI,MAAM,CAAU,UAAU,4CAA4D;IAE7F;;;OAGG;IACgB,yBAAyB,CAA4C;IAExF;;;OAGG;IACgB,eAAe,CAAkB;IAEpD;;;OAGG;IACH,YAAY,OAAmE;QAC9E,IAAI,CAAC,yBAAyB,GAAG,6BAA6B,CAAC,GAAG,CACjE,OAAO,EAAE,4BAA4B,IAAI,mBAAmB,CAC5D,CAAC;QACF,IAAI,CAAC,eAAe,GAAG,qBAAqB,CAAC,GAAG,CAAC,OAAO,EAAE,kBAAkB,IAAI,OAAO,CAAC,CAAC;IAC1F,CAAC;IAED;;;OAGG;IACI,SAAS;QACf,OAAO,sCAAsC,CAAC,UAAU,CAAC;IAC1D,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,eAAe,CAAC,UAAkB;QAC9C,MAAM,CAAC,WAAW,CACjB,sCAAsC,CAAC,UAAU,gBAEjD,UAAU,CACV,CAAC;QAEF,IAAI,CAAC;YACJ,MAAM,mBAAmB,GAAG,MAAM,IAAI,CAAC,yBAAyB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YACjF,IAAI,EAAE,CAAC,SAAS,CAAC,mBAAmB,CAAC,EAAE,CAAC;gBACvC,MAAM,IAAI,aAAa,CACtB,sCAAsC,CAAC,UAAU,EACjD,kBAAkB,EAClB,UAAU,CACV,CAAC;YACH,CAAC;YACD,MAAM,8BAA8B,CAAC,cAAc,CAClD,mBAAmB,EACnB,IAAI,CAAC,eAAe,CACpB,CAAC;YAEF,OAAO,mBAAmB,CAAC,QAAQ,CAAC;QACrC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,MAAM,IAAI,YAAY,CACrB,sCAAsC,CAAC,UAAU,EACjD,uBAAuB,EACvB,EAAE,UAAU,EAAE,EACd,KAAK,CACL,CAAC;QACH,CAAC;IACF,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { GeneralError, Guards, Is, NotFoundError } from \"@twin.org/core\";\nimport {\n\tEntityStorageConnectorFactory,\n\ttype IEntityStorageConnector\n} from \"@twin.org/entity-storage-models\";\nimport type { IIdentityResolverConnector } from \"@twin.org/identity-models\";\nimport { nameof } from \"@twin.org/nameof\";\nimport type { IDidDocument } from \"@twin.org/standards-w3c-did\";\nimport { VaultConnectorFactory, type IVaultConnector } from \"@twin.org/vault-models\";\nimport type { IdentityDocument } from \"./entities/identityDocument.js\";\nimport { EntityStorageIdentityConnector } from \"./entityStorageIdentityConnector.js\";\nimport type { IEntityStorageIdentityResolverConnectorConstructorOptions } from \"./models/IEntityStorageIdentityResolverConnectorConstructorOptions.js\";\n\n/**\n * Class for performing identity operations using entity storage.\n */\nexport class EntityStorageIdentityResolverConnector implements IIdentityResolverConnector {\n\t/**\n\t * The namespace supported by the identity connector.\n\t */\n\tpublic static readonly NAMESPACE: string = \"entity-storage\";\n\n\t/**\n\t * Runtime name for the class.\n\t */\n\tpublic static readonly CLASS_NAME: string = nameof<EntityStorageIdentityResolverConnector>();\n\n\t/**\n\t * The entity storage for identities.\n\t * @internal\n\t */\n\tprotected readonly _didDocumentEntityStorage: IEntityStorageConnector<IdentityDocument>;\n\n\t/**\n\t * The vault for the keys.\n\t * @internal\n\t */\n\tprotected readonly _vaultConnector: IVaultConnector;\n\n\t/**\n\t * Create a new instance of EntityStorageIdentityResolverConnector.\n\t * @param options The options for the identity connector.\n\t */\n\tconstructor(options?: IEntityStorageIdentityResolverConnectorConstructorOptions) {\n\t\tthis._didDocumentEntityStorage = EntityStorageConnectorFactory.get(\n\t\t\toptions?.didDocumentEntityStorageType ?? \"identity-document\"\n\t\t);\n\t\tthis._vaultConnector = VaultConnectorFactory.get(options?.vaultConnectorType ?? \"vault\");\n\t}\n\n\t/**\n\t * Returns the class name of the component.\n\t * @returns The class name of the component.\n\t */\n\tpublic className(): string {\n\t\treturn EntityStorageIdentityResolverConnector.CLASS_NAME;\n\t}\n\n\t/**\n\t * Resolve a document from its id.\n\t * @param documentId The id of the document to resolve.\n\t * @returns The resolved document.\n\t * @throws NotFoundError if the id can not be resolved.\n\t */\n\tpublic async resolveDocument(documentId: string): Promise<IDidDocument> {\n\t\tGuards.stringValue(\n\t\t\tEntityStorageIdentityResolverConnector.CLASS_NAME,\n\t\t\tnameof(documentId),\n\t\t\tdocumentId\n\t\t);\n\n\t\ttry {\n\t\t\tconst didIdentityDocument = await this._didDocumentEntityStorage.get(documentId);\n\t\t\tif (Is.undefined(didIdentityDocument)) {\n\t\t\t\tthrow new NotFoundError(\n\t\t\t\t\tEntityStorageIdentityResolverConnector.CLASS_NAME,\n\t\t\t\t\t\"documentNotFound\",\n\t\t\t\t\tdocumentId\n\t\t\t\t);\n\t\t\t}\n\t\t\tawait EntityStorageIdentityConnector.verifyDocument(\n\t\t\t\tdidIdentityDocument,\n\t\t\t\tthis._vaultConnector\n\t\t\t);\n\n\t\t\treturn didIdentityDocument.document;\n\t\t} catch (error) {\n\t\t\tthrow new GeneralError(\n\t\t\t\tEntityStorageIdentityResolverConnector.CLASS_NAME,\n\t\t\t\t\"resolveDocumentFailed\",\n\t\t\t\t{ documentId },\n\t\t\t\terror\n\t\t\t);\n\t\t}\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"IEntityStorageIdentityConnectorConstructorOptions.js","sourceRoot":"","sources":["../../../src/models/IEntityStorageIdentityConnectorConstructorOptions.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IEntityStorageIdentityResolverConnectorConstructorOptions } from \"./IEntityStorageIdentityResolverConnectorConstructorOptions.js\";\n\n/**\n * Options for the entity storage identity connector constructor.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface IEntityStorageIdentityConnectorConstructorOptions\n\textends IEntityStorageIdentityResolverConnectorConstructorOptions {}\n"]}
1
+ {"version":3,"file":"IEntityStorageIdentityConnectorConstructorOptions.js","sourceRoot":"","sources":["../../../src/models/IEntityStorageIdentityConnectorConstructorOptions.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IEntityStorageIdentityResolverConnectorConstructorOptions } from \"./IEntityStorageIdentityResolverConnectorConstructorOptions.js\";\n\n/**\n * Options for the entity storage identity connector constructor.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-interface, max-len\nexport interface IEntityStorageIdentityConnectorConstructorOptions extends IEntityStorageIdentityResolverConnectorConstructorOptions {}\n"]}
@@ -1,6 +1,6 @@
1
1
  import { type IJsonLdContextDefinitionRoot, type IJsonLdNodeObject } from "@twin.org/data-json-ld";
2
2
  import { type IIdentityConnector } from "@twin.org/identity-models";
3
- import { DidVerificationMethodType, ProofTypes, type IDidDocument, type IDidDocumentVerificationMethod, type IDidService, type IDidVerifiableCredentialV1, type IDidVerifiablePresentationV1, type IProof } from "@twin.org/standards-w3c-did";
3
+ import { DidVerificationMethodType, type IDidVerifiableCredential, ProofTypes, type IDidDocument, type IDidDocumentVerificationMethod, type IDidService, type IDidVerifiableCredentialV1, type IDidVerifiablePresentationV1, type IProof, type IDidVerifiablePresentation } from "@twin.org/standards-w3c-did";
4
4
  import type { IEntityStorageIdentityConnectorConstructorOptions } from "./models/IEntityStorageIdentityConnectorConstructorOptions.js";
5
5
  /**
6
6
  * Class for performing identity operations using entity storage.
@@ -34,7 +34,7 @@ export declare class EntityStorageIdentityConnector implements IIdentityConnecto
34
34
  * Remove a document.
35
35
  * @param controller The controller of the identity who can make changes.
36
36
  * @param documentId The id of the document to remove.
37
- * @returns Nothing.
37
+ * @returns A promise that resolves when the document has been removed.
38
38
  */
39
39
  removeDocument(controller: string, documentId: string): Promise<void>;
40
40
  /**
@@ -52,7 +52,7 @@ export declare class EntityStorageIdentityConnector implements IIdentityConnecto
52
52
  * Remove a verification method from the document.
53
53
  * @param controller The controller of the identity who can make changes.
54
54
  * @param verificationMethodId The id of the verification method.
55
- * @returns Nothing.
55
+ * @returns A promise that resolves when the verification method has been removed.
56
56
  * @throws NotFoundError if the id can not be resolved.
57
57
  * @throws NotSupportedError if the platform does not support multiple revocable keys.
58
58
  */
@@ -72,10 +72,32 @@ export declare class EntityStorageIdentityConnector implements IIdentityConnecto
72
72
  * Remove a service from the document.
73
73
  * @param controller The controller of the identity who can make changes.
74
74
  * @param serviceId The id of the service.
75
- * @returns Nothing.
75
+ * @returns A promise that resolves when the service has been removed.
76
76
  * @throws NotFoundError if the id can not be resolved.
77
77
  */
78
78
  removeService(controller: string, serviceId: string): Promise<void>;
79
+ /**
80
+ * Add an alias to the alsoKnownAs property on the document.
81
+ * If the alias is already present the operation is a no-op.
82
+ * @param controller The controller of the identity who can make changes.
83
+ * @param documentId The id of the document to update.
84
+ * @param alias The alias to add. Must be a Url or Urn (typically another DID).
85
+ * @returns A promise that resolves when the alias has been added.
86
+ * @throws GeneralError if the alias is not a Url or Urn.
87
+ * @throws NotFoundError if the id can not be resolved.
88
+ */
89
+ addAlsoKnownAs(controller: string, documentId: string, alias: string): Promise<void>;
90
+ /**
91
+ * Remove an alias from the alsoKnownAs property on the document.
92
+ * If the alias is not present the operation is a no-op.
93
+ * @param controller The controller of the identity who can make changes.
94
+ * @param documentId The id of the document to update.
95
+ * @param alias The alias to remove. Must be a Url or Urn.
96
+ * @returns A promise that resolves when the alias has been removed.
97
+ * @throws GeneralError if the alias is not a Url or Urn.
98
+ * @throws NotFoundError if the id can not be resolved.
99
+ */
100
+ removeAlsoKnownAs(controller: string, documentId: string, alias: string): Promise<void>;
79
101
  /**
80
102
  * Create a verifiable credential for a verification method.
81
103
  * @param controller The controller of the identity who can make changes.
@@ -85,31 +107,39 @@ export declare class EntityStorageIdentityConnector implements IIdentityConnecto
85
107
  * @param options Additional options for creating the verifiable credential.
86
108
  * @param options.revocationIndex The bitmap revocation index of the credential, if undefined will not have revocation status.
87
109
  * @param options.expirationDate The date the verifiable credential is valid until.
110
+ * @param options.jwtHeaderFields Additional fields to add to the JWT header.
111
+ * @param options.jwtPayloadFields Additional fields to add to the JWT payload.
88
112
  * @returns The created verifiable credential and its token.
89
113
  * @throws NotFoundError if the id can not be resolved.
90
114
  */
91
115
  createVerifiableCredential(controller: string, verificationMethodId: string, id: string | undefined, subject: IJsonLdNodeObject, options?: {
92
116
  revocationIndex?: number;
93
117
  expirationDate?: Date;
118
+ jwtHeaderFields?: {
119
+ [id: string]: string;
120
+ };
121
+ jwtPayloadFields?: {
122
+ [id: string]: string;
123
+ };
94
124
  }): Promise<{
95
125
  verifiableCredential: IDidVerifiableCredentialV1;
96
126
  jwt: string;
97
127
  }>;
98
128
  /**
99
129
  * Check a verifiable credential is valid.
100
- * @param credentialJwt The credential to verify.
130
+ * @param credential The credential to verify.
101
131
  * @returns The credential stored in the jwt and the revocation status.
102
132
  */
103
- checkVerifiableCredential(credentialJwt: string): Promise<{
133
+ checkVerifiableCredential(credential: string | IDidVerifiableCredential): Promise<{
104
134
  revoked: boolean;
105
- verifiableCredential?: IDidVerifiableCredentialV1;
135
+ verifiableCredential?: IDidVerifiableCredential;
106
136
  }>;
107
137
  /**
108
138
  * Revoke verifiable credential(s).
109
139
  * @param controller The controller of the identity who can make changes.
110
140
  * @param issuerDocumentId The id of the document to update the revocation list for.
111
141
  * @param credentialIndices The revocation bitmap index or indices to revoke.
112
- * @returns Nothing.
142
+ * @returns A promise that resolves when the credentials have been revoked.
113
143
  */
114
144
  revokeVerifiableCredentials(controller: string, issuerDocumentId: string, credentialIndices: number[]): Promise<void>;
115
145
  /**
@@ -117,7 +147,7 @@ export declare class EntityStorageIdentityConnector implements IIdentityConnecto
117
147
  * @param controller The controller of the identity who can make changes.
118
148
  * @param issuerDocumentId The id of the document to update the revocation list for.
119
149
  * @param credentialIndices The revocation bitmap index or indices to un revoke.
120
- * @returns Nothing.
150
+ * @returns A promise that resolves when the credentials have been unrevoked.
121
151
  */
122
152
  unrevokeVerifiableCredentials(controller: string, issuerDocumentId: string, credentialIndices: number[]): Promise<void>;
123
153
  /**
@@ -128,31 +158,46 @@ export declare class EntityStorageIdentityConnector implements IIdentityConnecto
128
158
  * @param contexts The contexts for the data stored in the verifiable credential.
129
159
  * @param types The types for the data stored in the verifiable credential.
130
160
  * @param verifiableCredentials The credentials to use for creating the presentation in jwt format.
131
- * @param expiresInMinutes The time in minutes for the presentation to expire.
161
+ * @param options Additional options for creating the verifiable presentation.
162
+ * @param options.expirationDate The date the verifiable presentation is valid until.
163
+ * @param options.jwtHeaderFields Additional fields to add to the JWT header.
164
+ * @param options.jwtPayloadFields Additional fields to add to the JWT payload.
132
165
  * @returns The created verifiable presentation and its token.
133
166
  * @throws NotFoundError if the id can not be resolved.
134
167
  */
135
- createVerifiablePresentation(controller: string, verificationMethodId: string, presentationId: string | undefined, contexts: IJsonLdContextDefinitionRoot | undefined, types: string | string[] | undefined, verifiableCredentials: (string | IDidVerifiableCredentialV1)[], expiresInMinutes?: number): Promise<{
168
+ createVerifiablePresentation(controller: string, verificationMethodId: string, presentationId: string | undefined, contexts: IJsonLdContextDefinitionRoot | undefined, types: string | string[] | undefined, verifiableCredentials: (string | IDidVerifiableCredentialV1)[], options?: {
169
+ expirationDate?: Date;
170
+ jwtHeaderFields?: {
171
+ [id: string]: string;
172
+ };
173
+ jwtPayloadFields?: {
174
+ [id: string]: string;
175
+ };
176
+ }): Promise<{
136
177
  verifiablePresentation: IDidVerifiablePresentationV1;
137
178
  jwt: string;
138
179
  }>;
139
180
  /**
140
181
  * Check a verifiable presentation is valid.
141
- * @param presentationJwt The presentation to verify.
182
+ * @param presentation The presentation to verify.
142
183
  * @returns The presentation stored in the jwt and the revocation status.
143
184
  */
144
- checkVerifiablePresentation(presentationJwt: string): Promise<{
185
+ checkVerifiablePresentation(presentation: string | IDidVerifiablePresentation): Promise<{
145
186
  revoked: boolean;
146
187
  verifiablePresentation?: IDidVerifiablePresentationV1;
147
188
  issuers?: IDidDocument[];
148
189
  }>;
149
190
  /**
150
191
  * Create a proof for arbitrary data with the specified verification method.
192
+ * This method uses async signing to ensure the private key never leaves the vault,
193
+ * with algorithm validation to ensure key type compatibility.
151
194
  * @param controller The controller of the identity who can make changes.
152
195
  * @param verificationMethodId The verification method id to use.
153
196
  * @param proofType The type of proof to create.
154
197
  * @param unsecureDocument The unsecure document to create the proof for.
155
198
  * @returns The proof.
199
+ * @throws NotFoundError if the identity or method is not found.
200
+ * @throws GeneralError if algorithm doesn't match key type or proof creation fails.
156
201
  */
157
202
  createProof(controller: string, verificationMethodId: string, proofType: ProofTypes, unsecureDocument: IJsonLdNodeObject): Promise<IProof>;
158
203
  /**
@@ -28,7 +28,7 @@ export declare class EntityStorageIdentityProfileConnector<T extends IJsonLdDocu
28
28
  * @param identity The identity of the profile to create.
29
29
  * @param publicProfile The public profile data.
30
30
  * @param privateProfile The private profile data.
31
- * @returns Nothing.
31
+ * @returns A promise that resolves when the profile has been created.
32
32
  */
33
33
  create(identity: string, publicProfile?: T, privateProfile?: U): Promise<void>;
34
34
  /**
@@ -47,13 +47,13 @@ export declare class EntityStorageIdentityProfileConnector<T extends IJsonLdDocu
47
47
  * @param identity The identity to update.
48
48
  * @param publicProfile The public profile data.
49
49
  * @param privateProfile The private profile data.
50
- * @returns Nothing.
50
+ * @returns A promise that resolves when the profile has been updated.
51
51
  */
52
52
  update(identity: string, publicProfile?: T, privateProfile?: U): Promise<void>;
53
53
  /**
54
54
  * Delete the profile for an identity.
55
55
  * @param identity The identity to delete.
56
- * @returns Nothing.
56
+ * @returns A promise that resolves when the profile has been removed.
57
57
  */
58
58
  remove(identity: string): Promise<void>;
59
59
  /**