e-arveldaja-mcp 0.16.0 → 0.17.0
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.
- package/CHANGELOG.md +37 -0
- package/CLAUDE.md +22 -6
- package/README.md +14 -7
- package/dist/accounting-defaults.d.ts +10 -0
- package/dist/accounting-defaults.d.ts.map +1 -1
- package/dist/accounting-defaults.js +10 -0
- package/dist/accounting-defaults.js.map +1 -1
- package/dist/api/base-resource.d.ts +10 -1
- package/dist/api/base-resource.d.ts.map +1 -1
- package/dist/api/base-resource.js +21 -0
- package/dist/api/base-resource.js.map +1 -1
- package/dist/api/purchase-invoices.api.d.ts +1 -4
- package/dist/api/purchase-invoices.api.d.ts.map +1 -1
- package/dist/api/purchase-invoices.api.js +0 -16
- package/dist/api/purchase-invoices.api.js.map +1 -1
- package/dist/api/sale-invoices.api.d.ts +1 -0
- package/dist/api/sale-invoices.api.d.ts.map +1 -1
- package/dist/api/sale-invoices.api.js +3 -0
- package/dist/api/sale-invoices.api.js.map +1 -1
- package/dist/audit-log.d.ts +27 -0
- package/dist/audit-log.d.ts.map +1 -1
- package/dist/audit-log.js +43 -4
- package/dist/audit-log.js.map +1 -1
- package/dist/config.d.ts +11 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +18 -1
- package/dist/config.js.map +1 -1
- package/dist/estonian-accounting-guidance.d.ts.map +1 -1
- package/dist/estonian-accounting-guidance.js +7 -5
- package/dist/estonian-accounting-guidance.js.map +1 -1
- package/dist/estonian-tax-rules.d.ts +10 -0
- package/dist/estonian-tax-rules.d.ts.map +1 -1
- package/dist/estonian-tax-rules.js +26 -7
- package/dist/estonian-tax-rules.js.map +1 -1
- package/dist/index.js +16 -9
- package/dist/index.js.map +1 -1
- package/dist/mcp-json.d.ts +20 -0
- package/dist/mcp-json.d.ts.map +1 -1
- package/dist/mcp-json.js +24 -0
- package/dist/mcp-json.js.map +1 -1
- package/dist/tool-response.d.ts +20 -0
- package/dist/tool-response.d.ts.map +1 -1
- package/dist/tool-response.js.map +1 -1
- package/dist/tools/account-balance.d.ts +1 -1
- package/dist/tools/account-balance.d.ts.map +1 -1
- package/dist/tools/account-balance.js +10 -10
- package/dist/tools/account-balance.js.map +1 -1
- package/dist/tools/accounting-inbox.d.ts.map +1 -1
- package/dist/tools/accounting-inbox.js +16 -4
- package/dist/tools/accounting-inbox.js.map +1 -1
- package/dist/tools/crud/clients.d.ts.map +1 -1
- package/dist/tools/crud/clients.js +55 -12
- package/dist/tools/crud/clients.js.map +1 -1
- package/dist/tools/crud/journals.d.ts.map +1 -1
- package/dist/tools/crud/journals.js +57 -11
- package/dist/tools/crud/journals.js.map +1 -1
- package/dist/tools/crud/products.d.ts.map +1 -1
- package/dist/tools/crud/products.js +42 -9
- package/dist/tools/crud/products.js.map +1 -1
- package/dist/tools/crud/purchase-invoices.d.ts.map +1 -1
- package/dist/tools/crud/purchase-invoices.js +45 -9
- package/dist/tools/crud/purchase-invoices.js.map +1 -1
- package/dist/tools/crud/sale-invoices.d.ts.map +1 -1
- package/dist/tools/crud/sale-invoices.js +56 -10
- package/dist/tools/crud/sale-invoices.js.map +1 -1
- package/dist/tools/crud/shared.d.ts +26 -0
- package/dist/tools/crud/shared.d.ts.map +1 -1
- package/dist/tools/crud/shared.js +20 -2
- package/dist/tools/crud/shared.js.map +1 -1
- package/dist/tools/crud/transactions.d.ts.map +1 -1
- package/dist/tools/crud/transactions.js +88 -21
- package/dist/tools/crud/transactions.js.map +1 -1
- package/dist/tools/document-attachments.d.ts +4 -0
- package/dist/tools/document-attachments.d.ts.map +1 -0
- package/dist/tools/document-attachments.js +107 -0
- package/dist/tools/document-attachments.js.map +1 -0
- package/dist/tools/estonian-tax.js +3 -3
- package/dist/tools/estonian-tax.js.map +1 -1
- package/dist/tools/lightyear-investments.d.ts.map +1 -1
- package/dist/tools/lightyear-investments.js +14 -7
- package/dist/tools/lightyear-investments.js.map +1 -1
- package/dist/tools/pdf-workflow.d.ts +6 -0
- package/dist/tools/pdf-workflow.d.ts.map +1 -1
- package/dist/tools/pdf-workflow.js +15 -25
- package/dist/tools/pdf-workflow.js.map +1 -1
- package/dist/tools/receipt-extraction.d.ts +4 -0
- package/dist/tools/receipt-extraction.d.ts.map +1 -1
- package/dist/tools/receipt-extraction.js.map +1 -1
- package/dist/tools/receipt-inbox-output.d.ts.map +1 -1
- package/dist/tools/receipt-inbox-output.js +6 -2
- package/dist/tools/receipt-inbox-output.js.map +1 -1
- package/dist/tools/receipt-inbox.d.ts +23 -2
- package/dist/tools/receipt-inbox.d.ts.map +1 -1
- package/dist/tools/receipt-inbox.js +91 -8
- package/dist/tools/receipt-inbox.js.map +1 -1
- package/dist/tools/reference-data-tools.d.ts.map +1 -1
- package/dist/tools/reference-data-tools.js +156 -3
- package/dist/tools/reference-data-tools.js.map +1 -1
- package/dist/tools/wise-import.d.ts.map +1 -1
- package/dist/tools/wise-import.js +15 -2
- package/dist/tools/wise-import.js.map +1 -1
- package/package.json +1 -1
- package/server.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,43 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.17.0] - 2026-06-17
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- **Source-document attachment on journals, transactions, and sale invoices** — the `document_user` upload/download/delete capability that previously existed only for purchase invoices is now available across all four document-capable resources via three entity-agnostic tools: `attach_document`, `get_document`, and `delete_document` (each takes `entity_type` ∈ purchase_invoice, sale_invoice, journal, transaction). Estonian RPS law requires a source document on every accounting entry — manual journals (accruals, depreciation, reclassifications, year-end adjustments) and directly-booked bank transactions (card payments, fees) are exactly the entries auditors scrutinise, and `find_missing_documents` already flagged the ones lacking a document but offered no way to attach one. The methods are hoisted onto `BaseResource` (keyed on `basePath`) so coverage is uniform, and `get_document` / `delete_document` also close the previously-unwired read-back and removal of purchase-invoice documents. `get_document` caps the inline base64 payload (~5 MB) and supports `metadata_only=true`, returning name + size instead of the blob for large scans so the MCP transport is not overwhelmed.
|
|
9
|
+
- **Edit and delete tools for reference data** — five new tools close the create-only gaps in the reference-data surface: `update_invoice_info` (company invoice settings — contact details, default template, invoice/balance email text and footer), `update_invoice_series` + `delete_invoice_series`, and `update_bank_account` + `delete_bank_account`. Previously these settings could be created and listed through the MCP server but only edited in the e-arveldaja web UI; a renamed bank account, a corrected IBAN/SWIFT, a changed default invoice series, or an updated invoice email template now all stay inside the agent workflow. The update tools are patch-style — pass only the fields to change — and reject an empty patch (or an id-only call) instead of issuing a no-op write. The underlying `readonly.api.ts` methods already existed and invalidate the cache on success.
|
|
10
|
+
- **Server-side filters for invoice lists** — `list_purchase_invoices` and `list_sale_invoices` now accept `date_from` / `date_to` (invoice date for purchases, revenue date for sales), `status` (PROJECT/CONFIRMED), `payment_status` (PAID/PARTIALLY_PAID/NOT_PAID), and `clients_id`. These map 1:1 to RIK API query parameters, so the API does both the filtering and the pagination — no client-side page-walking. A `list_purchase_invoices` query for "this quarter's unpaid invoices from supplier X" now fetches one narrow page instead of every invoice.
|
|
11
|
+
- **`type` (C/D) filter on `list_transactions`** — the transaction list gains the API's debit/credit `type` filter, joining the existing date / status / client filters.
|
|
12
|
+
- **`get_sale_invoice_xml`** — downloads the system-generated machine-readable e-invoice XML (base64) for a sales invoice via `GET /sale_invoices/{id}/xml`. This is the structured Estonian e-arve used for e-invoice exchange and archival, distinct from `get_sale_invoice_document` (the human-readable PDF). Closes the last sale-invoice document endpoint that had no MCP tool.
|
|
13
|
+
- **Full RIK API operation coverage** — four tools close the remaining CRUD gaps so every documented RIK e-Financials operation now has an MCP tool: `delete_client` and `delete_product` (hard delete of mistakenly-created master data — they fail if the record is referenced by invoices/transactions, with `deactivate_client`/`deactivate_product` remaining the soft-delete path for in-use records, and they round out the destructive cluster alongside `delete_bank_account` / `delete_invoice_series`); and `get_invoice_series` / `get_bank_account` (single-record reads of the two reference resources that previously had only a list tool). Excludes the operations e-arveldaja performs natively (KMD/VAT return, EMTA prepayment-account entries) and the deliberately metadata-scoped `update_transaction`.
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
- **`list_transactions` and `list_journals` narrow the fetch server-side** — these tools still apply their richer client-side filters (amount range, bank-ref substring, account dimension, operation type, document number), but now push the API-native subset (date range, and for transactions status/type/client) into the underlying request, so the cached full-table walk is only used when no server-side filter applies. Large ledgers querying a single month no longer page through the entire dataset just to filter it down.
|
|
17
|
+
- **`upload_invoice_document` replaced by `attach_document`** — the purchase-invoice-only upload tool is superseded by the entity-agnostic `attach_document` (use `entity_type="purchase_invoice"` for the same effect). The internal PDF/receipt booking flows are unaffected (they call the API layer directly). Default tool surface is now 133 (128 with Lightyear disabled).
|
|
18
|
+
|
|
19
|
+
### Changed (breaking — pre-1.0 public-contract consistency)
|
|
20
|
+
|
|
21
|
+
Ahead of a 1.0 semver commitment (which freezes tool names, parameter names, enum values, and response shapes), a contract-consistency pass reconciled the inconsistencies a multi-agent audit surfaced. These are breaking for callers of the affected tools:
|
|
22
|
+
|
|
23
|
+
- **Tool renames.** `restore_client` / `restore_product` → **`reactivate_client`** / **`reactivate_product`** (matches the RIK API `reactivate` verb and the tools' own descriptions).
|
|
24
|
+
- **Parameter renames.** Date-range filters are now uniformly **`date_from`** / **`date_to`** across `list_purchase_invoices`, `list_sale_invoices`, `list_transactions`, and `list_journals` (previously a mix of `start_date`/`end_date` and `effective_date_from`/`effective_date_to`). The client filter on `compute_account_balance` / `compute_client_debt` is now **`clients_id`** (was `client_id`; the echoed `entries[].client_id` is likewise `clients_id`). `save_auto_booking_rule` now takes **`liability_accounts_id`** / **`purchase_accounts_id`** (was singular); the persisted accounting-rules format is unchanged.
|
|
25
|
+
- **Unified mutation envelope.** Every single-record create/update/delete/confirm/invalidate/deactivate/reactivate/send tool now returns the same `{ ok, action, entity, id?, message, raw }` shape (`raw` carries the original API response); previously most returned the bare `{ code, messages, created_object_id? }`. Batch/aggregate tools, reads, importers, and document tools keep their own documented shapes.
|
|
26
|
+
- **Unified list envelope.** `list_transactions` / `list_journals` now always return the superset `{ current_page, total_pages, total_items, per_page, items, filtered_client_side, out_of_range }` regardless of whether a client-side filter is active (the server-only path sets `filtered_client_side: false`), instead of emitting different shapes per path.
|
|
27
|
+
- **Structured / typed audit tooling.** `list_audit_logs` returns JSON (`{ items, count, hint }`) instead of Markdown prose; `search_client` returns the `{ ok, action, entity, count, raw }` object envelope instead of a bare array; and `get_session_log`'s `entity_type` / `action` filters are now validated enums covering the full vocabulary the audit writer emits (typos are rejected instead of silently matching nothing).
|
|
28
|
+
- **`compute_account_balance` `account_id` clarified.** The description now states it expects the account database `id` from `list_accounts`, not the account code (e.g. 2110) — the handler always matched on `id`; the old wording was misleading. It now also accepts string ids.
|
|
29
|
+
- **`create_client` person-type now required.** `is_physical_entity` is now a required boolean (`true` = natural person, `false` = legal entity); the redundant `is_juridical_entity` input was removed and is derived as its complement. The RIK API rejects client creation without a person-type (`409 "Please choose if it is a natural or a juridical person."`), so requiring it converts an opaque upstream error into a clear validation error at call time. Legal entities still also require a registry `code`. (Verified end-to-end against the demo API.)
|
|
30
|
+
|
|
31
|
+
### Security
|
|
32
|
+
- **Untrusted-text wrapping extended to the remaining importer/document surfaces** — a multi-agent prompt-injection audit found a few externally-controlled strings that were echoed into MCP output without the `wrapUntrustedOcr` nonce boundary. Now wrapped: the free-text `reference`/`name` columns in `parse_lightyear_statement` and `parse_lightyear_capital_gains` (broker CSV), the `supplier_name` in `import_wise_transactions` invoice-fix candidates (Wise CSV), and the stored document filename returned by `get_document` (uploaded-document metadata). These join the already-wrapped OCR/receipt fields so no path relays attacker-supplied text to a downstream LLM as trusted instructions.
|
|
33
|
+
- **Stored API key id masked in `list_stored_credentials`** — the key id (the cleartext identifier component of the HMAC message, never the secret) is now masked (first/last few characters) before being emitted, so a stable tenant/account identifier is not relayed verbatim to a third-party LLM. `target`/`name`/`server`/`isDefault` still uniquely identify a block for `remove_stored_credentials`.
|
|
34
|
+
- **OCR `raw_text` capped before inlining** — `extract_pdf_invoice` and the receipt-batch output now truncate the OCR blob to a fixed character budget (~20k chars) with a `raw_text_truncated` / `raw_text_length` marker, so a pathological or maliciously oversized document cannot flood the consuming LLM's context. Booking uses the structured `extracted` fields, not the raw blob.
|
|
35
|
+
|
|
36
|
+
## [0.16.1] - 2026-06-16
|
|
37
|
+
|
|
38
|
+
### Changed
|
|
39
|
+
- **EMTA tax payments now default to the EMTA prepayment account** — bank transfers to the Estonian Tax and Customs Board (EMTA / Maksu- ja Tolliamet) are booked to the EMTA prepayment account (ettemaksukonto, account 1516) by default, instead of to a tax-expense account via "maks"/"tax" keyword matching. A transfer to EMTA is a top-up of the prepayment account (Debit 1516 / Credit bank); the tax-expense entries that draw it down are created by e-arveldaja itself from the EMTA prepayment-account statement (Aruandlus → EMTA ettemaksukonto kanded), not from the bank payment. The `tax_payments` transaction classification (review-only — never auto-booked) now fixes the suggested contra account to the EMTA prepayment account and suggests no purchase article. This is a hard default that takes precedence over supplier history and saved auto-booking rules, so a past mis-booking for the same counterparty cannot silently re-route the payment. The account is resolved by exact id first, then a constrained name match (asset-typed, EMTA-named `ettemaksukonto`, never a clearing or liability account); when it cannot be located, no account id is emitted and the suggestion carries a "could not locate the EMTA prepayment account" note. The `tax_payments` review guidance text is aligned to match (new `EMTA_PREPAYMENT_ACCOUNT` constant; validated by an adversarial code review).
|
|
40
|
+
- **Unified the expense VAT-restriction keyword detector** — the passenger-car and entertainment/hospitality keyword matching used for input-VAT deduction decisions now lives in a single `classifyExpenseForVat` in `src/estonian-tax-rules.ts`, consumed by `detectVatDeductionNotes` (`suggest_booking` tax_notes), `buildOwnerExpenseVatReviewGuidance` (receipt/owner-expense review), and `requiresOwnerExpenseVatReview` (`create_owner_expense_reimbursement`). Previously these were three near-duplicate regexes that could drift apart; the shared detector uses the union of their keywords, so detection is slightly broader (e.g. catering, meelelahutus, banquet, inflected accommodation). The `KMS § 30` note now also states the deductible business-trip (lähetus) accommodation exception. (The separate food/representation keyword lists used for purchase-article suggestion are a different concern and left unchanged.)
|
|
41
|
+
|
|
5
42
|
## [0.16.0] - 2026-06-16
|
|
6
43
|
|
|
7
44
|
### Added
|
package/CLAUDE.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# e-arveldaja MCP Server
|
|
2
2
|
|
|
3
3
|
TypeScript MCP server for the Estonian e-arveldaja (RIK e-Financials) REST API.
|
|
4
|
-
|
|
4
|
+
133 tools (128 with Lightyear disabled — see Tool exposure below), 15 workflow prompts, 15 resources across 12 modules. Supports multiple companies/accounts.
|
|
5
5
|
|
|
6
6
|
## Quick Start
|
|
7
7
|
|
|
@@ -79,7 +79,7 @@ optional feature group that can be dropped when unused (see
|
|
|
79
79
|
`lightyear_portfolio_summary`). Use when the company does not track
|
|
80
80
|
investments. Default: Lightyear is enabled.
|
|
81
81
|
|
|
82
|
-
The default surface is
|
|
82
|
+
The default surface is 133 tools; `DISABLE_LIGHTYEAR` drops it to 128. (The
|
|
83
83
|
former `prepare_accounting_inbox` / `run_accounting_inbox_dry_runs` tools were
|
|
84
84
|
exact aliases of `accounting_inbox` `mode="scan"` / `mode="dry_run"` and have
|
|
85
85
|
been removed — use `accounting_inbox` with the matching `mode`.)
|
|
@@ -104,8 +104,9 @@ OpenAPI spec: `GET /openapi.yaml` on the API server. HTML docs: `/api.html`.
|
|
|
104
104
|
- **Deliver sale invoice**: `PATCH /sale_invoices/{id}/deliver` (not `/send_einvoice`)
|
|
105
105
|
|
|
106
106
|
### Document endpoints
|
|
107
|
-
- **User-uploaded docs**: `GET/PUT/DELETE /{entity}/{id}/document_user` (PUT to upload, not POST)
|
|
108
|
-
- **System-generated sale invoice PDF**: `GET /sale_invoices/{id}/pdf_system`
|
|
107
|
+
- **User-uploaded docs**: `GET/PUT/DELETE /{entity}/{id}/document_user` (PUT to upload, not POST). Implemented generically on `BaseResource` (`getDocument`/`uploadDocument`/`deleteDocument`, keyed on `basePath`) and exposed by the entity-agnostic tools `attach_document` / `get_document` / `delete_document` (`entity_type` ∈ purchase_invoice, sale_invoice, journal, transaction) in `src/tools/document-attachments.ts`. RPS requires a source document on every entry, so manual journals and directly-booked bank transactions can carry one too — `find_missing_documents` flags those that don't.
|
|
108
|
+
- **System-generated sale invoice PDF**: `GET /sale_invoices/{id}/pdf_system` (tool `get_sale_invoice_document`)
|
|
109
|
+
- **System-generated sale invoice e-invoice XML**: `GET /sale_invoices/{id}/xml` (tool `get_sale_invoice_xml`) — the structured machine-readable e-arve, distinct from the human-readable PDF
|
|
109
110
|
|
|
110
111
|
### Transaction registration
|
|
111
112
|
- Body is a **top-level JSON array** of `TransactionsDistribution` objects (not wrapped in `{items: [...]}`)
|
|
@@ -244,7 +245,10 @@ fields with a per-call random nonce sandbox via `wrapUntrustedOcr` in
|
|
|
244
245
|
**Wrapped at MCP output:**
|
|
245
246
|
- Direct processing tools: `extract_pdf_invoice`, `parse_camt053`,
|
|
246
247
|
`import_camt053`, `process_receipt_batch`, `parse_lightyear_capital_gains`,
|
|
247
|
-
`import_wise_transactions`, etc.
|
|
248
|
+
`parse_lightyear_statement`, `import_wise_transactions`, etc.
|
|
249
|
+
- `get_document`: the stored/uploaded-document filename (`name`) — it is
|
|
250
|
+
user-supplied content, so it is wrapped in both the metadata-only and
|
|
251
|
+
full-payload branches.
|
|
248
252
|
- Review/analysis tools consuming imported data: `reconcile_transactions`,
|
|
249
253
|
`reconcile_inter_account_transfers`, `analyze_unconfirmed_transactions`,
|
|
250
254
|
`classify_unmatched_transactions`, `suggest_booking`,
|
|
@@ -256,6 +260,13 @@ fields with a per-call random nonce sandbox via `wrapUntrustedOcr` in
|
|
|
256
260
|
- Upstream API errors: `HttpError.upstream_detail` (forwarded to MCP via
|
|
257
261
|
`toolError`).
|
|
258
262
|
|
|
263
|
+
**Length cap on OCR blobs:** the OCR `raw_text` inlined by `extract_pdf_invoice`
|
|
264
|
+
and the receipt-batch output is truncated to `MAX_UNTRUSTED_TEXT_CHARS` (~20k
|
|
265
|
+
chars) via `capUntrustedText` before wrapping, with `raw_text_truncated` /
|
|
266
|
+
`raw_text_length` markers when cut — booking uses the structured `extracted`
|
|
267
|
+
fields, so a pathological/oversized document cannot flood the consuming LLM's
|
|
268
|
+
context.
|
|
269
|
+
|
|
259
270
|
**Intentionally NOT wrapped — conscious architectural decision:**
|
|
260
271
|
- Generic CRUD read handlers (`get_journal`, `list_journals`, `get_client`,
|
|
261
272
|
`list_clients`, `get_transaction`, `list_transactions`, `get_sale_invoice`,
|
|
@@ -291,6 +302,11 @@ API data remains raw.
|
|
|
291
302
|
- **Capital gains**: Securities taxed at 22% income tax
|
|
292
303
|
- **Input-VAT deduction restrictions** (`src/estonian-tax-rules.ts`): single date-gated source for the standard VAT-rate timeline (20→22%→24%), current reduced rates, and the deduction detectors. `suggest_booking` returns these as `tax_notes` — `KMS § 30` (külaliste vastuvõtt / esinduskulu: input VAT non-deductible; also `TuMS § 49 lg 4` representation limit 50 €/month + 2% of payroll) and `KMS § 30 lg 4` (M1 passenger car: 50% cap). Notes are advisory; `workflows/book-invoice.md` requires surfacing each on the approval card. `validate_invoice_data` also uses the rate timeline to warn when a line's standard rate (20/22/24%) does not match the invoice date. The full dataset is browsable read-only at `earveldaja://tax_rules` (also lists the `TuMS § 49` representation 50 €+2% and donation 3%/10% limits). `check_tax_free_limits` computes the cumulative `TuMS § 49` representation/donation limits and the 22/78 tax on any excess from caller-supplied year-to-date figures (it does not read the ledger). Update the figures in this module when the law changes.
|
|
293
304
|
|
|
305
|
+
**Non-goals — do NOT reimplement in MCP (e-arveldaja does these natively; reimplementing risks double-booking):**
|
|
306
|
+
- **No KMD/VAT return (käibedeklaratsioon)** — e-arveldaja generates it from the confirmed ledger and files it to EMTA. The tax-rules layer is advisory only.
|
|
307
|
+
- **No EMTA prepayment-account tax-expense entries** — a bank transfer to EMTA is booked as a prepayment-account (ettemaksukonto, acct 1516) top-up; the draw-down tax entries come from e-arveldaja's EMTA prepayment-account statement.
|
|
308
|
+
- **`update_transaction` is deliberately metadata-scoped** — bank-reference/description fields only; never amounts, postings, or distributions.
|
|
309
|
+
|
|
294
310
|
## Development
|
|
295
311
|
|
|
296
312
|
```bash
|
|
@@ -313,5 +329,5 @@ import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js"
|
|
|
313
329
|
const transport = new StdioClientTransport({ command: "node", args: ["dist/index.js"] });
|
|
314
330
|
const client = new Client({ name: "test", version: "1.0.0" });
|
|
315
331
|
await client.connect(transport);
|
|
316
|
-
const { tools } = await client.listTools(); //
|
|
332
|
+
const { tools } = await client.listTools(); // 133 tools
|
|
317
333
|
```
|
package/README.md
CHANGED
|
@@ -2,14 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/e-arveldaja-mcp)
|
|
4
4
|
|
|
5
|
-
MCP server for the Estonian e-arveldaja (RIK e-Financials) REST API.
|
|
5
|
+
MCP server for the Estonian e-arveldaja (RIK e-Financials) REST API. 133 tools, 15 workflow prompts, 13 resources. Works with any MCP client — Claude Code, Codex CLI, Gemini CLI, Cursor, Windsurf, Cline, and others.
|
|
6
6
|
|
|
7
|
-
> **
|
|
7
|
+
> **Safer CAMT re-imports.** `import_camt053` preserves CAMT bank-reference and counterparty-account metadata in the writable transaction description when the e-arveldaja API drops the dedicated fields. Long bank references are stored as stable hashes, marker-only prior imports still surface in duplicate review when the exact key does not match, and repeated CAMT imports are less likely to create duplicate PROJECT rows. See the [changelog](CHANGELOG.md) for full details.
|
|
8
8
|
>
|
|
9
|
-
> **Guided workflow actions.** `recommend_workflow` suggests the safest accounting flow for a natural-language goal, and key workflow/batch tools return a `workflow_action_v1` envelope with `recommended_next_action`, review questions, and approval previews. `accounting_inbox` is the preferred merged entry point for workspace triage, `continue_accounting_workflow` is the preferred merged continuation tool, `receipt_batch` and `process_camt053` are the preferred mode-based import/batch entry points, and bank work has `reconcile_bank_transactions` plus `classify_bank_transactions` as mode-based entry points. Older focused tools such as `
|
|
9
|
+
> **Guided workflow actions.** `recommend_workflow` suggests the safest accounting flow for a natural-language goal, and key workflow/batch tools return a `workflow_action_v1` envelope with `recommended_next_action`, review questions, and approval previews. `accounting_inbox` is the preferred merged entry point for workspace triage, `continue_accounting_workflow` is the preferred merged continuation tool, `receipt_batch` and `process_camt053` are the preferred mode-based import/batch entry points, and bank work has `reconcile_bank_transactions` plus `classify_bank_transactions` as mode-based entry points. Older focused tools such as `resolve_accounting_review_item`, `prepare_accounting_review_action`, `scan_receipt_folder`, `process_receipt_batch`, `parse_camt053`, `import_camt053`, `reconcile_transactions`, and `apply_transaction_classifications` remain available as compatibility primitives. See the [changelog](CHANGELOG.md) for full details.
|
|
10
10
|
>
|
|
11
|
-
> **v0.10.0 is a major update.** Large parts of the codebase have been rewritten — credential management, bank reconciliation, audit logging, and batch workflows all received significant changes. **You may need to re-add your API credentials** after updating, as the credential storage has moved from reading `apikey*.txt` directly to `.env` files. Your existing `apikey*.txt` files will be detected automatically and the server will offer to import them on first start.
|
|
12
|
-
|
|
13
11
|
> **Active development.** This package is under active development and has not seen extensive real-world testing yet. If you encounter a bug or unexpected behaviour, please let me know via [GitHub Issues](https://github.com/iseppo/e-arveldaja-mcp/issues) or email at indrek.seppo@gmail.com.
|
|
14
12
|
|
|
15
13
|
## Disclaimer
|
|
@@ -340,11 +338,12 @@ curl "https://registry.modelcontextprotocol.io/v0.1/servers?search=io.github.ise
|
|
|
340
338
|
## Good to know
|
|
341
339
|
|
|
342
340
|
- **Dry run by default.** Batch operations (bank import, Wise import, Lightyear booking, receipt processing, auto-confirm) preview results first. You must explicitly confirm before mutating records. Receipt batches use `execution_mode="create"` to create/upload unconfirmed PROJECT invoices; confirmation is a separate approval step.
|
|
341
|
+
- **Source documents on every entry.** Attach, download, or delete the source document (PDF/JPG/PNG) on any purchase invoice, sale invoice, manual journal, or bank transaction with `attach_document` / `get_document` / `delete_document`; `find_missing_documents` flags entries that lack one (Estonian RPS law requires a source document on every accounting entry).
|
|
343
342
|
- **Accounting choices prefer evidence.** For purchase booking, the server prefers treatment from similar confirmed supplier invoices. If that history is missing, it can use `accounting-rules.md`. For unmatched bank-transaction auto-booking, it no longer invents VAT treatment from weak heuristics alone.
|
|
344
343
|
- **Large datasets need date filters.** The server loads up to 200 pages of data per query. Companies with thousands of invoices or transactions should narrow reporting and reconciliation tools with date ranges — otherwise the tool will ask you to.
|
|
345
344
|
- **Caching.** API responses are cached for 2–5 minutes and reference data for up to 10 minutes. The server automatically invalidates caches when you create, update, or delete records through MCP tools. Changes made directly in the e-arveldaja web UI are not visible until the cache expires; call `clear_cache` or pass `fresh: true` to balance/reporting tools when you need the next read to fetch current upstream data.
|
|
346
345
|
- **EUR by default.** All amounts are EUR unless a different currency is specified.
|
|
347
|
-
- **Multi-company.** Place multiple `apikey*.txt` files and use `list_connections` / `switch_connection`. Switching clears
|
|
346
|
+
- **Multi-company.** Place multiple `apikey*.txt` files and use `list_connections` / `switch_connection`. Switching clears the previous and target connections' cached data, so one company's records are never served to another.
|
|
348
347
|
- **Node.js 18+** required.
|
|
349
348
|
- **File access scope.** By default, file-reading tools can access supported files under the working directory and `/tmp`. Set `EARVELDAJA_ALLOWED_PATHS` (colon-separated) to allow additional directories, or `EARVELDAJA_ALLOW_HOME=true` to allow the entire home directory.
|
|
350
349
|
- **Human-editable local accounting rules.** `accounting-rules.md` lets you store company-specific booking defaults and annual-report overrides in Markdown instead of code or JSON.
|
|
@@ -354,9 +353,17 @@ curl "https://registry.modelcontextprotocol.io/v0.1/servers?search=io.github.ise
|
|
|
354
353
|
- **OCR text is sandboxed.** Raw OCR output from PDFs and images (`raw_text`, receipt-line `description`) is wrapped in per-call nonce delimiters (`<<UNTRUSTED_OCR_START:{nonce}>>` / `<<UNTRUSTED_OCR_END:{nonce}>>`) before being returned to the LLM, so a scanned receipt cannot smuggle tool-call instructions into your agent's context.
|
|
355
354
|
- **Cross-system file input.** When the MCP server runs on a different host from your client (e.g. Claude desktop, Cowork, Cursor, or a remote container), file-reading tools also accept a `file_path` of the form `base64:<b64data>` (for PDF / PNG / JPEG / CAMT XML) or `base64:<ext>:<b64data>` (e.g. `base64:csv:QSxCLEMK...`) so files on the client side no longer need to exist on the server's filesystem.
|
|
356
355
|
|
|
356
|
+
## Non-goals (handled natively by e-arveldaja)
|
|
357
|
+
|
|
358
|
+
A few things are deliberately out of scope, because e-arveldaja already does them and duplicating them in the MCP layer would risk double-booking:
|
|
359
|
+
|
|
360
|
+
- **No VAT/KMD return (käibedeklaratsioon).** e-arveldaja generates the KMD natively from the confirmed ledger and files it to EMTA. The server's tax-rules layer (`earveldaja://tax_rules`) is advisory only — it informs booking decisions, it does not produce or file returns.
|
|
361
|
+
- **No EMTA prepayment-account tax entries.** A bank transfer to EMTA (Maksu- ja Tolliamet) is booked as a prepayment-account top-up (Debit *ettemaksukonto* / Credit bank); the tax-expense entries that draw it down are created by e-arveldaja from its EMTA prepayment-account statement, not by this server.
|
|
362
|
+
- **`update_transaction` is metadata-scoped.** It edits only transaction metadata (bank reference and description fields); it never changes amounts, postings, or distributions. Use the reconcile/booking tools for those.
|
|
363
|
+
|
|
357
364
|
## Privacy
|
|
358
365
|
|
|
359
|
-
Document parsing (PDF, JPG, PNG) uses LiteParse OCR locally by default. If you set `EARVELDAJA_LITEPARSE_OCR_SERVER_URL`, the server will send documents to that configured OCR endpoint instead of staying fully local for OCR. Remote OCR endpoints must use `https`; plain `http` is only accepted for localhost / loopback OCR services. By default, the server may also read supported document files
|
|
366
|
+
Document parsing (PDF, JPG, PNG) uses LiteParse OCR locally by default. If you set `EARVELDAJA_LITEPARSE_OCR_SERVER_URL`, the server will send documents to that configured OCR endpoint instead of staying fully local for OCR. Remote OCR endpoints must use `https`; plain `http` is only accepted for localhost / loopback OCR services. By default, the server may also read supported document files under the working directory and `/tmp`; set `EARVELDAJA_ALLOW_HOME=true` to also include your whole home directory, or `EARVELDAJA_ALLOWED_PATHS` (colon-separated) for an explicit allowlist. In all cases, the extracted text is returned to your AI assistant via the MCP protocol, so it will be processed by whichever LLM you are using (Claude, Codex, Gemini, etc.). The server's own outbound connections are therefore limited to the e-arveldaja API (`rmp-api.rik.ee`), optionally the Estonian Business Registry (`ariregister.rik.ee`) for supplier lookups, and optionally your configured OCR server.
|
|
360
367
|
|
|
361
368
|
## Feedback and Bug Reports
|
|
362
369
|
|
|
@@ -13,6 +13,16 @@ export declare const RETAINED_EARNINGS_ACCOUNT = 3020;
|
|
|
13
13
|
export declare const DIVIDEND_PAYABLE_ACCOUNT = 2370;
|
|
14
14
|
/** Corporate income tax payable (Tulumaksu kohustus) */
|
|
15
15
|
export declare const CIT_PAYABLE_ACCOUNT = 2540;
|
|
16
|
+
/**
|
|
17
|
+
* EMTA prepayment account (EMTA ettemaksukonto) — the single tax-authority
|
|
18
|
+
* prepayment account all taxes are drawn from (post-2021). A bank transfer to
|
|
19
|
+
* EMTA is a top-up of this asset account (Debit 1516 / Credit bank); the
|
|
20
|
+
* tax-expense entries that draw it down are created by e-arveldaja itself from
|
|
21
|
+
* the EMTA prepayment-account statement (Aruandlus → EMTA ettemaksukonto kanded),
|
|
22
|
+
* not from the bank payment. So tax-payment transfers default their contra
|
|
23
|
+
* account here, never to a tax-expense account or a purchase invoice.
|
|
24
|
+
*/
|
|
25
|
+
export declare const EMTA_PREPAYMENT_ACCOUNT = 1516;
|
|
16
26
|
/** Share capital (Osakapital) */
|
|
17
27
|
export declare const SHARE_CAPITAL_ACCOUNT = 3000;
|
|
18
28
|
/** Current year profit/loss (Aruandeaasta kasum/kahjum) */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accounting-defaults.d.ts","sourceRoot":"","sources":["../src/accounting-defaults.ts"],"names":[],"mappings":"AAAA,iFAAiF;AAEjF,6CAA6C;AAC7C,eAAO,MAAM,yBAAyB,OAAO,CAAC;AAE9C,kCAAkC;AAClC,eAAO,MAAM,mBAAmB,OAAO,CAAC;AAExC,wCAAwC;AACxC,eAAO,MAAM,6BAA6B,OAAO,CAAC;AAElD,wDAAwD;AACxD,eAAO,MAAM,2BAA2B,OAAO,CAAC;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BAAuB,OAAO,CAAC;AAE5C,yDAAyD;AACzD,eAAO,MAAM,uBAAuB,OAAO,CAAC;AAE5C,0DAA0D;AAC1D,eAAO,MAAM,2BAA2B,UAA0F,CAAC"}
|
|
@@ -13,6 +13,16 @@ export const RETAINED_EARNINGS_ACCOUNT = 3020;
|
|
|
13
13
|
export const DIVIDEND_PAYABLE_ACCOUNT = 2370;
|
|
14
14
|
/** Corporate income tax payable (Tulumaksu kohustus) */
|
|
15
15
|
export const CIT_PAYABLE_ACCOUNT = 2540;
|
|
16
|
+
/**
|
|
17
|
+
* EMTA prepayment account (EMTA ettemaksukonto) — the single tax-authority
|
|
18
|
+
* prepayment account all taxes are drawn from (post-2021). A bank transfer to
|
|
19
|
+
* EMTA is a top-up of this asset account (Debit 1516 / Credit bank); the
|
|
20
|
+
* tax-expense entries that draw it down are created by e-arveldaja itself from
|
|
21
|
+
* the EMTA prepayment-account statement (Aruandlus → EMTA ettemaksukonto kanded),
|
|
22
|
+
* not from the bank payment. So tax-payment transfers default their contra
|
|
23
|
+
* account here, never to a tax-expense account or a purchase invoice.
|
|
24
|
+
*/
|
|
25
|
+
export const EMTA_PREPAYMENT_ACCOUNT = 1516;
|
|
16
26
|
/** Share capital (Osakapital) */
|
|
17
27
|
export const SHARE_CAPITAL_ACCOUNT = 3000;
|
|
18
28
|
/** Current year profit/loss (Aruandeaasta kasum/kahjum) */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accounting-defaults.js","sourceRoot":"","sources":["../src/accounting-defaults.ts"],"names":[],"mappings":"AAAA,iFAAiF;AAEjF,6CAA6C;AAC7C,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,CAAC;AAE9C,kCAAkC;AAClC,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC;AAExC,wCAAwC;AACxC,MAAM,CAAC,MAAM,6BAA6B,GAAG,IAAI,CAAC;AAElD,wDAAwD;AACxD,MAAM,CAAC,MAAM,2BAA2B,GAAG,I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GAQG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAC;AAE5C,iCAAiC;AACjC,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,CAAC;AAE1C,2DAA2D;AAC3D,MAAM,CAAC,MAAM,2BAA2B,GAAG,IAAI,CAAC;AAEhD,mDAAmD;AACnD,MAAM,CAAC,MAAM,uCAAuC,GAAG,IAAI,CAAC;AAE5D,wDAAwD;AACxD,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAC;AAE5C,yDAAyD;AACzD,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAC;AAE5C,0DAA0D;AAC1D,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,6BAA6B,EAAE,yBAAyB,EAAE,2BAA2B,CAAC,CAAC"}
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import type { HttpClient } from "../http-client.js";
|
|
2
|
-
import type { ApiResponse, PaginatedResponse } from "../types/api.js";
|
|
2
|
+
import type { ApiFile, ApiResponse, PaginatedResponse } from "../types/api.js";
|
|
3
3
|
import { Cache } from "../cache.js";
|
|
4
4
|
export declare const cache: Cache;
|
|
5
5
|
export interface ListParams {
|
|
6
6
|
page?: number;
|
|
7
7
|
modified_since?: string;
|
|
8
|
+
start_date?: string;
|
|
9
|
+
end_date?: string;
|
|
10
|
+
status?: string;
|
|
11
|
+
payment_status?: string;
|
|
12
|
+
clients_id?: number;
|
|
13
|
+
type?: string;
|
|
8
14
|
}
|
|
9
15
|
export declare class BaseResource<T> {
|
|
10
16
|
protected client: HttpClient;
|
|
@@ -36,5 +42,8 @@ export declare class BaseResource<T> {
|
|
|
36
42
|
create(data: Partial<T>): Promise<ApiResponse>;
|
|
37
43
|
update(id: number, data: Partial<T>): Promise<ApiResponse>;
|
|
38
44
|
delete(id: number): Promise<ApiResponse>;
|
|
45
|
+
getDocument(id: number): Promise<ApiFile>;
|
|
46
|
+
uploadDocument(id: number, name: string, contents: string): Promise<ApiResponse>;
|
|
47
|
+
deleteDocument(id: number): Promise<ApiResponse>;
|
|
39
48
|
}
|
|
40
49
|
//# sourceMappingURL=base-resource.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-resource.d.ts","sourceRoot":"","sources":["../../src/api/base-resource.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"base-resource.d.ts","sourceRoot":"","sources":["../../src/api/base-resource.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAC/E,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAIpC,eAAO,MAAM,KAAK,OAAiB,CAAC;AAEpC,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,MAAM,CAAC;IAQxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,qBAAa,YAAY,CAAC,CAAC;IAEvB,SAAS,CAAC,MAAM,EAAE,UAAU;IAC5B,SAAS,CAAC,QAAQ,EAAE,MAAM;gBADhB,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,MAAM;IAG5B,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAIvC,SAAS,CAAC,eAAe,CAAC,OAAO,SAAgB,GAAG,IAAI;IAIlD,IAAI,CAAC,MAAM,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC;IAY9D;;;;;;;;;;;;;;;;OAgBG;IACG,aAAa,CAAC,UAAU,SAAK,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC;IAU5C,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,EAAE,QAAQ,SAAM,EAAE,QAAQ,SAAS,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC;IAwC3F,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;IAW3B,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC;IAM9C,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC;IAM1D,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAYxC,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAIzC,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAShF,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;CAOvD"}
|
|
@@ -109,5 +109,26 @@ export class BaseResource {
|
|
|
109
109
|
this.invalidateCache();
|
|
110
110
|
return result;
|
|
111
111
|
}
|
|
112
|
+
// === User-uploaded source document (document_user) ===
|
|
113
|
+
// Supported by purchase_invoices, sale_invoices, journals, and transactions
|
|
114
|
+
// (PUT to upload/replace, GET to read back, DELETE to remove). Calling these
|
|
115
|
+
// on a resource whose API has no /{id}/document_user endpoint returns a 404 —
|
|
116
|
+
// only the document-capable resources are wired to tools.
|
|
117
|
+
async getDocument(id) {
|
|
118
|
+
return this.client.get(`${this.basePath}/${id}/document_user`);
|
|
119
|
+
}
|
|
120
|
+
async uploadDocument(id, name, contents) {
|
|
121
|
+
const result = await this.client.request(`${this.basePath}/${id}/document_user`, {
|
|
122
|
+
method: "PUT",
|
|
123
|
+
body: { name, contents },
|
|
124
|
+
});
|
|
125
|
+
this.invalidateCache();
|
|
126
|
+
return result;
|
|
127
|
+
}
|
|
128
|
+
async deleteDocument(id) {
|
|
129
|
+
const result = await this.client.delete(`${this.basePath}/${id}/document_user`);
|
|
130
|
+
this.invalidateCache();
|
|
131
|
+
return result;
|
|
132
|
+
}
|
|
112
133
|
}
|
|
113
134
|
//# sourceMappingURL=base-resource.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-resource.js","sourceRoot":"","sources":["../../src/api/base-resource.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,MAAM,CAAC,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"base-resource.js","sourceRoot":"","sources":["../../src/api/base-resource.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,MAAM,CAAC,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC;AAoBpC,MAAM,OAAO,YAAY;IAEX;IACA;IAFZ,YACY,MAAkB,EAClB,QAAgB;QADhB,WAAM,GAAN,MAAM,CAAY;QAClB,aAAQ,GAAR,QAAQ,CAAQ;IACzB,CAAC;I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;QAC7B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAc,GAAG,IAAI,CAAC,QAAQ,IAAI,EAAE,gBAAgB,CAAC,CAAC;QAC7F,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,OAAO,MAAM,CAAC;IAChB,CAAC;CAGF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HttpClient } from "../http-client.js";
|
|
2
|
-
import type { PurchaseInvoice, CreatePurchaseInvoiceData, ApiResponse
|
|
2
|
+
import type { PurchaseInvoice, CreatePurchaseInvoiceData, ApiResponse } from "../types/api.js";
|
|
3
3
|
import { BaseResource } from "./base-resource.js";
|
|
4
4
|
export declare class InvoiceCreationError extends Error {
|
|
5
5
|
readonly invoiceId: number;
|
|
@@ -36,9 +36,6 @@ export declare class PurchaseInvoicesApi extends BaseResource<PurchaseInvoice> {
|
|
|
36
36
|
confirmWithTotals(id: number, isVatRegistered?: boolean, options?: ConfirmPurchaseInvoiceOptions): Promise<ApiResponse>;
|
|
37
37
|
confirm(id: number): Promise<ApiResponse>;
|
|
38
38
|
invalidate(id: number): Promise<ApiResponse>;
|
|
39
|
-
getDocument(id: number): Promise<ApiFile>;
|
|
40
|
-
uploadDocument(id: number, name: string, contents: string): Promise<ApiResponse>;
|
|
41
|
-
deleteDocument(id: number): Promise<ApiResponse>;
|
|
42
39
|
}
|
|
43
40
|
export {};
|
|
44
41
|
//# sourceMappingURL=purchase-invoices.api.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"purchase-invoices.api.d.ts","sourceRoot":"","sources":["../../src/api/purchase-invoices.api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,eAAe,EAAuB,yBAAyB,EAAE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"purchase-invoices.api.d.ts","sourceRoot":"","sources":["../../src/api/purchase-invoices.api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,eAAe,EAAuB,yBAAyB,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACpH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGlD,qBAAa,oBAAqB,SAAQ,KAAK;aACA,SAAS,EAAE,MAAM;gBAAlD,OAAO,EAAE,MAAM,EAAkB,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAIvF;AAED,UAAU,6BAA6B;IACrC,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAuCD,qBAAa,mBAAoB,SAAQ,YAAY,CAAC,eAAe,CAAC;gBACxD,MAAM,EAAE,UAAU;IAI9B;;;;;;;;;;;;;;;;;OAiBG;IACG,kBAAkB,CACtB,IAAI,EAAE,yBAAyB,EAC/B,QAAQ,CAAC,EAAE,MAAM,EACjB,UAAU,CAAC,EAAE,MAAM,EACnB,eAAe,UAAO,GACrB,OAAO,CAAC,eAAe,CAAC;IAyG3B;;;OAGG;IACG,iBAAiB,CACrB,EAAE,EAAE,MAAM,EACV,eAAe,UAAO,EACtB,OAAO,GAAE,6BAAkC,GAC1C,OAAO,CAAC,WAAW,CAAC;IA0BjB,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAUzC,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;CAWnD"}
|
|
@@ -185,21 +185,5 @@ export class PurchaseInvoicesApi extends BaseResource {
|
|
|
185
185
|
this.invalidateCache("/transactions");
|
|
186
186
|
return result;
|
|
187
187
|
}
|
|
188
|
-
async getDocument(id) {
|
|
189
|
-
return this.client.get(`/purchase_invoices/${id}/document_user`);
|
|
190
|
-
}
|
|
191
|
-
async uploadDocument(id, name, contents) {
|
|
192
|
-
const result = await this.client.request(`/purchase_invoices/${id}/document_user`, {
|
|
193
|
-
method: "PUT",
|
|
194
|
-
body: { name, contents },
|
|
195
|
-
});
|
|
196
|
-
this.invalidateCache();
|
|
197
|
-
return result;
|
|
198
|
-
}
|
|
199
|
-
async deleteDocument(id) {
|
|
200
|
-
const result = await this.client.delete(`/purchase_invoices/${id}/document_user`);
|
|
201
|
-
this.invalidateCache();
|
|
202
|
-
return result;
|
|
203
|
-
}
|
|
204
188
|
}
|
|
205
189
|
//# sourceMappingURL=purchase-invoices.api.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"purchase-invoices.api.js","sourceRoot":"","sources":["../../src/api/purchase-invoices.api.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAE/D,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IACA;IAA7C,YAAY,OAAe,EAAkB,SAAiB,EAAE,OAAsB;QACpF,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QADmB,cAAS,GAAT,SAAS,CAAQ;QAE5D,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACrC,CAAC;CACF;AAMD;;;;GAIG;AACH,SAAS,uBAAuB,CAC9B,KAA4B,EAC5B,eAAwB,EACxB,UAAmB;IAEnB,IAAI,CAAC,KAAK,IAAI,eAAe;QAAE,OAAO,KAAK,CAAC;IAE5C,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;QACtB,iCAAiC;QACjC,IAAI,IAAI,CAAC,0BAA0B,IAAI,IAAI;YAAE,OAAO,IAAI,CAAC;QAEzD,MAAM,GAAG,GAAG,IAAI,CAAC,eAAe;eAC3B,CAAC,IAAI,CAAC,cAAc,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS;gBAChE,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,cAAc,GAAG,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C,EAAU;QACzB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAc,sBAAsB,EAAE,aAAa,EAAE,EAAE,CAAC,CAAC;QAC/F,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;QAClC,IAAI,CAAC,eAAe,CAAC,eAAe,CAAC,CAAC;QACtC,OAAO,MAAM,CAAC;IAChB,CAAC;CAKF"}
|
|
@@ -7,6 +7,7 @@ export declare class SaleInvoicesApi extends BaseResource<SaleInvoice> {
|
|
|
7
7
|
invalidate(id: number): Promise<ApiResponse>;
|
|
8
8
|
getDeliveryOptions(id: number): Promise<SaleInvoiceDeliveryOptions>;
|
|
9
9
|
getSystemPdf(id: number): Promise<ApiFile>;
|
|
10
|
+
getSystemXml(id: number): Promise<ApiFile>;
|
|
10
11
|
sendEinvoice(id: number, request: SaleInvoiceDeliveryRequest): Promise<ApiResponse>;
|
|
11
12
|
}
|
|
12
13
|
//# sourceMappingURL=sale-invoices.api.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sale-invoices.api.d.ts","sourceRoot":"","sources":["../../src/api/sale-invoices.api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AACjI,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,qBAAa,eAAgB,SAAQ,YAAY,CAAC,WAAW,CAAC;gBAChD,MAAM,EAAE,UAAU;IAIxB,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAUzC,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAO5C,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAInE,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAI1C,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,0BAA0B,GAAG,OAAO,CAAC,WAAW,CAAC;CAS1F"}
|
|
1
|
+
{"version":3,"file":"sale-invoices.api.d.ts","sourceRoot":"","sources":["../../src/api/sale-invoices.api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AACjI,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,qBAAa,eAAgB,SAAQ,YAAY,CAAC,WAAW,CAAC;gBAChD,MAAM,EAAE,UAAU;IAIxB,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAUzC,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAO5C,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAInE,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAI1C,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAI1C,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,0BAA0B,GAAG,OAAO,CAAC,WAAW,CAAC;CAS1F"}
|
|
@@ -24,6 +24,9 @@ export class SaleInvoicesApi extends BaseResource {
|
|
|
24
24
|
async getSystemPdf(id) {
|
|
25
25
|
return this.client.get(`/sale_invoices/${id}/pdf_system`);
|
|
26
26
|
}
|
|
27
|
+
async getSystemXml(id) {
|
|
28
|
+
return this.client.get(`/sale_invoices/${id}/xml`);
|
|
29
|
+
}
|
|
27
30
|
async sendEinvoice(id, request) {
|
|
28
31
|
const result = await this.client.patch(`/sale_invoices/${id}/deliver`, request);
|
|
29
32
|
this.invalidateCache();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sale-invoices.api.js","sourceRoot":"","sources":["../../src/api/sale-invoices.api.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,OAAO,eAAgB,SAAQ,YAAyB;IAC5D,YAAY,MAAkB;QAC5B,KAAK,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAClC,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,EAAU;QACtB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAc,kBAAkB,EAAE,WAAW,EAAE,EAAE,CAAC,CAAC;QACzF,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,sEAAsE;QACtE,sEAAsE;QACtE,mDAAmD;QACnD,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;QAClC,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,EAAU;QACzB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAc,kBAAkB,EAAE,aAAa,EAAE,EAAE,CAAC,CAAC;QAC3F,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;QAClC,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,EAAU;QACjC,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAA6B,kBAAkB,EAAE,mBAAmB,CAAC,CAAC;IAC9F,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,EAAU;QAC3B,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAU,kBAAkB,EAA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AC,EAAU;QACjC,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAA6B,kBAAkB,EAAE,mBAAmB,CAAC,CAAC;IAC9F,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,EAAU;QAC3B,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAU,kBAAkB,EAAE,aAAa,CAAC,CAAC;IACrE,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,EAAU;QAC3B,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAU,kBAAkB,EAAE,MAAM,CAAC,CAAC;IAC9D,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,EAAU,EAAE,OAAmC;QAChE,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAc,kBAAkB,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;QAC7F,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,qEAAqE;QACrE,kEAAkE;QAClE,4EAA4E;QAC5E,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;QAClC,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
|
package/dist/audit-log.d.ts
CHANGED
|
@@ -3,6 +3,33 @@
|
|
|
3
3
|
* Entries are written as human-readable Markdown sections to
|
|
4
4
|
* `{projectRoot}/logs/{companyOrConnectionLabel}.audit.md`.
|
|
5
5
|
*/
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
export declare const AUDIT_ENTITY_TYPES: readonly ["client", "product", "journal", "transaction", "sale_invoice", "purchase_invoice", "invoice_series", "bank_account", "invoice_info", "tool_execution"];
|
|
8
|
+
export declare const AUDIT_ACTIONS: readonly ["CREATED", "UPDATED", "DELETED", "CONFIRMED", "INVALIDATED", "UPLOADED", "IMPORTED", "SENT", "DELETE_FAILED", "CONNECTION_SWITCH_INTERRUPTED"];
|
|
9
|
+
export declare const AuditEntityType: z.ZodEnum<{
|
|
10
|
+
client: "client";
|
|
11
|
+
product: "product";
|
|
12
|
+
journal: "journal";
|
|
13
|
+
transaction: "transaction";
|
|
14
|
+
sale_invoice: "sale_invoice";
|
|
15
|
+
purchase_invoice: "purchase_invoice";
|
|
16
|
+
invoice_series: "invoice_series";
|
|
17
|
+
bank_account: "bank_account";
|
|
18
|
+
invoice_info: "invoice_info";
|
|
19
|
+
tool_execution: "tool_execution";
|
|
20
|
+
}>;
|
|
21
|
+
export declare const AuditAction: z.ZodEnum<{
|
|
22
|
+
CREATED: "CREATED";
|
|
23
|
+
UPDATED: "UPDATED";
|
|
24
|
+
DELETED: "DELETED";
|
|
25
|
+
CONFIRMED: "CONFIRMED";
|
|
26
|
+
INVALIDATED: "INVALIDATED";
|
|
27
|
+
UPLOADED: "UPLOADED";
|
|
28
|
+
IMPORTED: "IMPORTED";
|
|
29
|
+
SENT: "SENT";
|
|
30
|
+
DELETE_FAILED: "DELETE_FAILED";
|
|
31
|
+
CONNECTION_SWITCH_INTERRUPTED: "CONNECTION_SWITCH_INTERRUPTED";
|
|
32
|
+
}>;
|
|
6
33
|
export interface AuditEntry {
|
|
7
34
|
timestamp: string;
|
|
8
35
|
tool: string;
|
package/dist/audit-log.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit-log.d.ts","sourceRoot":"","sources":["../src/audit-log.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"audit-log.d.ts","sourceRoot":"","sources":["../src/audit-log.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAcH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAgBxB,eAAO,MAAM,kBAAkB,kKAcrB,CAAC;AAEX,eAAO,MAAM,aAAa,0JAWhB,CAAC;AAEX,eAAO,MAAM,eAAe;;;;;;;;;;;EAA6B,CAAC;AAC1D,eAAO,MAAM,WAAW;;;;;;;;;;;EAAwB,CAAC;AAEjD,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EA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,KAAK,CAAC;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAuBjH;AAED,wEAAwE;AACxE,wBAAgB,uBAAuB,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,cAAc,GAAG,MAAM,CAQ/F;AAED,iEAAiE;AACjE,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,cAAc,GAAG,MAAM,CAEjF"}
|
package/dist/audit-log.js
CHANGED
|
@@ -5,7 +5,46 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { appendFileSync, chmodSync, existsSync, mkdirSync, readFileSync, readdirSync, renameSync, unlinkSync, writeFileSync, } from "fs";
|
|
7
7
|
import { join } from "path";
|
|
8
|
+
import { z } from "zod";
|
|
8
9
|
import { normalizeAuditLabel, sanitizeAuditLogName, } from "./audit-log-labels.js";
|
|
10
|
+
// ---------------------------------------------------------------------------
|
|
11
|
+
// Shared audit filter vocabularies (single source of truth)
|
|
12
|
+
//
|
|
13
|
+
// These are the canonical entity-type and action values the audit writer
|
|
14
|
+
// (`logAudit`) emits for the core CRUD/mutation surface, and the only values
|
|
15
|
+
// the get_session_log / list_audit_logs filters accept. The document-attachment
|
|
16
|
+
// tools derive their 4-value entity enum from `AuditEntityType` so the two
|
|
17
|
+
// stay in lockstep. Keep these in sync with ACTION_LABELS / ENTITY_LABELS below.
|
|
18
|
+
// ---------------------------------------------------------------------------
|
|
19
|
+
export const AUDIT_ENTITY_TYPES = [
|
|
20
|
+
// Core CRUD entities
|
|
21
|
+
"client",
|
|
22
|
+
"product",
|
|
23
|
+
"journal",
|
|
24
|
+
"transaction",
|
|
25
|
+
"sale_invoice",
|
|
26
|
+
"purchase_invoice",
|
|
27
|
+
// Reference-data entities
|
|
28
|
+
"invoice_series",
|
|
29
|
+
"bank_account",
|
|
30
|
+
"invoice_info",
|
|
31
|
+
// Meta (connection-switch-interrupted in-flight tool)
|
|
32
|
+
"tool_execution",
|
|
33
|
+
];
|
|
34
|
+
export const AUDIT_ACTIONS = [
|
|
35
|
+
"CREATED",
|
|
36
|
+
"UPDATED",
|
|
37
|
+
"DELETED",
|
|
38
|
+
"CONFIRMED",
|
|
39
|
+
"INVALIDATED",
|
|
40
|
+
"UPLOADED",
|
|
41
|
+
"IMPORTED",
|
|
42
|
+
"SENT",
|
|
43
|
+
"DELETE_FAILED",
|
|
44
|
+
"CONNECTION_SWITCH_INTERRUPTED",
|
|
45
|
+
];
|
|
46
|
+
export const AuditEntityType = z.enum(AUDIT_ENTITY_TYPES);
|
|
47
|
+
export const AuditAction = z.enum(AUDIT_ACTIONS);
|
|
9
48
|
const LOGS_DIR = join(process.cwd(), "logs");
|
|
10
49
|
const LABELS_FILE = join(LOGS_DIR, ".audit-labels.json");
|
|
11
50
|
const ENTRY_SEPARATOR = "\n---\n\n";
|
|
@@ -252,12 +291,12 @@ function getLang() {
|
|
|
252
291
|
return v === "en" ? "en" : "et";
|
|
253
292
|
}
|
|
254
293
|
const ACTION_LABELS = {
|
|
255
|
-
et: { CREATED: "Loodud", UPDATED: "Muudetud", DELETED: "Kustutatud", CONFIRMED: "Kinnitatud", INVALIDATED: "Tühistatud", UPLOADED: "Üles laetud", IMPORTED: "Imporditud", SENT: "Saadetud" },
|
|
256
|
-
en: { CREATED: "Created", UPDATED: "Updated", DELETED: "Deleted", CONFIRMED: "Confirmed", INVALIDATED: "Invalidated", UPLOADED: "Uploaded", IMPORTED: "Imported", SENT: "Sent" },
|
|
294
|
+
et: { CREATED: "Loodud", UPDATED: "Muudetud", DELETED: "Kustutatud", CONFIRMED: "Kinnitatud", INVALIDATED: "Tühistatud", UPLOADED: "Üles laetud", IMPORTED: "Imporditud", SENT: "Saadetud", DELETE_FAILED: "Kustutamine ebaõnnestus", CONNECTION_SWITCH_INTERRUPTED: "Ühenduse vahetus katkestatud" },
|
|
295
|
+
en: { CREATED: "Created", UPDATED: "Updated", DELETED: "Deleted", CONFIRMED: "Confirmed", INVALIDATED: "Invalidated", UPLOADED: "Uploaded", IMPORTED: "Imported", SENT: "Sent", DELETE_FAILED: "Delete failed", CONNECTION_SWITCH_INTERRUPTED: "Connection switch interrupted" },
|
|
257
296
|
};
|
|
258
297
|
const ENTITY_LABELS = {
|
|
259
|
-
et: { client: "Klient", product: "Toode", journal: "Kanne", transaction: "Pangatehing", sale_invoice: "Müügiarve", purchase_invoice: "Ostuarve" },
|
|
260
|
-
en: { client: "Client", product: "Product", journal: "Journal", transaction: "Transaction", sale_invoice: "Sale invoice", purchase_invoice: "Purchase invoice" },
|
|
298
|
+
et: { client: "Klient", product: "Toode", journal: "Kanne", transaction: "Pangatehing", sale_invoice: "Müügiarve", purchase_invoice: "Ostuarve", invoice_series: "Arvete seeria", bank_account: "Pangakonto", invoice_info: "Arve seadistus", tool_execution: "Tööriista käivitus" },
|
|
299
|
+
en: { client: "Client", product: "Product", journal: "Journal", transaction: "Transaction", sale_invoice: "Sale invoice", purchase_invoice: "Purchase invoice", invoice_series: "Invoice series", bank_account: "Bank account", invoice_info: "Invoice settings", tool_execution: "Tool execution" },
|
|
261
300
|
};
|
|
262
301
|
const FIELD_LABELS = {
|
|
263
302
|
et: {
|