ownledger 0.0.1 → 1.1.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/AGENTS.md +94 -0
- package/CHANGELOG.md +30 -0
- package/LICENSE +21 -0
- package/README.md +101 -1
- package/assets/_headers +5 -0
- package/assets/app.css +61 -0
- package/assets/app.js +369 -0
- package/assets/icon.svg +1 -0
- package/assets/index.html +30 -0
- package/assets/manifest.webmanifest +1 -0
- package/dist/cli/check.d.ts +3 -0
- package/dist/cli/check.js +21 -0
- package/dist/cli/deploy.d.ts +1 -0
- package/dist/cli/deploy.js +258 -0
- package/dist/cli/dev.d.ts +3 -0
- package/dist/cli/dev.js +107 -0
- package/dist/cli/import.d.ts +3 -0
- package/dist/cli/import.js +151 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +47 -0
- package/dist/cli/init.d.ts +1 -0
- package/dist/cli/init.js +73 -0
- package/dist/cli/jsonc.d.ts +2 -0
- package/dist/cli/jsonc.js +39 -0
- package/dist/engine/actions.d.ts +61 -0
- package/dist/engine/actions.js +227 -0
- package/dist/engine/balances.d.ts +30 -0
- package/dist/engine/balances.js +75 -0
- package/dist/engine/categories.d.ts +17 -0
- package/dist/engine/categories.js +35 -0
- package/dist/engine/check.d.ts +11 -0
- package/dist/engine/check.js +229 -0
- package/dist/engine/dates.d.ts +15 -0
- package/dist/engine/dates.js +56 -0
- package/dist/engine/defaults.d.ts +2 -0
- package/dist/engine/defaults.js +61 -0
- package/dist/engine/index.d.ts +13 -0
- package/dist/engine/index.js +13 -0
- package/dist/engine/load.d.ts +23 -0
- package/dist/engine/load.js +129 -0
- package/dist/engine/networth.d.ts +12 -0
- package/dist/engine/networth.js +73 -0
- package/dist/engine/registry.d.ts +24 -0
- package/dist/engine/registry.js +41 -0
- package/dist/engine/reports.d.ts +68 -0
- package/dist/engine/reports.js +149 -0
- package/dist/engine/schedules.d.ts +75 -0
- package/dist/engine/schedules.js +208 -0
- package/dist/engine/types.d.ts +132 -0
- package/dist/engine/types.js +2 -0
- package/dist/engine/write.d.ts +30 -0
- package/dist/engine/write.js +105 -0
- package/dist/import/hash.d.ts +1 -0
- package/dist/import/hash.js +17 -0
- package/dist/import/index.d.ts +6 -0
- package/dist/import/index.js +6 -0
- package/dist/import/mapping.d.ts +96 -0
- package/dist/import/mapping.js +54 -0
- package/dist/import/profile.d.ts +39 -0
- package/dist/import/profile.js +125 -0
- package/dist/import/run.d.ts +101 -0
- package/dist/import/run.js +416 -0
- package/dist/import/workbook.d.ts +13 -0
- package/dist/import/workbook.js +168 -0
- package/dist/import/xlsx-write.d.ts +6 -0
- package/dist/import/xlsx-write.js +38 -0
- package/dist/node/files.d.ts +3 -0
- package/dist/node/files.js +26 -0
- package/dist/node/scaffold.d.ts +14 -0
- package/dist/node/scaffold.js +45 -0
- package/dist/worker/api.d.ts +3 -0
- package/dist/worker/api.js +139 -0
- package/dist/worker/auth.d.ts +11 -0
- package/dist/worker/auth.js +182 -0
- package/dist/worker/env.d.ts +27 -0
- package/dist/worker/env.js +6 -0
- package/dist/worker/github.d.ts +29 -0
- package/dist/worker/github.js +154 -0
- package/dist/worker/index.d.ts +5 -0
- package/dist/worker/index.js +64 -0
- package/dist/worker/mcp.d.ts +4 -0
- package/dist/worker/mcp.js +301 -0
- package/dist/worker/store.d.ts +42 -0
- package/dist/worker/store.js +92 -0
- package/dist/worker/tar.d.ts +2 -0
- package/dist/worker/tar.js +62 -0
- package/dist/worker/version.d.ts +1 -0
- package/dist/worker/version.js +2 -0
- package/package.json +66 -4
- package/presets/misa.mapping.yaml +48 -0
- package/templates/repo/.github/dependabot.yml +11 -0
- package/templates/repo/.github/workflows/check.yml +15 -0
- package/templates/repo/.github/workflows/deploy.yml +21 -0
- package/templates/repo/README.md +10 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# MISA Sổ Thu Chi export ("Bảng kê thu chi", xlsx, one sheet per wallet).
|
|
2
|
+
# The reading rules below are fixed for this app. The AI fills `accounts`, `categories` and
|
|
3
|
+
# `uncategorized` from `ownledger import <file> --profile`, and the owner reviews them.
|
|
4
|
+
source: misa
|
|
5
|
+
reader: table
|
|
6
|
+
sheets: all
|
|
7
|
+
account_from: sheet
|
|
8
|
+
date_format: dd/mm/yyyy
|
|
9
|
+
columns:
|
|
10
|
+
date: Ngày
|
|
11
|
+
time: Giờ
|
|
12
|
+
in: Số tiền thu
|
|
13
|
+
out: Số tiền chi
|
|
14
|
+
balance: Số dư
|
|
15
|
+
category: Hạng mục cha
|
|
16
|
+
subcategory: Hạng mục con
|
|
17
|
+
who: Chi cho ai
|
|
18
|
+
event: Chuyến đi/Sự kiện
|
|
19
|
+
note: Diễn giải
|
|
20
|
+
totals:
|
|
21
|
+
opening: Số dư đầu kì
|
|
22
|
+
closing: Số dư cuối kì
|
|
23
|
+
in: Tổng thu
|
|
24
|
+
out: Tổng chi
|
|
25
|
+
# Transfers have no category; the note names the other wallet, sometimes after a prefix:
|
|
26
|
+
# "Chuyển tới X", "Gửi tiết kiệm tài khoản N (Chuyển tới X)", "Tất toán sổ tiết kiệm N (Chuyển từ X)".
|
|
27
|
+
transfers:
|
|
28
|
+
only_without_category: true
|
|
29
|
+
out: "\\(?Chuyển tới (?<wallet>.+?)\\)?$"
|
|
30
|
+
in: "\\(?Chuyển từ (?<wallet>.+?)\\)?$"
|
|
31
|
+
|
|
32
|
+
# Sheet name (as in the file) → account. Sheet names are cut to 31 characters and repeated names get
|
|
33
|
+
# a _NN suffix; put the full wallet name(s) from the transfer notes in `names`.
|
|
34
|
+
# Lift facts users write into wallet names (card statement/due day, deposit term and start) into details.
|
|
35
|
+
accounts: {}
|
|
36
|
+
# "cash": { id: cash, name: Tiền mặt, type: cash }
|
|
37
|
+
# "vcb _1234 🗓️20💸5": { id: card-vcb, name: VCB Visa, type: credit_card, names: ["vcb _1234 🗓️20💸5"], details: { statement_day: 20, due_day: 5 } }
|
|
38
|
+
# "gửi 6 tháng từ 01_07_2025": { id: dep-20250701, name: Gửi 6 tháng từ 01/07/2025, type: deposit, names: ["gửi 6 tháng từ 01/07/2025"], details: { term_months: 6, start: 2025-07-01 } }
|
|
39
|
+
|
|
40
|
+
# "Hạng mục cha/Hạng mục con" (or just the parent) → ownledger category path.
|
|
41
|
+
categories: {}
|
|
42
|
+
# "Chi tiêu hàng ngày/Ăn uống": food/eating-out
|
|
43
|
+
|
|
44
|
+
# Rows with no category that are not transfers (MISA allows income with only a note).
|
|
45
|
+
uncategorized: []
|
|
46
|
+
# - { match: "lãi", category: interest, sign: in }
|
|
47
|
+
# uncategorized_in: other-income
|
|
48
|
+
# uncategorized_out: other
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- package-ecosystem: npm
|
|
4
|
+
directory: /
|
|
5
|
+
schedule: { interval: weekly }
|
|
6
|
+
allow:
|
|
7
|
+
- dependency-name: ownledger
|
|
8
|
+
# patch and minor updates never need a data migration; majors are reviewed by hand
|
|
9
|
+
ignore:
|
|
10
|
+
- dependency-name: ownledger
|
|
11
|
+
update-types: ["version-update:semver-major"]
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
name: check
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
pull_request:
|
|
5
|
+
permissions:
|
|
6
|
+
contents: read
|
|
7
|
+
jobs:
|
|
8
|
+
check:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
steps:
|
|
11
|
+
- uses: actions/checkout@v5
|
|
12
|
+
- uses: actions/setup-node@v5
|
|
13
|
+
with: { node-version: 22 }
|
|
14
|
+
- run: npm ci
|
|
15
|
+
- run: npx ownledger check
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
name: deploy
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches: [main]
|
|
5
|
+
workflow_dispatch:
|
|
6
|
+
permissions:
|
|
7
|
+
contents: read
|
|
8
|
+
concurrency: deploy
|
|
9
|
+
jobs:
|
|
10
|
+
deploy:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v5
|
|
14
|
+
- uses: actions/setup-node@v5
|
|
15
|
+
with: { node-version: 22 }
|
|
16
|
+
- run: npm ci
|
|
17
|
+
- run: npx ownledger check
|
|
18
|
+
- run: npx wrangler deploy
|
|
19
|
+
env:
|
|
20
|
+
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
21
|
+
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# {{name}}
|
|
2
|
+
|
|
3
|
+
My personal finance ledger, kept with [ownledger](https://github.com/phucbm/ownledger). Private.
|
|
4
|
+
|
|
5
|
+
- `data/`: the ledger (YAML, monthly JSONL, prices CSV). Every change is a commit.
|
|
6
|
+
- `imports/`: raw exports and the mapping per source app.
|
|
7
|
+
- `npx ownledger check`: must pass after every change (CI runs it too).
|
|
8
|
+
- `npx ownledger import <file>`: import an export (profile → mapping → preview → `--yes`).
|
|
9
|
+
- `npx ownledger deploy`: (re)deploy my Worker; prints the connector URL.
|
|
10
|
+
- `npx ownledger dev`: run the Worker locally against this folder.
|