import protobuf from 'protobufjs'; import { RecordExtension } from '../encoding'; import { Record as RawRecord } from '../proto'; import { AccountKey } from './account-key'; import { CID } from './cid'; import { DomainKey } from './domain-key'; import { DXN } from './dxn'; import { Filter } from './filtering'; import { Authority, RegistryClientBackend } from './registry'; export declare type ResourceSet = { name: DXN; tags: Record; }; export declare type RegistryRecord = Omit & { cid: CID; payload: RecordExtension; }; export declare type RegistryType = Omit & { cid: CID; type: { /** * FQN of the root message in the protobuf definitions. * NOTE: Should not be used to name this type. */ messageName: string; protobufDefs: protobuf.Root; /** * Source of the type definition. */ protobufIpfsCid?: CID; }; }; /** * Record metadata provided by the user. */ export interface RecordMetadata { displayName?: string; description?: string; tags?: string[]; } export interface TypeRecordMetadata extends RecordMetadata { protobufIpfsCid?: string; } /** * Main API for DXNS registry. */ export declare class RegistryClient { private readonly _backend; private readonly _recordCache; private readonly _typeCache; constructor(_backend: RegistryClientBackend); /** * Resolves a domain key from the domain name. * @param domainName Name of the domain. */ getDomainKey(domainName: string): Promise; /** * Returns a list of authorities created in DXOS system. */ listAuthorities(): Promise; /** * Creates a new domain in the system under a generated name. * @param account DXNS account that will own the domain. */ registerAuthority(account: AccountKey): Promise; /** * Gets resource by its registered name. * @param name DXN of the resource used for registration. */ getResource(name: DXN): Promise; /** * List resources registered in the system. * @param filter Filter that each returned record must meet. */ listResources(filter?: Filter): Promise; /** * Registers or updates a resource in the system. * Undefined CID means that the resource will be deleted. * @param name Identifies the domain and name of the resource. * @param tag Tag for the resource. * @param cid CID of the record to be referenced with the given name. * @param owner DXNS account that will own the resource. */ registerResource(name: DXN, cid: CID | undefined, owner: AccountKey): Promise; /** * Gets record details by CID. * @param cid CID of the record. */ getRecord(cid: CID): Promise | undefined>; /** * Gets resource by its registered name. * @param name DXN of the resource used for registration. */ getRecordByName(name: DXN): Promise | undefined>; /** * Lists records in the system. * @param filter Filter that each returned record must meet. */ listRecords(filter?: Filter): Promise; /** * Creates a new data record in the system. * @param data Payload data of the record. * @param typeId CID of the type record that holds the schema of the data. * @param meta Record metadata information. */ registerRecord(data: unknown, typeId: CID, meta?: RecordMetadata): Promise; /** * Gets type records details by CID. * @param cid CID of the record. */ getTypeRecord(cid: CID): Promise; /** * Lists type records in the system. * @param filter Filter that each returned record must meet. */ listTypeRecords(filter?: Filter): Promise; /** * Creates a new type record in the system. * @param schema Protobuf schema of the type. * @param messageFqn Fully qualified name of the message. It must reside in the schema definition. * @param meta Record metadata information. */ registerTypeRecord(messageName: string, schema: protobuf.Root, meta?: TypeRecordMetadata): Promise; private _fetchRecord; private _decodeRecord; private _fetchType; private _decodeType; } //# sourceMappingURL=registry-client.d.ts.map