@officedesk/plugin-xero 0.0.2 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +113 -34
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -1,66 +1,137 @@
1
- # plugin-xero
1
+ # @officedesk/plugin-xero
2
2
 
3
- Xero accounting integration for OfficeDesk AI.
3
+ Xero accounting integration plugin for [OfficeDesk AI](https://github.com/initdsg/officedesk.ai). Manages contacts, invoices, bills, accounts, bank transactions, and reconciliation via the Xero API.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install -g @officedesk/plugin-xero
9
+ ```
4
10
 
5
11
  ## Setup
6
12
 
7
- Sign in to Xero with the plugin OAuth flow first:
13
+ Sign in to Xero via the browser OAuth flow:
14
+
15
+ ```bash
16
+ officedesk-plugin-xero login
17
+ ```
18
+
19
+ If you need exact statement-line reconciliation, also capture the browser-authenticated Xero session:
8
20
 
9
21
  ```bash
10
- pnpm xero:login
22
+ officedesk-plugin-xero browser-login
11
23
  ```
12
24
 
13
- If you need exact statement-line reconciliation, also capture the browser-authenticated Xero session that the bank reconciliation API expects:
25
+ If Playwright is installed but Chromium is missing:
14
26
 
15
27
  ```bash
16
- pnpm xero:browser-login
28
+ npx playwright install chromium
29
+ ```
30
+
31
+ ## CLI reference
32
+
33
+ ```
34
+ officedesk-plugin-xero <command> [options]
17
35
  ```
18
36
 
19
- If Playwright is installed but Chromium is missing, install it with:
37
+ ### `login`
38
+
39
+ Authenticate with Xero via the browser OAuth flow.
20
40
 
21
41
  ```bash
22
- pnpm --filter @officedesk/plugin-xero exec playwright install chromium
42
+ officedesk-plugin-xero login
23
43
  ```
24
44
 
25
- ## Statement line discovery
45
+ ### `browser-login`
46
+
47
+ Capture a browser-authenticated Xero session for bank reconciliation.
26
48
 
27
- The compiled plugin binary now supports `get-bank-statement-lines`, which returns imported bank statement lines together with `statementLineId`, `bankStatementId`, and `bankAccountId` values.
49
+ ```bash
50
+ officedesk-plugin-xero browser-login
51
+ ```
28
52
 
29
- Repo root wrapper:
53
+ ### `get-accounts`
30
54
 
31
55
  ```bash
32
- pnpm xero:get-bank-statement-lines -- --bankAccountId=<BANK_ACCOUNT_ID>
56
+ officedesk-plugin-xero get-accounts
33
57
  ```
34
58
 
35
- Compiled binary form:
59
+ ### `get-contacts` / `get-contact` / `create-contact` / `update-contact`
36
60
 
37
61
  ```bash
38
- officedesk plugin-xero get-bank-statement-lines --bankAccountId=<BANK_ACCOUNT_ID>
62
+ officedesk-plugin-xero get-contacts
63
+ officedesk-plugin-xero get-contact --id=CONTACT_ID
64
+ officedesk-plugin-xero create-contact --name="Acme Ltd" --email="ops@acme.com"
65
+ officedesk-plugin-xero update-contact --id=CONTACT_ID --name="Acme Pte Ltd"
39
66
  ```
40
67
 
41
- Supported options:
68
+ ### `get-tax-rates`
42
69
 
43
- - `--bankAccountId=ID`
44
- - `--tenantId=ID`
45
- - `--status=STATUS` defaults to `unreconciled`
46
- - `--limit=N` defaults to `50`
47
- - `--offset=N` defaults to `0`
48
- - `--output=PATH` to override the cache output path
70
+ ```bash
71
+ officedesk-plugin-xero get-tax-rates
72
+ ```
49
73
 
50
- The CLI writes structured JSON to `stdout` and stores the fetched payload in the plugin cache by default.
74
+ ### `get-branding-themes`
51
75
 
52
- After you capture the browser session once, `get-bank-statement-lines` reuses the saved Xero auth data directly and does not need to launch a Playwright browser for each fetch.
76
+ ```bash
77
+ officedesk-plugin-xero get-branding-themes
78
+ ```
53
79
 
54
- ## Exact reconciliation flow
80
+ ### `draft-invoice` / `update-invoice` / `authorise-invoice` / `send-invoice` / `delete-invoice`
55
81
 
56
- 1. Create or identify the bank transaction you want to reconcile.
57
- 2. List imported statement lines and find the matching `statementLineId` and `bankStatementId`.
58
- 3. Reconcile against that exact line.
82
+ ```bash
83
+ officedesk-plugin-xero draft-invoice --contact-id=CONTACT_ID --amount=150.00
84
+ officedesk-plugin-xero update-invoice --id=INVOICE_ID --amount=200.00
85
+ officedesk-plugin-xero authorise-invoice --id=INVOICE_ID
86
+ officedesk-plugin-xero send-invoice --id=INVOICE_ID
87
+ officedesk-plugin-xero delete-invoice --id=INVOICE_ID
88
+ ```
59
89
 
60
- Example:
90
+ ### `list-invoice-attachments` / `download-invoice-pdf` / `download-invoice-attachment`
61
91
 
62
92
  ```bash
63
- officedesk plugin-xero reconcile \
93
+ officedesk-plugin-xero list-invoice-attachments --id=INVOICE_ID
94
+ officedesk-plugin-xero download-invoice-pdf --id=INVOICE_ID
95
+ officedesk-plugin-xero download-invoice-attachment --id=INVOICE_ID --attachment-id=ATTACHMENT_ID
96
+ ```
97
+
98
+ ### `draft-bill` / `get-bills` / `update-bill` / `submit-bill` / `authorise-bill` / `pay-bill` / `void-bill` / `delete-bill` / `attach-to-bill`
99
+
100
+ ```bash
101
+ officedesk-plugin-xero get-bills
102
+ officedesk-plugin-xero draft-bill --contact-id=CONTACT_ID --amount=500.00
103
+ officedesk-plugin-xero authorise-bill --id=BILL_ID
104
+ officedesk-plugin-xero pay-bill --id=BILL_ID --account-id=ACCOUNT_ID --date=2026-04-14 --amount=500.00
105
+ officedesk-plugin-xero attach-to-bill --id=BILL_ID --file=./invoice.pdf
106
+ ```
107
+
108
+ ### `get-bank-statement-lines`
109
+
110
+ Retrieve imported bank statement lines with `statementLineId`, `bankStatementId`, and `bankAccountId`.
111
+
112
+ ```bash
113
+ officedesk-plugin-xero get-bank-statement-lines --bankAccountId=<BANK_ACCOUNT_ID>
114
+ ```
115
+
116
+ **Options**
117
+
118
+ | Flag | Description |
119
+ |---|---|
120
+ | `--bankAccountId=ID` | **(Required)** Bank account ID |
121
+ | `--tenantId=ID` | Tenant ID override |
122
+ | `--status=STATUS` | Line status (default: `unreconciled`) |
123
+ | `--limit=N` | Maximum results (default: `50`) |
124
+ | `--offset=N` | Pagination offset (default: `0`) |
125
+ | `--output=PATH` | Override the cache output path |
126
+
127
+ After you capture the browser session once, `get-bank-statement-lines` reuses the saved Xero auth data and does not launch a browser for each fetch.
128
+
129
+ ### `reconcile`
130
+
131
+ Reconcile a bank transaction against a specific statement line.
132
+
133
+ ```bash
134
+ officedesk-plugin-xero reconcile \
64
135
  --type=SPEND \
65
136
  --contactId=<CONTACT_ID> \
66
137
  --accountCode=<ACCOUNT_CODE> \
@@ -75,10 +146,18 @@ officedesk plugin-xero reconcile \
75
146
 
76
147
  If the saved browser session is missing, the reconcile flow can prompt for `browser-login` or run it automatically with `--auto-login`.
77
148
 
78
- ## Binary build
149
+ ## Exact reconciliation flow
79
150
 
80
- Build the standalone plugin binary with:
151
+ 1. Create or identify the bank transaction you want to reconcile.
152
+ 2. Run `get-bank-statement-lines` to find the matching `statementLineId` and `bankStatementId`.
153
+ 3. Run `reconcile` against that exact line.
81
154
 
82
- ```bash
83
- pnpm --filter @officedesk/plugin-xero build:bin
84
- ```
155
+ ## Environment variables
156
+
157
+ | Variable | Description |
158
+ |---|---|
159
+ | `OFFICEDESK_HOME` | Base directory for tokens and config (default: `~/.officedesk/`) |
160
+
161
+ ## License
162
+
163
+ ISC
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@officedesk/plugin-xero",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "Xero accounting integration plugin for officedesk-ai",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -14,8 +14,8 @@
14
14
  "access": "public"
15
15
  },
16
16
  "optionalDependencies": {
17
- "@officedesk/plugin-xero-linux-x64": "0.0.2",
18
- "@officedesk/plugin-xero-win32-x64": "0.0.2"
17
+ "@officedesk/plugin-xero-linux-x64": "0.0.4",
18
+ "@officedesk/plugin-xero-win32-x64": "0.0.4"
19
19
  },
20
20
  "scripts": {
21
21
  "build": "tsc",
@@ -70,6 +70,6 @@
70
70
  "license": "ISC",
71
71
  "repository": {
72
72
  "type": "git",
73
- "url": "https://github.com/initdsg/officedesk.ai.git"
73
+ "url": "git+https://github.com/initdsg/officedesk.ai-cli.git"
74
74
  }
75
75
  }