/** * Core TypeScript type definitions for QBOMCP-TS */ import { z } from 'zod'; export interface QBOConfig { clientId: string; clientSecret: string; companyId: string; refreshToken: string; environment: 'sandbox' | 'production'; redirectUri?: string; } export interface QBOTokens { accessToken: string; refreshToken: string; expiresAt: Date; } export interface QBOCustomer { Id: string; DisplayName: string; GivenName?: string; FamilyName?: string; CompanyName?: string; PrimaryEmailAddr?: { Address: string; }; PrimaryPhone?: { FreeFormNumber: string; }; Balance?: number; Active?: boolean; MetaData?: { CreateTime: string; LastUpdatedTime: string; }; } export interface QBOInvoice { Id: string; DocNumber?: string; TxnDate: string; DueDate?: string; CustomerRef: { value: string; name?: string; }; Line: QBOLineItem[]; TotalAmt: number; Balance?: number; EmailStatus?: 'NotSet' | 'NeedToSend' | 'EmailSent'; MetaData?: { CreateTime: string; LastUpdatedTime: string; }; } export interface QBOLineItem { Id?: string; LineNum?: number; Description?: string; Amount: number; DetailType: 'SalesItemLineDetail' | 'DiscountLineDetail' | 'SubTotalLineDetail'; SalesItemLineDetail?: { ItemRef?: { value: string; name?: string; }; UnitPrice?: number; Qty?: number; TaxCodeRef?: { value: string; }; }; } export interface QBOExpense { Id: string; PaymentType?: 'Cash' | 'Check' | 'CreditCard' | 'Bank'; EntityRef?: { value: string; name?: string; type: 'Vendor' | 'Customer' | 'Employee'; }; AccountRef: { value: string; name?: string; }; TxnDate: string; TotalAmt: number; Line: QBOExpenseLine[]; MetaData?: { CreateTime: string; LastUpdatedTime: string; }; } export interface QBOExpenseLine { Id?: string; Amount: number; DetailType: 'AccountBasedExpenseLineDetail' | 'ItemBasedExpenseLineDetail'; AccountBasedExpenseLineDetail?: { AccountRef: { value: string; name?: string; }; }; Description?: string; } export interface QBOAccount { Id: string; Name: string; AcctNum?: string; AccountType: string; AccountSubType?: string; CurrentBalance?: number; Active?: boolean; SubAccount?: boolean; ParentRef?: { value: string; name?: string; }; } export interface QBOReport { Header: { Time: string; ReportName: string; ReportBasis?: 'Cash' | 'Accrual'; StartPeriod?: string; EndPeriod?: string; SummarizeColumnsBy?: string; Currency?: string; }; Columns?: { Column: Array<{ ColTitle?: string; ColType?: string; MetaData?: any; }>; }; Rows?: { Row?: Array; }; } export interface QBOReportRow { type?: string; group?: string; ColData?: Array<{ value?: string; id?: string; }>; Rows?: { Row?: Array; }; Summary?: { ColData?: Array<{ value?: string; }>; }; } export declare const GetInvoicesSchema: z.ZodObject<{ status: z.ZodOptional>; customerName: z.ZodOptional; dateFrom: z.ZodOptional; dateTo: z.ZodOptional; minAmount: z.ZodOptional; maxAmount: z.ZodOptional; limit: z.ZodOptional; }, z.core.$strip>; export declare const CreateInvoiceSchema: z.ZodObject<{ customerName: z.ZodString; items: z.ZodArray; unitPrice: z.ZodOptional; }, z.core.$strip>>; dueDate: z.ZodOptional; memo: z.ZodOptional; emailToCustomer: z.ZodOptional; }, z.core.$strip>; export declare const SendInvoiceSchema: z.ZodObject<{ invoiceId: z.ZodString; email: z.ZodOptional; subject: z.ZodOptional; message: z.ZodOptional; }, z.core.$strip>; export declare const CreateExpenseSchema: z.ZodObject<{ vendorName: z.ZodString; amount: z.ZodNumber; accountName: z.ZodString; paymentMethod: z.ZodOptional>; description: z.ZodOptional; date: z.ZodOptional; referenceNumber: z.ZodOptional; }, z.core.$strip>; export declare const GetExpensesSchema: z.ZodObject<{ dateFrom: z.ZodOptional; dateTo: z.ZodOptional; vendorName: z.ZodOptional; minAmount: z.ZodOptional; maxAmount: z.ZodOptional; accountName: z.ZodOptional; limit: z.ZodOptional; }, z.core.$strip>; export declare const ProfitAndLossSchema: z.ZodObject<{ startDate: z.ZodOptional; endDate: z.ZodOptional; summarizeBy: z.ZodOptional>; accountingMethod: z.ZodOptional>; }, z.core.$strip>; export declare const BalanceSheetSchema: z.ZodObject<{ asOfDate: z.ZodOptional; summarizeBy: z.ZodOptional>; accountingMethod: z.ZodOptional>; }, z.core.$strip>; export declare const CashFlowSchema: z.ZodObject<{ startDate: z.ZodOptional; endDate: z.ZodOptional; }, z.core.$strip>; export declare const AgingReportSchema: z.ZodObject<{ reportType: z.ZodEnum<{ receivables: "receivables"; payables: "payables"; }>; asOfDate: z.ZodOptional; agingPeriod: z.ZodDefault; }, z.core.$strip>; export declare const GetCustomersSchema: z.ZodObject<{ active: z.ZodOptional; withBalance: z.ZodOptional; nameContains: z.ZodOptional; limit: z.ZodOptional; }, z.core.$strip>; export declare const CreateCustomerSchema: z.ZodObject<{ displayName: z.ZodString; givenName: z.ZodOptional; familyName: z.ZodOptional; companyName: z.ZodOptional; email: z.ZodOptional; phone: z.ZodOptional; billingAddress: z.ZodOptional; city: z.ZodOptional; countrySubDivisionCode: z.ZodOptional; postalCode: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>; export declare const CustomerBalanceSchema: z.ZodObject<{ customerName: z.ZodString; }, z.core.$strip>; export declare const ChartOfAccountsSchema: z.ZodObject<{ accountType: z.ZodOptional>; active: z.ZodOptional; }, z.core.$strip>; export declare const JournalEntrySchema: z.ZodObject<{ date: z.ZodString; entries: z.ZodArray; credit: z.ZodOptional; description: z.ZodOptional; }, z.core.$strip>>; memo: z.ZodOptional; }, z.core.$strip>; export interface MCPToolResponse { success: boolean; data?: T; error?: string; suggestion?: string; metadata?: { timestamp: string; requestId: string; apiCalls?: number; cached?: boolean; }; } export interface InvoiceListResponse { summary: string; count: number; totalAmount: number; invoices: Array<{ invoiceNumber: string; customer: string; date: string; dueDate: string; total: string; balance: string; status: 'Paid' | 'Unpaid' | 'Overdue'; id: string; }>; } export interface ExpenseListResponse { summary: string; count: number; total: string; expenses: Array<{ date: string; vendor: string; amount: string; paymentMethod: string; account: string; description?: string; id: string; }>; } export interface CustomerListResponse { summary: string; count: number; customers: Array<{ name: string; balance: string; email: string; phone: string; active: boolean; id: string; }>; } export interface ReportResponse { report: string; generated: string; period?: string; data: any; summary?: { totalIncome?: number; totalExpenses?: number; netIncome?: number; totalAssets?: number; totalLiabilities?: number; totalEquity?: number; }; nextSteps?: string[]; } export interface ICacheService { get(key: string): Promise; set(key: string, value: T, ttl?: number): Promise; delete(key: string): Promise; clear(): Promise; } export interface IQueueService { add(task: () => Promise, priority?: number): Promise; pause(): void; resume(): void; clear(): void; size(): number; pending(): number; } export interface ILoggerService { info(message: string, meta?: any): void; warn(message: string, meta?: any): void; error(message: string, error?: Error, meta?: any): void; debug(message: string, meta?: any): void; http(message: string, meta?: any): void; } export type TransportType = 'stdio' | 'sse'; export interface TransportConfig { type: TransportType; port?: number; host?: string; cors?: { origin: string | string[]; credentials?: boolean; }; rateLimit?: { windowMs: number; max: number; }; healthCheckPath?: string; } export declare class QBOError extends Error { code: string; statusCode?: number | undefined; details?: any | undefined; constructor(message: string, code: string, statusCode?: number | undefined, details?: any | undefined); } export declare class AuthenticationError extends QBOError { constructor(message: string, details?: any); } export declare class ValidationError extends QBOError { constructor(message: string, details?: any); } export declare class RateLimitError extends QBOError { constructor(message: string, retryAfter?: number); } export declare class NetworkError extends QBOError { constructor(message: string, details?: any); } export type DeepPartial = T extends object ? { [P in keyof T]?: DeepPartial; } : T; export type Awaitable = T | Promise; export type ValueOf = T[keyof T]; //# sourceMappingURL=index.d.ts.map