Skip to content

A local-first personal finance app

[AI] Correct API docs to match actual implementation (#7096)

Tifan Dwi Aviantod30162672c85
diff --git a/packages/docs/docs/api/reference.md b/packages/docs/docs/api/reference.md
index f97a6abcd8..072c74afce 100644
--- a/packages/docs/docs/api/reference.md
+++ b/packages/docs/docs/api/reference.md
@@ -120,6 +120,8 @@ Fields specific to a type of request are marked as such in the notes.
All `update` and `delete` methods take an `id` to specify the desired object. `update` takes the fields to update as a second argument — it does not take a full object. That means even if a field is required, you don't have to pass it to `update`. For example, a `category` requires the `group_id` field, however `updateCategory(id, { name: "Food" })` is a valid call. Required means that an `update` can't set the field to `null` and a `create` must always contain the field.
+**Note:** `updateRule` is an exception — it requires the full [`Rule`](#rule) object including `id`, and returns `Promise<Rule>`.
+
## Primitives
These are types.
@@ -471,6 +473,12 @@ Each account has a corresponding "transfer payee" already created in the system.
Get all payees.
+#### `getCommonPayees`
+
+<Method name="getCommonPayees" args={[]} returns="Promise<Payee[]>" />
+
+Get common payees that appear frequently in transactions.
+
#### `createPayee`
<Method name="createPayee" args={[{ name: 'payee', type: 'Payee' }]} returns="Promise<id>" />
@@ -572,9 +580,9 @@ Get all rules.
#### `getPayeeRules`
-<Method name="getPayeeRules" args={[{ name: 'payeeId', type: "id" }]} returns="Promise<PayeeRule[]>" />
+<Method name="getPayeeRules" args={[{ name: 'payeeId', type: "id" }]} returns="Promise<Rule[]>" />
-Get all payee rules for `payeeId`.
+Get all rules associated with `payeeId`.
#### `createRule`
@@ -584,9 +592,9 @@ Create a rule. Returns the new rule, including the `id`.
#### `updateRule`
-<Method name="updateRule" args={[{ name: 'id', type: 'id' }, { name: 'fields', type: 'object' }]} returns="Promise<Rule>" />
+<Method name="updateRule" args={[{ name: 'rule', type: 'Rule' }]} returns="Promise<Rule>" />
-Update fields of a rule. `fields` can specify any field described in [`Rule`](#rule). Returns the updated rule.
+Update a rule. Unlike other update methods, this requires the full rule object including `id`. Returns the updated rule.
#### `deleteRule`
@@ -637,7 +645,7 @@ Get all schedules. Returns an array of [`Schedule`](#schedule) objects.
#### `createSchedule`
-<Method name="createSchedule" args={[{ properties: [{ name: 'schedule', type: 'Schedule' }] }]} returns="Promise<id>" />
+<Method name="createSchedule" args={[{ name: 'schedule', type: 'Schedule' }]} returns="Promise<id>" />
Create schedule based on information filled in the schedule object. Please refer to notes of schedule object for details each field.
@@ -665,9 +673,9 @@ Update fields of a rule. `fields` can specify any field described in [`Schedule`
#### `init`
-<Method name="init" args={[{ properties: [{ name: 'config', type: 'InitConfig' }] }]} returns="Promise<void>" />
+<Method name="init" args={[{ name: 'config', type: 'InitConfig?' }]} returns="Promise<void>" />
-Initializes the API by connecting to an Actual Budget server.
+Initializes the API by connecting to an Actual Budget server. The config parameter is optional and defaults to `{}` (local-only mode).
#### `shutdown`
@@ -689,7 +697,7 @@ Run the 3rd party (GoCardless, SimpleFIN) bank sync operation. This will downloa
#### `runImport`
-<Method name="runImport" args={[{ properties: [{ name: 'budgetName', type: 'string' }, { name: 'func', type: 'func' }] }]} returns="Promise<void>" />
+<Method name="runImport" args={[{ name: 'budgetName', type: 'string' }, { name: 'func', type: 'func' }]} returns="Promise<void>" />
Creates a new budget file with the given name, and then runs the custom importer function to populate it with data.
@@ -713,7 +721,7 @@ Load a budget file. If the file exists locally, it will load from there. Otherwi
#### `batchBudgetUpdates`
-<Method name="batchBudgetUpdates" args={[{ properties: [{ name: 'func', type: 'func' }] }]} returns="Promise<void>" />
+<Method name="batchBudgetUpdates" args={[{ name: 'func', type: 'func' }]} returns="Promise<void>" />
Performs a batch of budget updates. This is useful for making multiple changes to the budget in a single call to the server.
diff --git a/upcoming-release-notes/7096.md b/upcoming-release-notes/7096.md
new file mode 100644
index 0000000000..18517a3656
--- /dev/null
+++ b/upcoming-release-notes/7096.md
@@ -0,0 +1,6 @@
+---
+category: Maintenance
+authors: [tifandotme]
+---
+
+Fix API reference documentation discrepancies