virgil-sdk
Version:
Virgil Security Services SDK
46 lines (45 loc) • 1.75 kB
TypeScript
import { IConnection, IProductInfo } from './Connection';
import { RawSignedModel } from '../Cards/RawSignedModel';
/**
* @hidden
*/
export interface ICardResult {
readonly cardRaw: RawSignedModel;
readonly isOutdated: boolean;
}
/**
* Class responsible for sending requests to the Virgil Cards Service.
*
* @hidden
*/
export declare class CardClient {
private readonly connection;
/**
* Initializes new instance of `CardClient`.
* @param {IConnection | string} connection - Object implementing the
* {@link IConnection} interface.
*/
constructor(connection?: IConnection | string, productInfo?: IProductInfo);
/**
* Issues a request to search cards by the `identity`.
* @param {string[]} identities - Array of identities to search for.
* @param {string} accessToken - A token to authenticate the request.
* @returns {Promise<RawSignedModel[]>}
*/
searchCards(identities: string[], accessToken: string): Promise<RawSignedModel[]>;
/**
* Issues a request to get the card by id.
* @param {string} cardId - Id of the card to fetch.
* @param {string} accessToken - A token to authenticate the request.
* @returns {Promise<ICardResult>}
*/
getCard(cardId: string, accessToken: string): Promise<ICardResult>;
/**
* Issues a request to publish the card.
* @param {RawSignedModel} model - Card to publish.
* @param {string} accessToken - A token to authenticate the request.
* @returns {Promise<RawSignedModel>}
*/
publishCard(model: RawSignedModel, accessToken: string): Promise<RawSignedModel>;
revokeCard(cardId: string, accessToken: string): Promise<void>;
}