/** * @module Clients / Instances * @category Entities */ import { AxiosResponse } from 'axios'; import { JwtConfig, Ledger, LedgerPagedList, LedgerRecord } from "../../../types/src"; import { BaseClient, BaseClientOptions } from '../common/clients/base-client'; import { CreateRecordBuilder } from '../common/services/create-record-builder'; import { UpdateRecordBuilder } from '../common/services/update-record-builder'; import { BaseRecordResponse } from '../common/types/base-record-response'; import { BaseListResponse } from '../common/types/list-response'; import { LedgerAccessClient } from './ledger-access-client'; import { LedgerChangeClient } from './ledger-change-client'; import { LedgerListParams } from './ledger-list-params'; /** * Single instance API response. */ export declare class LedgerResponse extends BaseRecordResponse { /** * Record data extracted from the `data` property of the response body. */ ledger: Ledger; constructor(response: AxiosResponse, LedgerRecord>); } /** * Instances list API response. */ export declare class LedgersResponse extends BaseListResponse { ledgers: Ledger[]; constructor(response: AxiosResponse, void>); } /** * Allows querying and managing ledger instances. * * @see {Ledger} */ export declare class LedgerClient extends BaseClient { /** * Allows querying changes. * */ change: LedgerChangeClient; /** * Allows checking access. * */ access: LedgerAccessClient; constructor(options: BaseClientOptions); /** * Initializes a builder instance that supports chaining to make it * easier to work with ledger records. You can pass the record * payload to this method to use as initial content, this is useful * when you already have an object ready, for example when validating * API responses or modifying an existing record. An empty record is * going to be created if no initial data is provided. * * @see {Ledger} * @see {CreateRecordBuilder} * @param options.record initial record payload (optional) * @param options.handle specify handle to be updated, if any (optional) * @returns a builder instance */ init(record?: Partial>): CreateRecordBuilder; /** * Initializes a builder instance for updating existing records. * The builder supports chaining to make it easier to work with * ledger records. You can pass the existing record payload to * this method to use as initial content. * * @see {Ledger} * @see {UpdateRecordBuilder} * @param record initial record payload * @returns a builder instance */ from(record: LedgerRecord): UpdateRecordBuilder; /** * Gets the ledger instance from active ledger identifier * set in context. * * @see {Ledger} * @throws {Error} if the instance doesn't exist or the * current user doesn't have access to this instance * @returns a single instance response with the requested instance */ read(authParams?: Partial): Promise; /** * Queries instances from a ledger. * * @see {Ledger} * @param params query parameters * @returns instances list response with all found instances */ list(params?: LedgerListParams): Promise; }