@twin.org/identity-models 0.9.1 → 0.9.2-next.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/contextIdHandlers/didContextIdHandler.js +14 -1
- package/dist/es/contextIdHandlers/didContextIdHandler.js.map +1 -1
- package/dist/es/index.js +7 -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/IIdentityProfileComponent.js.map +1 -1
- package/dist/es/models/api/identity/IIdentityRemoveRequest.js.map +1 -1
- package/dist/es/models/api/identity/IIdentityVerificationMethodRemoveRequest.js.map +1 -1
- package/dist/es/models/api/profile/IIdentityProfileAdminGetRequest.js +4 -0
- package/dist/es/models/api/profile/IIdentityProfileAdminGetRequest.js.map +1 -0
- package/dist/es/models/api/profile/IIdentityProfileAdminListRequest.js +4 -0
- package/dist/es/models/api/profile/IIdentityProfileAdminListRequest.js.map +1 -0
- package/dist/es/models/api/profile/IIdentityProfileAdminListResponse.js +2 -0
- package/dist/es/models/api/profile/IIdentityProfileAdminListResponse.js.map +1 -0
- package/dist/es/models/api/profile/IIdentityProfileAdminRemoveRequest.js +4 -0
- package/dist/es/models/api/profile/IIdentityProfileAdminRemoveRequest.js.map +1 -0
- package/dist/es/models/api/profile/IIdentityProfileAdminUpdateRequest.js +2 -0
- package/dist/es/models/api/profile/IIdentityProfileAdminUpdateRequest.js.map +1 -0
- package/dist/es/models/identitySpanAttributes.js +21 -0
- package/dist/es/models/identitySpanAttributes.js.map +1 -0
- package/dist/es/models/identitySpanNames.js +73 -0
- package/dist/es/models/identitySpanNames.js.map +1 -0
- package/dist/types/contextIdHandlers/didContextIdHandler.d.ts +6 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/models/IIdentityComponent.d.ts +10 -2
- package/dist/types/models/IIdentityConnector.d.ts +10 -2
- package/dist/types/models/IIdentityProfileComponent.d.ts +30 -0
- package/dist/types/models/api/identity/IIdentityRemoveRequest.d.ts +9 -0
- package/dist/types/models/api/identity/IIdentityVerificationMethodRemoveRequest.d.ts +9 -0
- package/dist/types/models/api/profile/IIdentityProfileAdminGetRequest.d.ts +27 -0
- package/dist/types/models/api/profile/IIdentityProfileAdminListRequest.d.ts +34 -0
- package/dist/types/models/api/profile/IIdentityProfileAdminListResponse.d.ts +32 -0
- package/dist/types/models/api/profile/IIdentityProfileAdminRemoveRequest.d.ts +14 -0
- package/dist/types/models/api/profile/IIdentityProfileAdminUpdateRequest.d.ts +28 -0
- package/dist/types/models/identitySpanAttributes.d.ts +21 -0
- package/dist/types/models/identitySpanNames.d.ts +73 -0
- package/docs/changelog.md +167 -0
- package/docs/reference/classes/DidContextIdHandler.md +26 -0
- package/docs/reference/index.md +9 -0
- package/docs/reference/interfaces/IIdentityComponent.md +22 -2
- package/docs/reference/interfaces/IIdentityConnector.md +22 -2
- package/docs/reference/interfaces/IIdentityProfileAdminGetRequest.md +37 -0
- package/docs/reference/interfaces/IIdentityProfileAdminListRequest.md +47 -0
- package/docs/reference/interfaces/IIdentityProfileAdminListResponse.md +23 -0
- package/docs/reference/interfaces/IIdentityProfileAdminRemoveRequest.md +17 -0
- package/docs/reference/interfaces/IIdentityProfileAdminUpdateRequest.md +37 -0
- package/docs/reference/interfaces/IIdentityProfileComponent.md +52 -0
- package/docs/reference/interfaces/IIdentityRemoveRequest.md +14 -0
- package/docs/reference/interfaces/IIdentityVerificationMethodRemoveRequest.md +14 -0
- package/docs/reference/type-aliases/IdentitySpanAttributes.md +5 -0
- package/docs/reference/type-aliases/IdentitySpanNames.md +5 -0
- package/docs/reference/variables/IdentitySpanAttributes.md +25 -0
- package/docs/reference/variables/IdentitySpanNames.md +103 -0
- package/package.json +10 -9
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Converter, HexHelper } from "@twin.org/core";
|
|
1
|
+
import { Converter, Is, HexHelper } from "@twin.org/core";
|
|
2
2
|
import { Did } from "../types/did.js";
|
|
3
3
|
/**
|
|
4
4
|
* Context ID handler that treats context identifiers as DIDs.
|
|
@@ -29,6 +29,19 @@ export class DidContextIdHandler {
|
|
|
29
29
|
}
|
|
30
30
|
return parts.id;
|
|
31
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* The long form version of the context ID, expanded from a short version.
|
|
34
|
+
* @param value The short form context ID value.
|
|
35
|
+
* @returns The long form version of the context ID.
|
|
36
|
+
*/
|
|
37
|
+
long(value) {
|
|
38
|
+
if (Is.stringBase64Url(value)) {
|
|
39
|
+
const bytes = Converter.base64UrlToBytes(value);
|
|
40
|
+
const hex = Converter.bytesToHex(bytes, true);
|
|
41
|
+
return `did:internal:${hex}`;
|
|
42
|
+
}
|
|
43
|
+
return value;
|
|
44
|
+
}
|
|
32
45
|
/**
|
|
33
46
|
* Guard the value ensuring it is a valid DID.
|
|
34
47
|
* @param value The value to guard.
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"didContextIdHandler.js","sourceRoot":"","sources":["../../../src/contextIdHandlers/didContextIdHandler.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE1D,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,IAAI,CAAC,KAAa;QACxB,IAAI,EAAE,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC;YAC/B,MAAM,KAAK,GAAG,SAAS,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;YAChD,MAAM,GAAG,GAAG,SAAS,CAAC,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;YAC9C,OAAO,gBAAgB,GAAG,EAAE,CAAC;QAC9B,CAAC;QACD,OAAO,KAAK,CAAC;IACd,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, Is, HexHelper } from \"@twin.org/core\";\nimport { nameof } from \"@twin.org/nameof\";\nimport { Did } from \"../types/did.js\";\n\n/**\n * Context ID handler that treats context identifiers as DIDs.\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 * The long form version of the context ID, expanded from a short version.\n\t * @param value The short form context ID value.\n\t * @returns The long form version of the context ID.\n\t */\n\tpublic long(value: string): string {\n\t\tif (Is.stringBase64Url(value)) {\n\t\t\tconst bytes = Converter.base64UrlToBytes(value);\n\t\t\tconst hex = Converter.bytesToHex(bytes, true);\n\t\t\treturn `did:internal:${hex}`;\n\t\t}\n\t\treturn value;\n\t}\n\n\t/**\n\t * Guard the value ensuring it is a valid DID.\n\t * @param value The value to guard.\n\t * @throws GeneralError if the value is not a valid DID.\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
|
@@ -31,6 +31,11 @@ export * from "./models/api/identity/IIdentityVerifiablePresentationVerifyRespon
|
|
|
31
31
|
export * from "./models/api/identity/IIdentityVerificationMethodCreateRequest.js";
|
|
32
32
|
export * from "./models/api/identity/IIdentityVerificationMethodCreateResponse.js";
|
|
33
33
|
export * from "./models/api/identity/IIdentityVerificationMethodRemoveRequest.js";
|
|
34
|
+
export * from "./models/api/profile/IIdentityProfileAdminGetRequest.js";
|
|
35
|
+
export * from "./models/api/profile/IIdentityProfileAdminListRequest.js";
|
|
36
|
+
export * from "./models/api/profile/IIdentityProfileAdminListResponse.js";
|
|
37
|
+
export * from "./models/api/profile/IIdentityProfileAdminRemoveRequest.js";
|
|
38
|
+
export * from "./models/api/profile/IIdentityProfileAdminUpdateRequest.js";
|
|
34
39
|
export * from "./models/api/profile/IIdentityProfileCreateRequest.js";
|
|
35
40
|
export * from "./models/api/profile/IIdentityProfileGetPublicRequest.js";
|
|
36
41
|
export * from "./models/api/profile/IIdentityProfileGetPublicResponse.js";
|
|
@@ -49,6 +54,8 @@ export * from "./models/IIdentityResolverComponent.js";
|
|
|
49
54
|
export * from "./models/IIdentityResolverConnector.js";
|
|
50
55
|
export * from "./models/identityMetricIds.js";
|
|
51
56
|
export * from "./models/identityMetrics.js";
|
|
57
|
+
export * from "./models/identitySpanAttributes.js";
|
|
58
|
+
export * from "./models/identitySpanNames.js";
|
|
52
59
|
export * from "./types/did.js";
|
|
53
60
|
export * from "./utils/documentHelper.js";
|
|
54
61
|
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,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
|
+
{"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,yDAAyD,CAAC;AACxE,cAAc,0DAA0D,CAAC;AACzE,cAAc,2DAA2D,CAAC;AAC1E,cAAc,4DAA4D,CAAC;AAC3E,cAAc,4DAA4D,CAAC;AAC3E,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,oCAAoC,CAAC;AACnD,cAAc,+BAA+B,CAAC;AAC9C,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/IIdentityProfileAdminGetRequest.js\";\nexport * from \"./models/api/profile/IIdentityProfileAdminListRequest.js\";\nexport * from \"./models/api/profile/IIdentityProfileAdminListResponse.js\";\nexport * from \"./models/api/profile/IIdentityProfileAdminRemoveRequest.js\";\nexport * from \"./models/api/profile/IIdentityProfileAdminUpdateRequest.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 \"./models/identitySpanAttributes.js\";\nexport * from \"./models/identitySpanNames.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 A promise that resolves when the identity has been removed.\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 A promise that resolves when the verification method has been removed.\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 A promise that resolves when the service has been removed.\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 A promise that resolves when the alias has been added.\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 A promise that resolves when the alias has been removed.\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 to revoke.\n\t * @param controller The controller of the identity who can make changes.\n\t * @returns A promise that resolves when the credential has been revoked.\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 unrevoke.\n\t * @param controller The controller of the identity who can make changes.\n\t * @returns A promise that resolves when the credential has been unrevoked.\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
|
+
{"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 options Optional settings.\n\t * @param options.removeKeys Also remove any associated private keys from the vault.\n\t * @param controller The controller of the identity who can make changes.\n\t * @returns A promise that resolves when the identity has been removed.\n\t */\n\tidentityRemove(\n\t\tidentity: string,\n\t\toptions?: { removeKeys?: boolean },\n\t\tcontroller?: string\n\t): 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 options Optional settings.\n\t * @param options.removeKeys Also remove any associated private key from the vault.\n\t * @param controller The controller of the identity who can make changes.\n\t * @returns A promise that resolves when the verification method has been removed.\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(\n\t\tverificationMethodId: string,\n\t\toptions?: { removeKeys?: boolean },\n\t\tcontroller?: string\n\t): 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 A promise that resolves when the service has been removed.\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 A promise that resolves when the alias has been added.\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 A promise that resolves when the alias has been removed.\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 to revoke.\n\t * @param controller The controller of the identity who can make changes.\n\t * @returns A promise that resolves when the credential has been revoked.\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 unrevoke.\n\t * @param controller The controller of the identity who can make changes.\n\t * @returns A promise that resolves when the credential has been unrevoked.\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 A promise that resolves when the document has been removed.\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 A promise that resolves when the verification method has been removed.\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 A promise that resolves when the service has been removed.\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 A promise that resolves when the alias has been added.\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 A promise that resolves when the alias has been removed.\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 A promise that resolves when the credentials have been revoked.\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 unrevoke.\n\t * @returns A promise that resolves when the credentials have been unrevoked.\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"]}
|
|
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 * @param options Optional settings.\n\t * @param options.removeKeys Also remove any associated private keys from the vault.\n\t * @returns A promise that resolves when the document has been removed.\n\t */\n\tremoveDocument(\n\t\tcontroller: string,\n\t\tdocumentId: string,\n\t\toptions?: { removeKeys?: boolean }\n\t): 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 * @param options Optional settings.\n\t * @param options.removeKeys Also remove any associated private key from the vault.\n\t * @returns A promise that resolves when the verification method has been removed.\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(\n\t\tcontroller: string,\n\t\tverificationMethodId: string,\n\t\toptions?: { removeKeys?: boolean }\n\t): 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 A promise that resolves when the service has been removed.\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 A promise that resolves when the alias has been added.\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 A promise that resolves when the alias has been removed.\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 A promise that resolves when the credentials have been revoked.\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 unrevoke.\n\t * @returns A promise that resolves when the credentials have been unrevoked.\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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IIdentityProfileComponent.js","sourceRoot":"","sources":["../../../src/models/IIdentityProfileComponent.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@twin.org/core\";\nimport type { IJsonLdDocument } from \"@twin.org/data-json-ld\";\n\n/**\n * Interface describing a contract which provides profile operations.\n */\nexport interface IIdentityProfileComponent<\n\tT extends IJsonLdDocument = IJsonLdDocument,\n\tU extends IJsonLdDocument = IJsonLdDocument\n> extends IComponent {\n\t/**\n\t * Create the profile properties for an identity.\n\t * @param publicProfile The public profile data as JSON-LD.\n\t * @param privateProfile The private profile data as JSON-LD.\n\t * @param identity The identity to perform the profile operation on.\n\t * @returns A promise that resolves when the profile has been created.\n\t */\n\tcreate(publicProfile?: T, privateProfile?: U, identity?: string): Promise<void>;\n\n\t/**\n\t * Get the profile properties for an identity.\n\t * @param publicPropertyNames The public properties to get for the profile, defaults to all.\n\t * @param privatePropertyNames The private properties to get for the profile, defaults to all.\n\t * @param identity The identity to perform the profile operation on.\n\t * @returns The items identity and the properties.\n\t */\n\tget(\n\t\tpublicPropertyNames?: (keyof T)[],\n\t\tprivatePropertyNames?: (keyof U)[],\n\t\tidentity?: string\n\t): Promise<{\n\t\tidentity: string;\n\t\tpublicProfile?: Partial<T>;\n\t\tprivateProfile?: Partial<U>;\n\t}>;\n\n\t/**\n\t * Get the public profile properties for an identity.\n\t * @param identity The identity to perform the profile operation on.\n\t * @param propertyNames The public properties to get for the profile, defaults to all.\n\t * @returns The items properties.\n\t */\n\tgetPublic(identity: string, propertyNames?: (keyof T)[]): Promise<Partial<T>>;\n\n\t/**\n\t * Update the profile properties of an identity.\n\t * @param publicProfile The public profile data as JSON-LD.\n\t * @param privateProfile The private profile data as JSON-LD.\n\t * @param identity The identity to perform the profile operation on.\n\t * @returns A promise that resolves when the profile has been updated.\n\t */\n\tupdate(publicProfile?: T, privateProfile?: U, identity?: string): Promise<void>;\n\n\t/**\n\t * Delete the profile for an identity.\n\t * @param identity The identity to perform the profile operation on.\n\t * @returns A promise that resolves when the profile has been removed.\n\t */\n\tremove(identity?: string): Promise<void>;\n\n\t/**\n\t * Get a list of the requested identities.\n\t * @param publicFilters The filters to apply to the identities public profiles.\n\t * @param publicPropertyNames The public properties to get for the profile, defaults to all.\n\t * @param cursor The cursor for paged requests.\n\t * @param limit The maximum number of items in a page.\n\t * @returns The list of items and cursor for paging.\n\t */\n\tlist(\n\t\tpublicFilters?: {\n\t\t\tpropertyName: string;\n\t\t\tpropertyValue: unknown;\n\t\t}[],\n\t\tpublicPropertyNames?: (keyof T)[],\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{\n\t\t/**\n\t\t * The identities.\n\t\t */\n\t\titems: {\n\t\t\tidentity: string;\n\t\t\tpublicProfile?: Partial<T>;\n\t\t}[];\n\t\t/**\n\t\t * An optional cursor, when defined can be used to call find to get more entities.\n\t\t */\n\t\tcursor?: string;\n\t}>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"IIdentityProfileComponent.js","sourceRoot":"","sources":["../../../src/models/IIdentityProfileComponent.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@twin.org/core\";\nimport type { IJsonLdDocument } from \"@twin.org/data-json-ld\";\n\n/**\n * Interface describing a contract which provides profile operations.\n */\nexport interface IIdentityProfileComponent<\n\tT extends IJsonLdDocument = IJsonLdDocument,\n\tU extends IJsonLdDocument = IJsonLdDocument\n> extends IComponent {\n\t/**\n\t * Create the profile properties for an identity.\n\t * @param publicProfile The public profile data as JSON-LD.\n\t * @param privateProfile The private profile data as JSON-LD.\n\t * @param identity The identity to perform the profile operation on.\n\t * @returns A promise that resolves when the profile has been created.\n\t */\n\tcreate(publicProfile?: T, privateProfile?: U, identity?: string): Promise<void>;\n\n\t/**\n\t * Get the profile properties for an identity.\n\t * @param publicPropertyNames The public properties to get for the profile, defaults to all.\n\t * @param privatePropertyNames The private properties to get for the profile, defaults to all.\n\t * @param identity The identity to perform the profile operation on.\n\t * @returns The items identity and the properties.\n\t */\n\tget(\n\t\tpublicPropertyNames?: (keyof T)[],\n\t\tprivatePropertyNames?: (keyof U)[],\n\t\tidentity?: string\n\t): Promise<{\n\t\tidentity: string;\n\t\tpublicProfile?: Partial<T>;\n\t\tprivateProfile?: Partial<U>;\n\t}>;\n\n\t/**\n\t * Get the public profile properties for an identity.\n\t * @param identity The identity to perform the profile operation on.\n\t * @param propertyNames The public properties to get for the profile, defaults to all.\n\t * @returns The items properties.\n\t */\n\tgetPublic(identity: string, propertyNames?: (keyof T)[]): Promise<Partial<T>>;\n\n\t/**\n\t * Update the profile properties of an identity.\n\t * @param publicProfile The public profile data as JSON-LD.\n\t * @param privateProfile The private profile data as JSON-LD.\n\t * @param identity The identity to perform the profile operation on.\n\t * @returns A promise that resolves when the profile has been updated.\n\t */\n\tupdate(publicProfile?: T, privateProfile?: U, identity?: string): Promise<void>;\n\n\t/**\n\t * Delete the profile for an identity.\n\t * @param identity The identity to perform the profile operation on.\n\t * @returns A promise that resolves when the profile has been removed.\n\t */\n\tremove(identity?: string): Promise<void>;\n\n\t/**\n\t * Get a list of the requested identities.\n\t * @param publicFilters The filters to apply to the identities public profiles.\n\t * @param publicPropertyNames The public properties to get for the profile, defaults to all.\n\t * @param cursor The cursor for paged requests.\n\t * @param limit The maximum number of items in a page.\n\t * @returns The list of items and cursor for paging.\n\t */\n\tlist(\n\t\tpublicFilters?: {\n\t\t\tpropertyName: string;\n\t\t\tpropertyValue: unknown;\n\t\t}[],\n\t\tpublicPropertyNames?: (keyof T)[],\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{\n\t\t/**\n\t\t * The identities.\n\t\t */\n\t\titems: {\n\t\t\tidentity: string;\n\t\t\tpublicProfile?: Partial<T>;\n\t\t}[];\n\t\t/**\n\t\t * An optional cursor, when defined can be used to call find to get more entities.\n\t\t */\n\t\tcursor?: string;\n\t}>;\n\n\t/**\n\t * Get a list of identities including private profile data.\n\t * @param publicFilters The filters to apply to the identities public profiles.\n\t * @param privateFilters The filters to apply to the identities private profiles.\n\t * @param publicPropertyNames The public properties to get for the profile, defaults to all.\n\t * @param privatePropertyNames The private properties to get for the profile, defaults to none.\n\t * @param cursor The cursor for paged requests.\n\t * @param limit The maximum number of items in a page.\n\t * @returns The list of items and cursor for paging.\n\t */\n\tlistAdmin(\n\t\tpublicFilters?: {\n\t\t\tpropertyName: string;\n\t\t\tpropertyValue: unknown;\n\t\t}[],\n\t\tprivateFilters?: {\n\t\t\tpropertyName: string;\n\t\t\tpropertyValue: unknown;\n\t\t}[],\n\t\tpublicPropertyNames?: (keyof T)[],\n\t\tprivatePropertyNames?: (keyof U)[],\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{\n\t\t/**\n\t\t * The identities.\n\t\t */\n\t\titems: {\n\t\t\tidentity: string;\n\t\t\tpublicProfile?: Partial<T>;\n\t\t\tprivateProfile?: Partial<U>;\n\t\t}[];\n\t\t/**\n\t\t * An optional cursor, when defined can be used to call find to get more entities.\n\t\t */\n\t\tcursor?: string;\n\t}>;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IIdentityRemoveRequest.js","sourceRoot":"","sources":["../../../../../src/models/api/identity/IIdentityRemoveRequest.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 identity.\n */\nexport interface IIdentityRemoveRequest {\n\t/**\n\t * The data for the request.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The identity to remove.\n\t\t */\n\t\tidentity: string;\n\t};\n}\n"]}
|
|
1
|
+
{"version":3,"file":"IIdentityRemoveRequest.js","sourceRoot":"","sources":["../../../../../src/models/api/identity/IIdentityRemoveRequest.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 identity.\n */\nexport interface IIdentityRemoveRequest {\n\t/**\n\t * The data for the request.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The identity to remove.\n\t\t */\n\t\tidentity: string;\n\t};\n\n\t/**\n\t * The query parameters.\n\t */\n\tquery?: {\n\t\t/**\n\t\t * Also remove any associated private keys from the vault.\n\t\t */\n\t\tremoveKeys?: string;\n\t};\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IIdentityVerificationMethodRemoveRequest.js","sourceRoot":"","sources":["../../../../../src/models/api/identity/IIdentityVerificationMethodRemoveRequest.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 a verification method.\n */\nexport interface IIdentityVerificationMethodRemoveRequest {\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The identity to remove the verification method from.\n\t\t */\n\t\tidentity: string;\n\n\t\t/**\n\t\t * The verification method to remove.\n\t\t */\n\t\tverificationMethodId: string;\n\t};\n}\n"]}
|
|
1
|
+
{"version":3,"file":"IIdentityVerificationMethodRemoveRequest.js","sourceRoot":"","sources":["../../../../../src/models/api/identity/IIdentityVerificationMethodRemoveRequest.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 a verification method.\n */\nexport interface IIdentityVerificationMethodRemoveRequest {\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The identity to remove the verification method from.\n\t\t */\n\t\tidentity: string;\n\n\t\t/**\n\t\t * The verification method to remove.\n\t\t */\n\t\tverificationMethodId: string;\n\t};\n\n\t/**\n\t * The query parameters.\n\t */\n\tquery?: {\n\t\t/**\n\t\t * Also remove any associated private key from the vault.\n\t\t */\n\t\tremoveKeys?: string;\n\t};\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IIdentityProfileAdminGetRequest.js","sourceRoot":"","sources":["../../../../../src/models/api/profile/IIdentityProfileAdminGetRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Request to get the profile of another user as an admin.\n */\nexport interface IIdentityProfileAdminGetRequest {\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The identity of the user whose profile is to be retrieved.\n\t\t */\n\t\tuserIdentity: string;\n\t};\n\n\t/**\n\t * The query parameters.\n\t */\n\tquery?: {\n\t\t/**\n\t\t * The public properties to get for the profile, defaults to all, should be a comma separated list.\n\t\t */\n\t\tpublicPropertyNames?: string;\n\n\t\t/**\n\t\t * The private properties to get for the profile, defaults to all, should be a comma separated list.\n\t\t */\n\t\tprivatePropertyNames?: string;\n\t};\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IIdentityProfileAdminListRequest.js","sourceRoot":"","sources":["../../../../../src/models/api/profile/IIdentityProfileAdminListRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Request to get a list of identities with public and private profile data as an admin.\n */\nexport interface IIdentityProfileAdminListRequest {\n\t/**\n\t * The query parameters.\n\t */\n\tquery?: {\n\t\t/**\n\t\t * The public filters to apply to the list, comma separated list with colon between key and value for each pair e.g. prop1:value1,prop2:value2.\n\t\t */\n\t\tpublicFilters?: string;\n\n\t\t/**\n\t\t * The private filters to apply to the list, comma separated list with colon between key and value for each pair e.g. prop1:value1,prop2:value2.\n\t\t */\n\t\tprivateFilters?: string;\n\n\t\t/**\n\t\t * The public properties to get for the profile, defaults to all, should be a comma separated list.\n\t\t */\n\t\tpublicPropertyNames?: string;\n\n\t\t/**\n\t\t * The private properties to get for the profile, defaults to none, should be a comma separated list.\n\t\t */\n\t\tprivatePropertyNames?: string;\n\n\t\t/**\n\t\t * The cursor for paged requests.\n\t\t */\n\t\tcursor?: string;\n\n\t\t/**\n\t\t * Number of items to return.\n\t\t */\n\t\tlimit?: string;\n\t};\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IIdentityProfileAdminListResponse.js","sourceRoot":"","sources":["../../../../../src/models/api/profile/IIdentityProfileAdminListResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IJsonLdDocument } from \"@twin.org/data-json-ld\";\n\n/**\n * Response to get an admin list of identities including private profile data.\n */\nexport interface IIdentityProfileAdminListResponse {\n\t/**\n\t * The response payload.\n\t */\n\tbody: {\n\t\t/**\n\t\t * The identities.\n\t\t */\n\t\titems: {\n\t\t\t/**\n\t\t\t * The identity.\n\t\t\t */\n\t\t\tidentity: string;\n\n\t\t\t/**\n\t\t\t * The public profile data.\n\t\t\t */\n\t\t\tpublicProfile?: Partial<IJsonLdDocument>;\n\n\t\t\t/**\n\t\t\t * The private profile data.\n\t\t\t */\n\t\t\tprivateProfile?: Partial<IJsonLdDocument>;\n\t\t}[];\n\n\t\t/**\n\t\t * An optional cursor, when defined can be used to call find to get more entities.\n\t\t */\n\t\tcursor?: string;\n\t};\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IIdentityProfileAdminRemoveRequest.js","sourceRoot":"","sources":["../../../../../src/models/api/profile/IIdentityProfileAdminRemoveRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Request to remove the profile of another user as an admin.\n */\nexport interface IIdentityProfileAdminRemoveRequest {\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The identity of the user whose profile is to be removed.\n\t\t */\n\t\tuserIdentity: string;\n\t};\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IIdentityProfileAdminUpdateRequest.js","sourceRoot":"","sources":["../../../../../src/models/api/profile/IIdentityProfileAdminUpdateRequest.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IJsonLdDocument } from \"@twin.org/data-json-ld\";\n\n/**\n * Request to update the profile of another user as an admin.\n */\nexport interface IIdentityProfileAdminUpdateRequest {\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The identity of the user whose profile is to be updated.\n\t\t */\n\t\tuserIdentity: string;\n\t};\n\n\t/**\n\t * The data for the request.\n\t */\n\tbody: {\n\t\t/**\n\t\t * The public profile data.\n\t\t */\n\t\tpublicProfile?: IJsonLdDocument;\n\n\t\t/**\n\t\t * The private profile data.\n\t\t */\n\t\tprivateProfile?: IJsonLdDocument;\n\t};\n}\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Copyright 2026 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
/**
|
|
4
|
+
* The span attribute keys for the identity domain.
|
|
5
|
+
*/
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
7
|
+
export const IdentitySpanAttributes = {
|
|
8
|
+
/**
|
|
9
|
+
* The id of the identity document the operation is for.
|
|
10
|
+
*/
|
|
11
|
+
Id: "identity.id",
|
|
12
|
+
/**
|
|
13
|
+
* The id of the verification method the operation is for.
|
|
14
|
+
*/
|
|
15
|
+
VerificationMethodId: "identity.verification-method-id",
|
|
16
|
+
/**
|
|
17
|
+
* The id of the service the operation is for.
|
|
18
|
+
*/
|
|
19
|
+
ServiceId: "identity.service-id"
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=identitySpanAttributes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identitySpanAttributes.js","sourceRoot":"","sources":["../../../src/models/identitySpanAttributes.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACrC;;OAEG;IACH,EAAE,EAAE,aAAa;IAEjB;;OAEG;IACH,oBAAoB,EAAE,iCAAiC;IAEvD;;OAEG;IACH,SAAS,EAAE,qBAAqB;CACvB,CAAC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The span attribute keys for the identity domain.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const IdentitySpanAttributes = {\n\t/**\n\t * The id of the identity document the operation is for.\n\t */\n\tId: \"identity.id\",\n\n\t/**\n\t * The id of the verification method the operation is for.\n\t */\n\tVerificationMethodId: \"identity.verification-method-id\",\n\n\t/**\n\t * The id of the service the operation is for.\n\t */\n\tServiceId: \"identity.service-id\"\n} as const;\n\n/**\n * Union type of all identity span attribute key string values.\n */\nexport type IdentitySpanAttributes =\n\t(typeof IdentitySpanAttributes)[keyof typeof IdentitySpanAttributes];\n"]}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// Copyright 2026 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
/**
|
|
4
|
+
* The span names for the identity domain.
|
|
5
|
+
*/
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
7
|
+
export const IdentitySpanNames = {
|
|
8
|
+
/**
|
|
9
|
+
* Create an identity.
|
|
10
|
+
*/
|
|
11
|
+
Create: "identity/create",
|
|
12
|
+
/**
|
|
13
|
+
* Remove an identity.
|
|
14
|
+
*/
|
|
15
|
+
Remove: "identity/remove",
|
|
16
|
+
/**
|
|
17
|
+
* Create a verification method.
|
|
18
|
+
*/
|
|
19
|
+
VerificationMethodCreate: "identity/verification-method-create",
|
|
20
|
+
/**
|
|
21
|
+
* Remove a verification method.
|
|
22
|
+
*/
|
|
23
|
+
VerificationMethodRemove: "identity/verification-method-remove",
|
|
24
|
+
/**
|
|
25
|
+
* Create a service.
|
|
26
|
+
*/
|
|
27
|
+
ServiceCreate: "identity/service-create",
|
|
28
|
+
/**
|
|
29
|
+
* Remove a service.
|
|
30
|
+
*/
|
|
31
|
+
ServiceRemove: "identity/service-remove",
|
|
32
|
+
/**
|
|
33
|
+
* Add an also known as alias.
|
|
34
|
+
*/
|
|
35
|
+
AlsoKnownAsAdd: "identity/also-known-as-add",
|
|
36
|
+
/**
|
|
37
|
+
* Remove an also known as alias.
|
|
38
|
+
*/
|
|
39
|
+
AlsoKnownAsRemove: "identity/also-known-as-remove",
|
|
40
|
+
/**
|
|
41
|
+
* Create a verifiable credential.
|
|
42
|
+
*/
|
|
43
|
+
VerifiableCredentialCreate: "identity/verifiable-credential-create",
|
|
44
|
+
/**
|
|
45
|
+
* Verify a verifiable credential.
|
|
46
|
+
*/
|
|
47
|
+
VerifiableCredentialVerify: "identity/verifiable-credential-verify",
|
|
48
|
+
/**
|
|
49
|
+
* Revoke a verifiable credential.
|
|
50
|
+
*/
|
|
51
|
+
VerifiableCredentialRevoke: "identity/verifiable-credential-revoke",
|
|
52
|
+
/**
|
|
53
|
+
* Unrevoke a verifiable credential.
|
|
54
|
+
*/
|
|
55
|
+
VerifiableCredentialUnrevoke: "identity/verifiable-credential-unrevoke",
|
|
56
|
+
/**
|
|
57
|
+
* Create a verifiable presentation.
|
|
58
|
+
*/
|
|
59
|
+
VerifiablePresentationCreate: "identity/verifiable-presentation-create",
|
|
60
|
+
/**
|
|
61
|
+
* Verify a verifiable presentation.
|
|
62
|
+
*/
|
|
63
|
+
VerifiablePresentationVerify: "identity/verifiable-presentation-verify",
|
|
64
|
+
/**
|
|
65
|
+
* Create a proof.
|
|
66
|
+
*/
|
|
67
|
+
ProofCreate: "identity/proof-create",
|
|
68
|
+
/**
|
|
69
|
+
* Verify a proof.
|
|
70
|
+
*/
|
|
71
|
+
ProofVerify: "identity/proof-verify"
|
|
72
|
+
};
|
|
73
|
+
//# sourceMappingURL=identitySpanNames.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identitySpanNames.js","sourceRoot":"","sources":["../../../src/models/identitySpanNames.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAChC;;OAEG;IACH,MAAM,EAAE,iBAAiB;IAEzB;;OAEG;IACH,MAAM,EAAE,iBAAiB;IAEzB;;OAEG;IACH,wBAAwB,EAAE,qCAAqC;IAE/D;;OAEG;IACH,wBAAwB,EAAE,qCAAqC;IAE/D;;OAEG;IACH,aAAa,EAAE,yBAAyB;IAExC;;OAEG;IACH,aAAa,EAAE,yBAAyB;IAExC;;OAEG;IACH,cAAc,EAAE,4BAA4B;IAE5C;;OAEG;IACH,iBAAiB,EAAE,+BAA+B;IAElD;;OAEG;IACH,0BAA0B,EAAE,uCAAuC;IAEnE;;OAEG;IACH,0BAA0B,EAAE,uCAAuC;IAEnE;;OAEG;IACH,0BAA0B,EAAE,uCAAuC;IAEnE;;OAEG;IACH,4BAA4B,EAAE,yCAAyC;IAEvE;;OAEG;IACH,4BAA4B,EAAE,yCAAyC;IAEvE;;OAEG;IACH,4BAA4B,EAAE,yCAAyC;IAEvE;;OAEG;IACH,WAAW,EAAE,uBAAuB;IAEpC;;OAEG;IACH,WAAW,EAAE,uBAAuB;CAC3B,CAAC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The span names for the identity domain.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const IdentitySpanNames = {\n\t/**\n\t * Create an identity.\n\t */\n\tCreate: \"identity/create\",\n\n\t/**\n\t * Remove an identity.\n\t */\n\tRemove: \"identity/remove\",\n\n\t/**\n\t * Create a verification method.\n\t */\n\tVerificationMethodCreate: \"identity/verification-method-create\",\n\n\t/**\n\t * Remove a verification method.\n\t */\n\tVerificationMethodRemove: \"identity/verification-method-remove\",\n\n\t/**\n\t * Create a service.\n\t */\n\tServiceCreate: \"identity/service-create\",\n\n\t/**\n\t * Remove a service.\n\t */\n\tServiceRemove: \"identity/service-remove\",\n\n\t/**\n\t * Add an also known as alias.\n\t */\n\tAlsoKnownAsAdd: \"identity/also-known-as-add\",\n\n\t/**\n\t * Remove an also known as alias.\n\t */\n\tAlsoKnownAsRemove: \"identity/also-known-as-remove\",\n\n\t/**\n\t * Create a verifiable credential.\n\t */\n\tVerifiableCredentialCreate: \"identity/verifiable-credential-create\",\n\n\t/**\n\t * Verify a verifiable credential.\n\t */\n\tVerifiableCredentialVerify: \"identity/verifiable-credential-verify\",\n\n\t/**\n\t * Revoke a verifiable credential.\n\t */\n\tVerifiableCredentialRevoke: \"identity/verifiable-credential-revoke\",\n\n\t/**\n\t * Unrevoke a verifiable credential.\n\t */\n\tVerifiableCredentialUnrevoke: \"identity/verifiable-credential-unrevoke\",\n\n\t/**\n\t * Create a verifiable presentation.\n\t */\n\tVerifiablePresentationCreate: \"identity/verifiable-presentation-create\",\n\n\t/**\n\t * Verify a verifiable presentation.\n\t */\n\tVerifiablePresentationVerify: \"identity/verifiable-presentation-verify\",\n\n\t/**\n\t * Create a proof.\n\t */\n\tProofCreate: \"identity/proof-create\",\n\n\t/**\n\t * Verify a proof.\n\t */\n\tProofVerify: \"identity/proof-verify\"\n} as const;\n\n/**\n * Union type of all identity span name string values.\n */\nexport type IdentitySpanNames = (typeof IdentitySpanNames)[keyof typeof IdentitySpanNames];\n"]}
|
|
@@ -18,6 +18,12 @@ export declare class DidContextIdHandler implements IContextIdHandler {
|
|
|
18
18
|
* @returns Short form string.
|
|
19
19
|
*/
|
|
20
20
|
short(value: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* The long form version of the context ID, expanded from a short version.
|
|
23
|
+
* @param value The short form context ID value.
|
|
24
|
+
* @returns The long form version of the context ID.
|
|
25
|
+
*/
|
|
26
|
+
long(value: string): string;
|
|
21
27
|
/**
|
|
22
28
|
* Guard the value ensuring it is a valid DID.
|
|
23
29
|
* @param value The value to guard.
|
package/dist/types/index.d.ts
CHANGED
|
@@ -29,6 +29,11 @@ export * from "./models/api/identity/IIdentityVerifiablePresentationVerifyRespon
|
|
|
29
29
|
export * from "./models/api/identity/IIdentityVerificationMethodCreateRequest.js";
|
|
30
30
|
export * from "./models/api/identity/IIdentityVerificationMethodCreateResponse.js";
|
|
31
31
|
export * from "./models/api/identity/IIdentityVerificationMethodRemoveRequest.js";
|
|
32
|
+
export * from "./models/api/profile/IIdentityProfileAdminGetRequest.js";
|
|
33
|
+
export * from "./models/api/profile/IIdentityProfileAdminListRequest.js";
|
|
34
|
+
export * from "./models/api/profile/IIdentityProfileAdminListResponse.js";
|
|
35
|
+
export * from "./models/api/profile/IIdentityProfileAdminRemoveRequest.js";
|
|
36
|
+
export * from "./models/api/profile/IIdentityProfileAdminUpdateRequest.js";
|
|
32
37
|
export * from "./models/api/profile/IIdentityProfileCreateRequest.js";
|
|
33
38
|
export * from "./models/api/profile/IIdentityProfileGetPublicRequest.js";
|
|
34
39
|
export * from "./models/api/profile/IIdentityProfileGetPublicResponse.js";
|
|
@@ -47,6 +52,8 @@ export * from "./models/IIdentityResolverComponent.js";
|
|
|
47
52
|
export * from "./models/IIdentityResolverConnector.js";
|
|
48
53
|
export * from "./models/identityMetricIds.js";
|
|
49
54
|
export * from "./models/identityMetrics.js";
|
|
55
|
+
export * from "./models/identitySpanAttributes.js";
|
|
56
|
+
export * from "./models/identitySpanNames.js";
|
|
50
57
|
export * from "./types/did.js";
|
|
51
58
|
export * from "./utils/documentHelper.js";
|
|
52
59
|
export * from "./utils/verificationHelper.js";
|
|
@@ -15,10 +15,14 @@ export interface IIdentityComponent extends IComponent {
|
|
|
15
15
|
/**
|
|
16
16
|
* Remove an identity.
|
|
17
17
|
* @param identity The id of the document to remove.
|
|
18
|
+
* @param options Optional settings.
|
|
19
|
+
* @param options.removeKeys Also remove any associated private keys from the vault.
|
|
18
20
|
* @param controller The controller of the identity who can make changes.
|
|
19
21
|
* @returns A promise that resolves when the identity has been removed.
|
|
20
22
|
*/
|
|
21
|
-
identityRemove(identity: string,
|
|
23
|
+
identityRemove(identity: string, options?: {
|
|
24
|
+
removeKeys?: boolean;
|
|
25
|
+
}, controller?: string): Promise<void>;
|
|
22
26
|
/**
|
|
23
27
|
* Add a verification method to the document in JSON Web key Format.
|
|
24
28
|
* @param identity The id of the document to add the verification method to.
|
|
@@ -33,12 +37,16 @@ export interface IIdentityComponent extends IComponent {
|
|
|
33
37
|
/**
|
|
34
38
|
* Remove a verification method from the document.
|
|
35
39
|
* @param verificationMethodId The id of the verification method.
|
|
40
|
+
* @param options Optional settings.
|
|
41
|
+
* @param options.removeKeys Also remove any associated private key from the vault.
|
|
36
42
|
* @param controller The controller of the identity who can make changes.
|
|
37
43
|
* @returns A promise that resolves when the verification method has been removed.
|
|
38
44
|
* @throws NotFoundError if the id can not be resolved.
|
|
39
45
|
* @throws NotSupportedError if the platform does not support multiple revocable keys.
|
|
40
46
|
*/
|
|
41
|
-
verificationMethodRemove(verificationMethodId: string,
|
|
47
|
+
verificationMethodRemove(verificationMethodId: string, options?: {
|
|
48
|
+
removeKeys?: boolean;
|
|
49
|
+
}, controller?: string): Promise<void>;
|
|
42
50
|
/**
|
|
43
51
|
* Add a service to the document.
|
|
44
52
|
* @param identity The id of the document to add the service to.
|
|
@@ -15,9 +15,13 @@ export interface IIdentityConnector extends IComponent {
|
|
|
15
15
|
* Remove a document.
|
|
16
16
|
* @param controller The controller of the identity who can make changes.
|
|
17
17
|
* @param documentId The id of the document to remove.
|
|
18
|
+
* @param options Optional settings.
|
|
19
|
+
* @param options.removeKeys Also remove any associated private keys from the vault.
|
|
18
20
|
* @returns A promise that resolves when the document has been removed.
|
|
19
21
|
*/
|
|
20
|
-
removeDocument(controller: string, documentId: string
|
|
22
|
+
removeDocument(controller: string, documentId: string, options?: {
|
|
23
|
+
removeKeys?: boolean;
|
|
24
|
+
}): Promise<void>;
|
|
21
25
|
/**
|
|
22
26
|
* Add a verification method to the document in JSON Web key Format.
|
|
23
27
|
* @param controller The controller of the identity who can make changes.
|
|
@@ -33,11 +37,15 @@ export interface IIdentityConnector extends IComponent {
|
|
|
33
37
|
* Remove a verification method from the document.
|
|
34
38
|
* @param controller The controller of the identity who can make changes.
|
|
35
39
|
* @param verificationMethodId The id of the verification method.
|
|
40
|
+
* @param options Optional settings.
|
|
41
|
+
* @param options.removeKeys Also remove any associated private key from the vault.
|
|
36
42
|
* @returns A promise that resolves when the verification method has been removed.
|
|
37
43
|
* @throws NotFoundError if the id can not be resolved.
|
|
38
44
|
* @throws NotSupportedError if the platform does not support multiple revocable keys.
|
|
39
45
|
*/
|
|
40
|
-
removeVerificationMethod(controller: string, verificationMethodId: string
|
|
46
|
+
removeVerificationMethod(controller: string, verificationMethodId: string, options?: {
|
|
47
|
+
removeKeys?: boolean;
|
|
48
|
+
}): Promise<void>;
|
|
41
49
|
/**
|
|
42
50
|
* Add a service to the document.
|
|
43
51
|
* @param controller The controller of the identity who can make changes.
|
|
@@ -69,4 +69,34 @@ export interface IIdentityProfileComponent<T extends IJsonLdDocument = IJsonLdDo
|
|
|
69
69
|
*/
|
|
70
70
|
cursor?: string;
|
|
71
71
|
}>;
|
|
72
|
+
/**
|
|
73
|
+
* Get a list of identities including private profile data.
|
|
74
|
+
* @param publicFilters The filters to apply to the identities public profiles.
|
|
75
|
+
* @param privateFilters The filters to apply to the identities private profiles.
|
|
76
|
+
* @param publicPropertyNames The public properties to get for the profile, defaults to all.
|
|
77
|
+
* @param privatePropertyNames The private properties to get for the profile, defaults to none.
|
|
78
|
+
* @param cursor The cursor for paged requests.
|
|
79
|
+
* @param limit The maximum number of items in a page.
|
|
80
|
+
* @returns The list of items and cursor for paging.
|
|
81
|
+
*/
|
|
82
|
+
listAdmin(publicFilters?: {
|
|
83
|
+
propertyName: string;
|
|
84
|
+
propertyValue: unknown;
|
|
85
|
+
}[], privateFilters?: {
|
|
86
|
+
propertyName: string;
|
|
87
|
+
propertyValue: unknown;
|
|
88
|
+
}[], publicPropertyNames?: (keyof T)[], privatePropertyNames?: (keyof U)[], cursor?: string, limit?: number): Promise<{
|
|
89
|
+
/**
|
|
90
|
+
* The identities.
|
|
91
|
+
*/
|
|
92
|
+
items: {
|
|
93
|
+
identity: string;
|
|
94
|
+
publicProfile?: Partial<T>;
|
|
95
|
+
privateProfile?: Partial<U>;
|
|
96
|
+
}[];
|
|
97
|
+
/**
|
|
98
|
+
* An optional cursor, when defined can be used to call find to get more entities.
|
|
99
|
+
*/
|
|
100
|
+
cursor?: string;
|
|
101
|
+
}>;
|
|
72
102
|
}
|
|
@@ -15,4 +15,13 @@ export interface IIdentityVerificationMethodRemoveRequest {
|
|
|
15
15
|
*/
|
|
16
16
|
verificationMethodId: string;
|
|
17
17
|
};
|
|
18
|
+
/**
|
|
19
|
+
* The query parameters.
|
|
20
|
+
*/
|
|
21
|
+
query?: {
|
|
22
|
+
/**
|
|
23
|
+
* Also remove any associated private key from the vault.
|
|
24
|
+
*/
|
|
25
|
+
removeKeys?: string;
|
|
26
|
+
};
|
|
18
27
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Request to get the profile of another user as an admin.
|
|
3
|
+
*/
|
|
4
|
+
export interface IIdentityProfileAdminGetRequest {
|
|
5
|
+
/**
|
|
6
|
+
* The path parameters.
|
|
7
|
+
*/
|
|
8
|
+
pathParams: {
|
|
9
|
+
/**
|
|
10
|
+
* The identity of the user whose profile is to be retrieved.
|
|
11
|
+
*/
|
|
12
|
+
userIdentity: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* The query parameters.
|
|
16
|
+
*/
|
|
17
|
+
query?: {
|
|
18
|
+
/**
|
|
19
|
+
* The public properties to get for the profile, defaults to all, should be a comma separated list.
|
|
20
|
+
*/
|
|
21
|
+
publicPropertyNames?: string;
|
|
22
|
+
/**
|
|
23
|
+
* The private properties to get for the profile, defaults to all, should be a comma separated list.
|
|
24
|
+
*/
|
|
25
|
+
privatePropertyNames?: string;
|
|
26
|
+
};
|
|
27
|
+
}
|