97 lines
5.3 KiB
TypeScript
97 lines
5.3 KiB
TypeScript
import { AxiosRequestConfig } from 'axios';
|
|
import type { ToastConfig, PaginationParams, PaginatedResponse } from './types/index.js';
|
|
export declare class ToastAPIError extends Error {
|
|
statusCode?: number | undefined;
|
|
response?: any | undefined;
|
|
constructor(message: string, statusCode?: number | undefined, response?: any | undefined);
|
|
}
|
|
export declare class ToastAPIClient {
|
|
private client;
|
|
private config;
|
|
constructor(config: ToastConfig);
|
|
get<T>(endpoint: string, params?: Record<string, any>, config?: AxiosRequestConfig): Promise<T>;
|
|
post<T>(endpoint: string, data?: any, config?: AxiosRequestConfig): Promise<T>;
|
|
put<T>(endpoint: string, data?: any, config?: AxiosRequestConfig): Promise<T>;
|
|
patch<T>(endpoint: string, data?: any, config?: AxiosRequestConfig): Promise<T>;
|
|
delete<T>(endpoint: string, config?: AxiosRequestConfig): Promise<T>;
|
|
getPaginated<T>(endpoint: string, pagination?: PaginationParams, additionalParams?: Record<string, any>): Promise<PaginatedResponse<T>>;
|
|
getAllPages<T>(endpoint: string, pageSize?: number, additionalParams?: Record<string, any>): Promise<T[]>;
|
|
orders: {
|
|
list: (params?: {
|
|
startDate?: string;
|
|
endDate?: string;
|
|
pagination?: PaginationParams;
|
|
}) => Promise<PaginatedResponse<unknown>>;
|
|
get: (orderId: string) => Promise<unknown>;
|
|
create: (orderData: any) => Promise<unknown>;
|
|
update: (orderId: string, orderData: any) => Promise<unknown>;
|
|
void: (orderId: string, voidReason?: string) => Promise<unknown>;
|
|
listChecks: (orderId: string) => Promise<unknown>;
|
|
addItem: (orderId: string, checkId: string, itemData: any) => Promise<unknown>;
|
|
removeItem: (orderId: string, checkId: string, selectionId: string) => Promise<unknown>;
|
|
applyDiscount: (orderId: string, checkId: string, discountData: any) => Promise<unknown>;
|
|
};
|
|
menus: {
|
|
list: () => Promise<unknown>;
|
|
get: (menuId: string) => Promise<unknown>;
|
|
listGroups: (menuId: string) => Promise<unknown>;
|
|
getGroup: (menuId: string, groupId: string) => Promise<unknown>;
|
|
listItems: (menuId: string, groupId?: string) => Promise<unknown>;
|
|
getItem: (menuId: string, itemId: string) => Promise<unknown>;
|
|
listModifiers: (menuId: string, itemId: string) => Promise<unknown>;
|
|
updatePrice: (menuId: string, itemId: string, price: number) => Promise<unknown>;
|
|
};
|
|
employees: {
|
|
list: (pagination?: PaginationParams) => Promise<PaginatedResponse<unknown>>;
|
|
get: (employeeId: string) => Promise<unknown>;
|
|
create: (employeeData: any) => Promise<unknown>;
|
|
update: (employeeId: string, employeeData: any) => Promise<unknown>;
|
|
delete: (employeeId: string) => Promise<unknown>;
|
|
listJobs: (employeeId: string) => Promise<unknown>;
|
|
listShifts: (employeeId: string, startDate: string, endDate: string) => Promise<unknown>;
|
|
clockIn: (employeeId: string, jobId: string) => Promise<unknown>;
|
|
clockOut: (employeeId: string, timeEntryId: string) => Promise<unknown>;
|
|
listTimeEntries: (employeeId: string, startDate: string, endDate: string) => Promise<unknown>;
|
|
};
|
|
labor: {
|
|
listShifts: (startDate: string, endDate: string, pagination?: PaginationParams) => Promise<PaginatedResponse<unknown>>;
|
|
getShift: (shiftId: string) => Promise<unknown>;
|
|
listBreaks: (shiftId: string) => Promise<unknown>;
|
|
getLaborCost: (businessDate: string) => Promise<unknown>;
|
|
listJobs: () => Promise<unknown>;
|
|
};
|
|
restaurant: {
|
|
getInfo: () => Promise<unknown>;
|
|
listRevenueCenters: () => Promise<unknown>;
|
|
listDiningOptions: () => Promise<unknown>;
|
|
listServiceAreas: () => Promise<unknown>;
|
|
listTables: (serviceAreaId?: string) => Promise<unknown>;
|
|
};
|
|
payments: {
|
|
list: (startDate: string, endDate: string, pagination?: PaginationParams) => Promise<PaginatedResponse<unknown>>;
|
|
get: (paymentId: string) => Promise<unknown>;
|
|
void: (paymentId: string, voidReason?: string) => Promise<unknown>;
|
|
refund: (paymentId: string, refundAmount: number, refundReason?: string) => Promise<unknown>;
|
|
listTips: (startDate: string, endDate: string) => Promise<unknown>;
|
|
};
|
|
inventory: {
|
|
listItems: (pagination?: PaginationParams) => Promise<PaginatedResponse<unknown>>;
|
|
getItem: (itemId: string) => Promise<unknown>;
|
|
updateCount: (itemId: string, quantity: number) => Promise<unknown>;
|
|
listVendors: () => Promise<unknown>;
|
|
createPurchaseOrder: (poData: any) => Promise<unknown>;
|
|
};
|
|
customers: {
|
|
list: (pagination?: PaginationParams) => Promise<PaginatedResponse<unknown>>;
|
|
get: (customerId: string) => Promise<unknown>;
|
|
create: (customerData: any) => Promise<unknown>;
|
|
update: (customerId: string, customerData: any) => Promise<unknown>;
|
|
listLoyalty: (customerId: string) => Promise<unknown>;
|
|
addLoyaltyPoints: (customerId: string, points: number) => Promise<unknown>;
|
|
};
|
|
cash: {
|
|
listEntries: (startDate: string, endDate: string, pagination?: PaginationParams) => Promise<PaginatedResponse<unknown>>;
|
|
getDrawerStatus: (drawerId: string) => Promise<unknown>;
|
|
};
|
|
}
|
|
//# sourceMappingURL=api-client.d.ts.map
|