import { InteractionTokenEntity } from './entities/interactionTokenEntity'; import { IStorage, EncryptedWalletAttributes, QueryOptions, CredentialQuery, InteractionTokenQuery, InteractionQuery, InteractionQueryAttrs } from '@jolocom/sdk/js/storage'; import { Connection, SelectQueryBuilder } from 'typeorm'; import { SignedCredential } from 'jolocom-lib/js/credentials/signedCredential/signedCredential'; import { CredentialOfferMetadata, CredentialOfferRenderInfo } from 'jolocom-lib/js/interactionTokens/interactionTokens.types'; import { InternalDb } from '@jolocom/local-resolver-registrar/js/db'; import { JWTEncodable, JSONWebToken } from 'jolocom-lib/js/interactionTokens/JSONWebToken'; import { Identity } from 'jolocom-lib/js/identity/identity'; import { IdentitySummary } from '@jolocom/sdk'; export interface PersonaAttributes { did: string; controllingKeyPath: string; } /** * @todo IdentitySummary is a UI type, which can always be * derived from a DID Doc and Public Profile. * Perhaps that's what we should store instead, since those * are more generic and can be reused. */ export declare class JolocomTypeormStorage implements IStorage { private connection; store: { setting: (key: string, value: any) => Promise; verifiableCredential: (vCred: SignedCredential) => Promise; encryptedWallet: (args: EncryptedWalletAttributes) => Promise; credentialMetadata: (credentialMetadata: CredentialMetadataSummary) => Promise; issuerProfile: (issuer: IdentitySummary) => Promise; identity: (identity: Identity) => Promise; interactionToken: (token: JSONWebToken) => Promise; }; get: { settingsObject: () => Promise<{ [key: string]: any; }>; setting: (key: string) => Promise; verifiableCredential: (query?: import("@jolocom/sdk/js/storage").CredentialQueryAttrs | import("@jolocom/sdk/js/storage").CredentialQueryAttrs[] | undefined, queryOpts?: QueryOptions | undefined) => Promise; attributesByType: (type: string[]) => Promise<{ type: string[]; results: { verification: any; values: any; fieldName: any; }[]; }>; vCredentialsByAttributeValue: (attribute: string, queryOptions?: QueryOptions | undefined) => Promise; encryptedWallet: (id?: string | undefined) => Promise; credentialMetadata: ({ issuer, type: credentialType, }: SignedCredential) => Promise; publicProfile: (did: string) => Promise; identity: (did: string) => Promise; interactionTokens: (query: InteractionTokenQuery, queryOptions?: QueryOptions | undefined) => Promise[]>; interactionIds: (query?: InteractionQueryAttrs | InteractionQueryAttrs[] | undefined, queryOptions?: QueryOptions | undefined) => Promise; }; delete: { verifiableCredential: (id: string) => Promise; identity: (did: string) => Promise; encryptedWallet: (did: string) => Promise; verifiableCredentials: (query: CredentialQuery) => Promise; interactions: (query?: InteractionQueryAttrs | InteractionQueryAttrs[] | undefined) => Promise; }; constructor(conn: Connection); private getSettingsObject; private getSetting; private saveSetting; private getVCredential; private getAttributesByType; private getVCredentialsForAttribute; private getEncryptedWallet; private findTokens; private findInteractionIds; private getMetadataForCredential; private getPublicProfile; private getCachedIdentity; private storeEncryptedWallet; private storeCredentialMetadata; private storeIssuerProfile; private cacheIdentity; private storeInteractionToken; private storeVClaim; private deleteIdentity; private deleteEncryptedWallet; private deleteVCred; private deleteVCreds; _buildInteractionQueryBuilder(query?: InteractionQuery, options?: QueryOptions): SelectQueryBuilder; private _applyQueryOptions; _applyInteractionQuery(qb: SelectQueryBuilder, query?: InteractionQuery): SelectQueryBuilder; private deleteInteractions; private readEventLog; private appendEvent; private deleteEventLog; eventDB: InternalDb; } export interface CredentialMetadata { type: string; renderInfo: CredentialOfferRenderInfo; metadata: CredentialOfferMetadata; } export interface CredentialMetadataSummary extends CredentialMetadata { issuer: IdentitySummary; }