UNPKG

@sphereon/ssi-sdk.data-store

Version:

37 lines 2.92 kB
import { OrPromise, StatusListType } from '@sphereon/ssi-types'; import { DataSource, Repository } from 'typeorm'; import { StatusListEntity } from '../entities/statusList/StatusListEntities'; import { StatusListEntryEntity } from '../entities/statusList/StatusList2021EntryEntity'; import { IAddStatusListArgs, IAddStatusListEntryArgs, IGetStatusListArgs, IGetStatusListEntriesArgs, IGetStatusListEntryByCredentialIdArgs, IGetStatusListEntryByIndexArgs, IGetStatusListsArgs, IRemoveStatusListArgs, IStatusListEntity, IStatusListEntryAvailableArgs, IStatusListEntryEntity, IUpdateStatusListIndexArgs } from '../types'; import { IStatusListStore } from './IStatusListStore'; export declare class StatusListStore implements IStatusListStore { private readonly _dbConnection; constructor(dbConnection: OrPromise<DataSource>); /** * Gets the available status list indices from the provided indices. Meaning it will filter out any index that is already known. * * The idea is that the caller provides a set of random status list indices. We can relatively easy check against the DB in an optimized way. * If the status list is large it is probably best to also provide at least a good number of indices. So something like 10 or 20 values. * Callers are also expected to call this function multiple times if it does not yield results * * @param args */ availableStatusListEntries(args: IStatusListEntryAvailableArgs): Promise<number[]>; addStatusListEntry(args: IAddStatusListEntryArgs): Promise<IStatusListEntryEntity>; updateStatusListEntry(args: IAddStatusListEntryArgs): Promise<IStatusListEntryEntity>; getStatusListEntryByIndex({ statusListId, statusListCorrelationId, statusListIndex, entryCorrelationId, errorOnNotFound, }: IGetStatusListEntryByIndexArgs): Promise<StatusListEntryEntity | undefined>; getStatusListEntryByCredentialId(args: IGetStatusListEntryByCredentialIdArgs): Promise<StatusListEntryEntity | undefined>; removeStatusListEntryByCredentialId(args: IGetStatusListEntryByCredentialIdArgs): Promise<boolean>; removeStatusListEntryByIndex(args: IGetStatusListEntryByIndexArgs): Promise<boolean>; getStatusListEntries(args: IGetStatusListEntriesArgs): Promise<StatusListEntryEntity[]>; getStatusList(args: IGetStatusListArgs): Promise<IStatusListEntity>; private getStatusListEntity; getStatusLists(args: IGetStatusListsArgs): Promise<Array<IStatusListEntity>>; addStatusList(args: IAddStatusListArgs): Promise<IStatusListEntity>; updateStatusList(args: IUpdateStatusListIndexArgs): Promise<IStatusListEntity>; removeStatusList(args: IRemoveStatusListArgs): Promise<boolean>; private getDS; getStatusListRepo(type?: StatusListType): Promise<Repository<StatusListEntity>>; getStatusListEntryRepo(): Promise<Repository<StatusListEntryEntity>>; } //# sourceMappingURL=StatusListStore.d.ts.map