modules/cache-client.CacheClient
- addDIDToWatchList
- addStatusToCredential
- authenticate
- deleteClaim
- getAllowedRolesByIssuer
- getAppDefinition
- getApplicationRoles
- getApplicationsByOrganization
- getApplicationsByOwner
- getAssetById
- getAssetHistory
- getClaimById
- getClaimsByIssuer
- getClaimsByRequester
- getClaimsByRevoker
- getClaimsBySubject
- getClaimsBySubjects
- getDIDsForRole
- getDidDocument
- getNamespaceBySearchPhrase
- getOfferedAssets
- getOrgDefinition
- getOrgHierarchy
- getOrganizationRoles
- getOrganizationsByOwner
- getOwnedAssets
- getPreviouslyOwnedAssets
- getRoleDefinition
- getRolesByOwner
- getRolesByRevoker
- getRolesDefinition
- getStatusListCredential
- getSubOrganizationsByOrganization
- handleError
- init
- initiateCredentialStatusUpdate
- isAuthEnabled
- issueClaim
- login
- persistCredentialStatusUpdate
- rejectClaim
- requestClaim
• new CacheClient(_signerService
)
Name | Type |
---|---|
_signerService |
SignerService |
• pubKeyAndIdentityToken: undefined
| IPubKeyAndIdentityToken
ICacheClient.pubKeyAndIdentityToken
• get
http(): AxiosInstance
AxiosInstance
▸ addDIDToWatchList(did
): Promise
<void
>
Name | Type |
---|---|
did |
string |
Promise
<void
>
ICacheClient.addDIDToWatchList
▸ addStatusToCredential(credential
): Promise
<Credential
<RoleCredentialSubject
> & { credentialStatus
: StatusList2021Entry
}>
Sets location of the credential status
Name | Type | Description |
---|---|---|
credential |
Credential <RoleCredentialSubject > |
unsigned credential |
Promise
<Credential
<RoleCredentialSubject
> & { credentialStatus
: StatusList2021Entry
}>
credential with reference to status location
▸ authenticate(): Promise
<void
>
description
Refreshes access token. If login still fails then signs new identity token and requests access token
After authentication runs previously failed requests
Promise
<void
>
▸ deleteClaim(id
): Promise
<void
>
Name | Type |
---|---|
id |
string |
Promise
<void
>
▸ getAllowedRolesByIssuer(did
): Promise
<IRole
[]>
Name | Type |
---|---|
did |
string |
Promise
<IRole
[]>
▸ getAppDefinition(namespace
): Promise
<IAppDefinition
>
Name | Type |
---|---|
namespace |
string |
Promise
<IAppDefinition
>
▸ getApplicationRoles(namespace
): Promise
<IRole
[]>
Name | Type |
---|---|
namespace |
string |
Promise
<IRole
[]>
ICacheClient.getApplicationRoles
▸ getApplicationsByOrganization(namespace
): Promise
<IApp
[]>
Name | Type |
---|---|
namespace |
string |
Promise
<IApp
[]>
ICacheClient.getApplicationsByOrganization
▸ getApplicationsByOwner(owner
, withRelations?
): Promise
<IApp
[]>
Name | Type | Default value |
---|---|---|
owner |
string |
undefined |
withRelations |
boolean |
true |
Promise
<IApp
[]>
ICacheClient.getApplicationsByOwner
▸ getAssetById(id
): Promise
<Asset
>
Name | Type |
---|---|
id |
string |
Promise
<Asset
>
▸ getAssetHistory(id
, __namedParameters?
): Promise
<AssetHistory
[]>
Name | Type |
---|---|
id |
string |
__namedParameters |
AssetsFilter |
Promise
<AssetHistory
[]>
▸ getClaimById(claimId
): Promise
<undefined
| Claim
>
Name | Type |
---|---|
claimId |
string |
Promise
<undefined
| Claim
>
▸ getClaimsByIssuer(issuer
, __namedParameters?
): Promise
<Claim
[]>
Name | Type |
---|---|
issuer |
string |
__namedParameters |
ClaimsFilter |
Promise
<Claim
[]>
ICacheClient.getClaimsByIssuer
▸ getClaimsByRequester(requester
, __namedParameters?
): Promise
<Claim
[]>
Name | Type |
---|---|
requester |
string |
__namedParameters |
ClaimsFilter |
Promise
<Claim
[]>
ICacheClient.getClaimsByRequester
▸ getClaimsByRevoker(__namedParameters?
): Promise
<Claim
[]>
Name | Type |
---|---|
__namedParameters |
ClaimsFilter |
Promise
<Claim
[]>
ICacheClient.getClaimsByRevoker
▸ getClaimsBySubject(subject
, __namedParameters?
): Promise
<Claim
[]>
Name | Type |
---|---|
subject |
string |
__namedParameters |
ClaimsFilter |
Promise
<Claim
[]>
ICacheClient.getClaimsBySubject
▸ getClaimsBySubjects(subjects
): Promise
<Claim
[]>
Name | Type |
---|---|
subjects |
string [] |
Promise
<Claim
[]>
ICacheClient.getClaimsBySubjects
▸ getDIDsForRole(namespace
): Promise
<string
[]>
Name | Type |
---|---|
namespace |
string |
Promise
<string
[]>
▸ getDidDocument(did
, includeClaims?
): Promise
<IDIDDocument
>
Name | Type |
---|---|
did |
string |
includeClaims? |
boolean |
Promise
<IDIDDocument
>
▸ getNamespaceBySearchPhrase(search
, types?
): Promise
<(IRole
| IOrganization
| IApp
)[]>
Name | Type |
---|---|
search |
string |
types? |
SearchType [] |
Promise
<(IRole
| IOrganization
| IApp
)[]>
ICacheClient.getNamespaceBySearchPhrase
▸ getOfferedAssets(did
): Promise
<Asset
[]>
Name | Type |
---|---|
did |
string |
Promise
<Asset
[]>
▸ getOrgDefinition(namespace
): Promise
<IOrganizationDefinition
>
Name | Type |
---|---|
namespace |
string |
Promise
<IOrganizationDefinition
>
▸ getOrgHierarchy(namespace
): Promise
<IOrganization
>
Name | Type |
---|---|
namespace |
string |
Promise
<IOrganization
>
▸ getOrganizationRoles(namespace
): Promise
<IRole
[]>
Name | Type |
---|---|
namespace |
string |
Promise
<IRole
[]>
ICacheClient.getOrganizationRoles
▸ getOrganizationsByOwner(owner
, withRelations?
): Promise
<IOrganization
[]>
Name | Type | Default value |
---|---|---|
owner |
string |
undefined |
withRelations |
boolean |
true |
Promise
<IOrganization
[]>
ICacheClient.getOrganizationsByOwner
▸ getOwnedAssets(did
): Promise
<Asset
[]>
Name | Type |
---|---|
did |
string |
Promise
<Asset
[]>
▸ getPreviouslyOwnedAssets(owner
): Promise
<Asset
[]>
Name | Type |
---|---|
owner |
string |
Promise
<Asset
[]>
ICacheClient.getPreviouslyOwnedAssets
▸ getRoleDefinition(namespace
): Promise
<IRoleDefinition
| IRoleDefinitionV2
>
Name | Type |
---|---|
namespace |
string |
Promise
<IRoleDefinition
| IRoleDefinitionV2
>
ICacheClient.getRoleDefinition
▸ getRolesByOwner(owner
): Promise
<IRole
[]>
Name | Type |
---|---|
owner |
string |
Promise
<IRole
[]>
▸ getRolesByRevoker(revoker
): Promise
<IRole
[]>
Name | Type |
---|---|
revoker |
string |
Promise
<IRole
[]>
ICacheClient.getRolesByRevoker
▸ getRolesDefinition(namespaces
): Promise
<Record
<string
, IRoleDefinition
>>
Name | Type |
---|---|
namespaces |
string [] |
Promise
<Record
<string
, IRoleDefinition
>>
ICacheClient.getRolesDefinition
▸ getStatusListCredential(credential
): Promise
<null
| StatusList2021Credential
>
Fetch the StatusList2021Credential object from storage.
Name | Type | Description |
---|---|---|
credential |
VerifiableCredential <RoleCredentialSubject > |
verifiable credential with status list 2021 |
Promise
<null
| StatusList2021Credential
>
status list credential if found
▸ getSubOrganizationsByOrganization(namespace
): Promise
<IOrganization
[]>
Name | Type |
---|---|
namespace |
string |
Promise
<IOrganization
[]>
ICacheClient.getSubOrganizationsByOrganization
▸ handleError(error
): Promise
<unknown
>
description
Interceptor of authentication errors. Queues failed requests and starts authentication process.
Name | Type | Description |
---|---|---|
error |
AxiosError <unknown , any > |
Intercepted response from failed request |
Promise
<unknown
>
Promise, which resolves with result of resending of failed request
▸ init(): Promise
<void
>
Promise
<void
>
▸ initiateCredentialStatusUpdate(verifiableCredential
): Promise
<StatusList2021UnsignedCredential
>
Get the StatusList2021Credential object to be signed
Name | Type | Description |
---|---|---|
verifiableCredential |
VerifiableCredential <RoleCredentialSubject > |
verifiable credential to be revoked |
Promise
<StatusList2021UnsignedCredential
>
unsigned status list credential
▸ isAuthEnabled(): boolean
boolean
▸ issueClaim(issuer
, message
): Promise
<void
>
Name | Type |
---|---|
issuer |
string |
message |
IClaimIssuance |
Promise
<void
>
▸ login(): Promise
<void
>
Verifies current session and establishes new one if needed https://energyweb.atlassian.net/wiki/spaces/MYEN/pages/2303295607/ICL-+ICS+Auth+Process
Promise
<void
>
▸ persistCredentialStatusUpdate(statusListCredential
): Promise
<StatusList2021Credential
>
Persist signed StatusList2021Credential object in storage.
Name | Type | Description |
---|---|---|
statusListCredential |
StatusList2021Credential |
signed status list |
Promise
<StatusList2021Credential
>
status list credential
▸ rejectClaim(issuer
, message
): Promise
<void
>
Name | Type |
---|---|
issuer |
string |
message |
IClaimRejection |
Promise
<void
>
▸ requestClaim(message
): Promise
<void
>
Name | Type |
---|---|
message |
IClaimRequest |
Promise
<void
>