@eldev/business-central-api
Version:
A Dynamics 365 Business Central client for TypeScript
23 lines • 1.17 kB
TypeScript
import type { UUID } from "node:crypto";
import type { BCClient } from "../client/client.js";
import type { StandardSchemaV1 } from "../validation/standard-schema.js";
export type PaginationOpts = {
maxResults?: number;
serverPageLimit?: number;
};
export type ODataQuery = string;
export declare class ApiPage<T, TCreate = unknown, TUpdate = unknown, TActions extends string = string> {
#private;
readonly endpoint: string;
readonly client: BCClient;
constructor(client: BCClient, endpoint: string, schema: StandardSchemaV1<unknown, T>);
withCommands<TNewCreate, TNewUpdate, TNewActions extends string = string>(): ApiPage<T, TNewCreate, TNewUpdate, TNewActions>;
getById(id: string, query?: ODataQuery): Promise<T>;
list(query?: ODataQuery, pOpts?: PaginationOpts): AsyncIterableIterator<T>;
findOne(query: ODataQuery): Promise<T | null>;
update(id: string | UUID, updateCommand: TUpdate, query?: ODataQuery): Promise<T>;
create(createCommand: TCreate, query?: ODataQuery): Promise<T>;
delete(id: string): Promise<void>;
action(id: string, action: TActions): Promise<void>;
}
//# sourceMappingURL=api-page.d.ts.map