/** * @module Clients / Schemas * @category Entities */ import { AxiosResponse } from 'axios'; import { JwtConfig, LedgerIdentifier, LedgerPagedList, LedgerRecord, LedgerSchema } from "../../../types/src"; import { AccessClient } from '../common/clients/access-client'; import { BaseChangeClient } from '../common/clients/base-change-client'; 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 { SchemaListParams } from './schema-list-params'; /** * Single schema API response. */ export declare class SchemaResponse extends BaseRecordResponse { /** * Record data extracted from the `data` property of the response body. */ schema: LedgerSchema; constructor(response: AxiosResponse, LedgerRecord>); } /** * Schemas list API response. */ export declare class SchemasResponse extends BaseListResponse { schemas: LedgerSchema[]; constructor(response: AxiosResponse, void>); } /** * Allows querying and managing schemas. * * @see {LedgerSchema} */ export declare class SchemaClient extends BaseClient { /** * Allows querying changes. * */ change: BaseChangeClient; /** * Allows checking access. * */ access: AccessClient; 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 {LedgerSchema} * @see {CreateRecordBuilder} * @param record initial record payload (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 need to pass the existing record payload * to this method to use as initial content. * * @see {LedgerSchema} * @see {UpdateRecordBuilder} * @param record initial record payload * @returns a builder instance */ from(record: LedgerRecord): UpdateRecordBuilder; /** * Gets a ledger schema by identifier (luid or handle). * * @see {LedgerSchema} * @throws {Error} if the schema doesn't exist or the * current user doesn't have access to this schema * @param id a unique schema handle * @returns a single schema response with the requested schema */ read(id: LedgerIdentifier, authParams?: Partial): Promise; /** * Queries schemas from a ledger. * * @see {LedgerSchema} * @param params query parameters * @returns schemas list response with all found schemas */ list(params?: SchemaListParams): Promise; }