Skip to content

gRPC API Reference

Overview

Thuộc tínhGiá trị
Proto fileserver/proto/mymo/v1/mymo.proto
Services7
Total RPCs23
TransportgRPC-Web qua HTTP/1.1
AuthJWT Bearer token (trừ AuthService)

AuthService

Public Service

AuthService không yêu cầu JWT token.

RPCRequestResponseMô tả
Validate{key: string}{token: string, email: string}Xác thực license key

ConfigService

RPCRequestResponseMô tả
GetConfig{}{config?: UserConfig}Lấy config hiện tại
UpsertConfig{currency?: string}{}Tạo/cập nhật config
UpdateCash{delta: int64}{}Cộng/trừ tổng tài sản
DeleteConfig{}{}Xóa config (reset onboarding)

CategoryService

RPCRequestResponseMô tả
ListCategories{}{categories: Category[]}Danh sách tất cả danh mục
CreateCategory{name: string, tier: int32}{id: int64}Tạo danh mục mới
StandardizeCategories{existingCategories: [{name, tier}]}{}AI chuẩn hóa tên

TransactionService

RPCRequestResponseMô tả
ListTransactions{limit: int64}{transactions: Transaction[]}Giao dịch gần nhất
CreateTransaction{amount: int64, date: string, categoryId: int64, note: string}{}Tạo giao dịch
UpdateTransaction{id: int64, amount: int64, date: string, categoryId: int64, note: string}{}Cập nhật
DeleteTransaction{id: int64}{}Xóa
GetMonthTransactions{year: int32, month: int32}{transactions: TransactionWithCategory[]}Theo tháng
GetMonthTierTotals{year: int32, month: int32}{tierTotals: [{tier, total}]}Tổng tier/tháng

RecurringService

RPCRequestResponseMô tả
ListRecurring{}{recurring: RecurringExpense[]}Danh sách
CreateRecurring{name, amount: int64, frequency, dayOfMonth?: int64, categoryId?: int64}{}Tạo
UpdateRecurring{id: int64, name?, amount?, frequency?, dayOfMonth?, categoryId?}{}Cập nhật
DeleteRecurring{id: int64}{}Xóa
CatchupRecurring{}{}Tạo transactions cho quá hạn

OnboardingService

RPCRequestResponseMô tả
Onboard{recurring: [], oneTime: [], totalCash: int64}{}Setup ban đầu

AiService

RPCRequestResponseMô tả
ParseSpend{text: string}{amount: int64, name: string, categoryId?: int64}Parse 1 khoản chi
ParseSpending{text: string}{items: ParsedItem[]}Parse nhiều khoản
ParseIncome{text: string}{amount: int64, note: string}Parse khoản thu

Type Conversion

int64 / bigint

Proto int64 → TypeScript bigint. Composables phải convert:

ts
// Đọc: bigint → number
const cash = Number(res.config.totalCash)

// Ghi: number → bigint
await client.updateCash({ delta: BigInt(amount) })

Proto fields dùng camelCase (totalCash), composables map sang snake_case (total_cash).