diff --git a/mcp-gateway/wave-mcp/src/types.ts b/mcp-gateway/wave-mcp/src/types.ts new file mode 100644 index 0000000..6df8307 --- /dev/null +++ b/mcp-gateway/wave-mcp/src/types.ts @@ -0,0 +1,161 @@ +// ── Config ──────────────────────────────────────────────────────────────────── + +export interface WaveConfig { + accessToken: string; +} + +// ── Pagination ──────────────────────────────────────────────────────────────── + +export interface PageInfo { + currentPage: number; + totalPages: number; + totalCount: number; +} + +export interface PaginatedResult { + total: number; + count: number; + page: number; + totalPages: number; + items: T[]; + has_more: boolean; + next_page?: number; +} + +// ── GraphQL ─────────────────────────────────────────────────────────────────── + +export interface GraphQLResponse { + data?: T; + errors?: Array<{ message: string; locations?: unknown; path?: unknown }>; +} + +export interface MutationResult { + didSucceed: boolean; + inputErrors: Array<{ + code: string; + message: string; + path?: string[]; + }>; +} + +// ── Index-signature base (required for structuredContent) ──────────────────── + +export type JsonObject = { [key: string]: unknown }; + +// ── Wave Entities ───────────────────────────────────────────────────────────── + +export interface WaveBusiness extends JsonObject { + id: string; + name: string; + isPersonal: boolean; + organizationalType?: string; + isClassicAccounting: boolean; + isClassicInvoicing: boolean; + currency: { code: string; symbol: string; name: string }; + address?: { + addressLine1?: string; + addressLine2?: string; + city?: string; + province?: { name: string; code: string }; + country?: { name: string; code: string }; + postalCode?: string; + }; +} + +export interface WaveCustomer extends JsonObject { + id: string; + name: string; + firstName?: string; + lastName?: string; + email?: string; + currency?: { code: string }; + address?: { + addressLine1?: string; + city?: string; + country?: { name: string; code: string }; + postalCode?: string; + }; + createdAt: string; + modifiedAt: string; +} + +export interface WaveProduct extends JsonObject { + id: string; + name: string; + description?: string; + unitPrice?: number; + isSold: boolean; + isBought: boolean; + isArchived: boolean; + incomeAccount?: { id: string; name: string }; + expenseAccount?: { id: string; name: string }; + currency?: { code: string }; + createdAt: string; + modifiedAt: string; +} + +export interface WaveInvoiceItem extends JsonObject { + product?: { id: string; name: string }; + description?: string; + quantity: number; + unitPrice: number; + subtotal: number; + total: number; + account?: { id: string; name: string }; + taxes?: Array<{ amount: { value: number }; salesTaxRate?: { name: string } }>; +} + +export interface WaveInvoice extends JsonObject { + id: string; + pdfUrl?: string; + viewUrl?: string; + status: string; + title?: string; + subhead?: string; + invoiceNumber: string; + invoiceDate?: string; + dueDate?: string; + memo?: string; + customer: WaveCustomer; + currency: { code: string }; + amountDue: { value: number; currency: { code: string } }; + amountPaid: { value: number; currency: { code: string } }; + taxTotal: { value: number; currency: { code: string } }; + subtotal: { value: number; currency: { code: string } }; + total: { value: number; currency: { code: string } }; + items: WaveInvoiceItem[]; + createdAt: string; + modifiedAt: string; +} + +export interface WaveAccount extends JsonObject { + id: string; + name: string; + description?: string; + displayId: string; + type: { name: string; value: string; normalBalanceType: string }; + subtype: { name: string; value: string }; + currency: { code: string }; + isArchived: boolean; + sequence: number; + normalBalanceType: string; +} + +export interface WaveTransaction extends JsonObject { + id: string; + description?: string; + notes?: string; + anchor: { + account: { id: string; name: string }; + amount: { value: number; currency: { code: string } }; + direction: string; + }; + lineItems: Array<{ + account: { id: string; name: string }; + amount: { value: number; currency: { code: string } }; + description?: string; + balance?: string; + }>; + createdAt: string; + modifiedAt: string; +}