import { CredentialMetadata, DID, LinkSecret, PrismDID } from "../models"; import { DIDPair } from "../models/DIDPair"; import { PrivateKey } from "../models"; import { Mediator } from "../models/Mediator"; import { Message } from "../models/Message"; import { Credential } from "../models/Credential"; import { PeerDID } from "../../peer-did/PeerDID"; import { Arrayable } from "../../utils"; import * as Backup from "../backup"; import { Startable } from "../protocols"; export declare namespace Pluto { /** * Storable * define properties a Domain object must implement to be compatible with Pluto */ interface Storable { /** * Universally Unique Identifier. * should be unique across all items. */ uuid: string; } const makeUUID: () => string; } /** * Pluto is a storage interface describing storage requirements of the edge agents * which will be implemented using this SDK. Implement this interface using your * preferred underlying storage technology, most appropriate for your use case. */ export interface Pluto extends Startable.IController { /** * create a Backup object from the stored data */ backup(version?: Backup.Version): Promise; /** * load the given data into the store * @param backup */ restore(backup: Backup.Schema): Promise; /** * Store the Credential Metadata */ storeCredentialMetadata(metadata: CredentialMetadata): Promise; /** * Fetch the Credential Metadata by its name * @param name */ getCredentialMetadata(name: string): Promise; /** * Store a DID * with optional private key(s) and alias */ storeDID(did: DID, keys?: Arrayable, alias?: string): Promise; /** * Store a PRISM DID and its private key with given metadata. * @deprecated use storeDID instead */ storePrismDID(did: DID, privateKey: PrivateKey, alias?: string): Promise; /** * Store a Peer DID and an array of its privateKeys. * @deprecated use storeDID instead */ storePeerDID(did: DID, privateKeys: Array): Promise; /** * Store a named pair of DIDs representing a DIDComm connection. */ storeDIDPair(host: DID, receiver: DID, name: string): Promise; /** * Store a DIDComm message. */ storeMessage(message: Message): Promise; /** * Store an array of DIDComm messages */ storeMessages(messages: Array): Promise; /** * Store a list of private keys with its metadata and a reference to the DID it belongs to. */ storePrivateKey(privateKey: PrivateKey): Promise; /** * Store a mediator information. */ storeMediator(mediator: Mediator): Promise; /** * Store a Credential into the Database */ storeCredential(credential: Credential): Promise; /** * Retrieve all stored PRISM DIDs. */ getAllPrismDIDs(): Promise; /** * Retrieve all stored Peer DIDs. */ getAllPeerDIDs(): Promise>; /** * Retrieve available private keys for a given DID. */ getDIDPrivateKeysByDID(did: DID): Promise>; /** * Retrieve all stored DID pairs (DIDComm connections). */ getAllDidPairs(): Promise>; /** * Retrieve a DID pair containing a given DID as either host or receiver. */ getPairByDID(did: DID): Promise; /** * Retrieve a DID pair by a given pair name. */ getPairByName(name: string): Promise; /** * Retrieve all stored DIDComm messages. */ getAllMessages(): Promise>; /** * Retrieve a DIDComm message by ID. */ getMessage(id: string): Promise; /** * Retrieve all stored mediators. */ getAllMediators(): Promise>; /** * Retrieve all the stored credentials */ getAllCredentials(): Promise>; /** * Retrieve the stored link secret by its name */ getLinkSecret(name?: string): Promise; /** * Store a new linkSecret */ storeLinkSecret(linkSecret: LinkSecret): Promise; /** * Revoke a Credential */ revokeCredential(credential: Credential): Promise; /** * Delete a previously stored messages */ deleteMessage(uuid: string): Promise; }