openvibers/openvibe.finance Commits
OpenVibe.Finance v0.1: your money, your rules, your data
Changes
nnew file mode 100644@@@ -0,0 +1,12 @@++# OpenVibe.Finance (/etc/openvibe/finance.env on the host). Values are never committed.++BASE_URL=https://openvibe.finance++PORT=5292++DATABASE_URL=++DATABASE_DIRECT_URL=++# 32 random bytes, base64: the service key every person's key is derived from (server/crypto.js). Losing it loses the++# payees and notes; rotating it needs a re-seal.++FINANCE_DATA_KEY=++OV_OAUTH_CLIENT_ID=finance++OV_OAUTH_CLIENT_SECRET=++OV_NETWORK_URL=https://openvibe.network++OV_NETWORK_INTERNAL_URL=http://127.0.0.1:4000nnew file mode 100644@@@ -0,0 +1,18 @@++name: ci++on:++ push:++ branches: [main]++ pull_request:++jobs:++ test:++ runs-on: ubuntu-latest++ steps:++ - uses: actions/checkout@v4++ - uses: actions/setup-node@v4++ with:++ node-version: 22++ cache: npm++ - run: npm ci --ignore-scripts++ - run: npm test++ security:++ uses: OpenVibers/OpenVibe.Shared/.github/workflows/security.yml@8a353d9e7557bfeed2b43deb51271171f8e48fc6nnew file mode 100644@@@ -0,0 +1,3 @@++node_modules/++.env++*.lognnew file mode 100644@@@ -0,0 +1,18 @@++# AGENTS.md — OpenVibe.Finance++++A person's own money data (plan §L.2): accounts, transactions, CSV imports and the month. Node/Express, server-rendered++in the network's shell (openvibe-shared), PostgreSQL through `openvibe-sdk/db` (PGlite in tests).++++## Rules (the most sensitive data on the network)++- **Every query names the owner** (`store.js`); a page or route never reads a row by id alone.++- **Payees and memos are sealed** with the person's key (`server/crypto.js`); never log them, never return them to++ anyone but their owner. Amounts, dates and categories stay plain for the person's own sums.++- **Nothing leaves:** no search index, no analytics events with content, no training data, no third-party script.++- **No money moves.** Paying, transferring or cancelling is a separate, later decision with its own review.++- **Writes are same-origin** (a page form) or a Bearer call; answers are `private, no-store` and `noindex`.++- **Export and deletion stay complete:** a new table gets its rows in `exportAll` and `removeAll` in the same change.++- **Migrations:** `migrations/NNNN_name.sql` with `-- phase:`; never edit one that has run.++++## Commands++`npm test` (all, PGlite) · `node test/<name>.test.js` · `node test/harness/serve-sample.js 18471` (a local look).++Style: 4 spaces, single quotes, semicolons, CommonJS.nnew file mode 100644@@@ -0,0 +1,37 @@++# OpenVibe.Finance++++**Your money, your rules, your data** — [openvibe.finance](https://openvibe.finance), part of the OpenVibe network.++++Your accounts in one place, from a bank's CSV export or typed in, and a clear picture of each month. Free, with nothing++to connect.++++- **Private to you.** Payees and notes are stored encrypted under a key derived for your account alone++ (`server/crypto.js`). Nothing here enters search, analytics or AI training.++- **No money moves.** It reads and plans; it never pays, transfers or cancels anything.++- **Yours to take.** Download everything as one JSON file, or delete everything, at `/data`.++++## What it does today (v0.1)++++- Accounts (checking, savings, credit card, cash, loan, investments) with an opening balance and a running balance.++- Transactions typed in, or imported from a bank's CSV export: the columns are read from the header (date; amount, or++ debit and credit; payee or description; memo; category), with the date and amount shapes banks send. Importing the++ same file twice adds nothing twice.++- Categories, corrected per transaction (each correction is a new revision; the category says where it came from).++- The month: money in, money out, and spending by category (transfers between your accounts left out).++- A JSON API for all of it (`/api/v1/…`), for the person signed in.++++Plan: `OpenVibe_Plan_2026-11-13.md` §L.2. Next: rules and recurring bills, budgets, goals, OFX/QFX, the Link plugin++for local-only import, and Finance Experts (Budget Coach, Subscription Auditor) with narrow read permission.++++## Running++++```bash++npm install++npm test # PGlite, a real PostgreSQL in-process++node test/harness/serve-sample.js 18471 # a local look with sample data and a stand-in sign-in++```++++Production: `/opt/openvibe.finance`, unit `openvibe-finance.service` (port 5292), env `/etc/openvibe/finance.env`++(`.env.example`), nginx `deploy/nginx/openvibe.finance.conf`. Sign-in is OpenVibe.Network's OAuth client `finance`.++++License: AGPL-3.0-only.nnew file mode 100644@@@ -0,0 +1,39 @@++server {++ listen 80;++ listen [::]:80;++ server_name openvibe.finance www.openvibe.finance;++ location /.well-known/acme-challenge/ { root /var/www/certbot; }++ location / { return 301 https://openvibe.finance$request_uri; }++}++server {++ listen 443 ssl;++ listen [::]:443 ssl;++ http2 on;++ server_name www.openvibe.finance;++ ssl_certificate /etc/letsencrypt/live/openvibe.finance/fullchain.pem;++ ssl_certificate_key /etc/letsencrypt/live/openvibe.finance/privkey.pem;++ ssl_protocols TLSv1.2 TLSv1.3;++ return 301 https://openvibe.finance$request_uri;++}++server {++ listen 443 ssl;++ listen [::]:443 ssl;++ http2 on;++ server_name openvibe.finance;++ ssl_certificate /etc/letsencrypt/live/openvibe.finance/fullchain.pem;++ ssl_certificate_key /etc/letsencrypt/live/openvibe.finance/privkey.pem;++ ssl_protocols TLSv1.2 TLSv1.3;++ # A bank's CSV export, pasted or chosen: up to 4 MB (the app's own limit).++ client_max_body_size 5m;++ proxy_http_version 1.1;++ proxy_set_header Host $host;++ proxy_set_header X-Real-IP $remote_addr;++ proxy_set_header X-Forwarded-For $remote_addr;++ proxy_set_header CF-Connecting-IP $remote_addr;++ proxy_set_header X-Forwarded-Proto $scheme;++ add_header Strict-Transport-Security "max-age=31536000" always;++ location ~* ^/internal(/|$) { return 404; }++ location ~* ^/metrics(/|$) { return 404; }++ location / { proxy_pass http://127.0.0.1:5292; }++ location ~ /\.(?!well-known) { deny all; }++}nnew file mode 100644@@@ -0,0 +1,23 @@++[Unit]++Description=OpenVibe.Finance++After=network.target postgresql.service pgbouncer.service++[Service]++Type=simple++User=ubuntu++Group=ubuntu++WorkingDirectory=/opt/openvibe.finance++EnvironmentFile=/etc/openvibe/finance.env++Environment=NODE_ENV=production++Environment=PORT=5292++Environment=PATH=/usr/local/bin:/usr/bin:/bin++ExecStart=/usr/bin/env node /opt/openvibe.finance/server/index.js++Restart=always++RestartSec=5++KillSignal=SIGTERM++TimeoutStopSec=15++NoNewPrivileges=true++PrivateTmp=true++ProtectSystem=strict++ProtectHome=true++[Install]++WantedBy=multi-user.targetnnew file mode 100644@@@ -0,0 +1,57 @@++-- phase: expand++-- OpenVibe.Finance (plan §L.2: "your money, your rules, your data"): a person's accounts and transactions, entered by++-- hand or imported from a bank's CSV. Read and plan only: no money moves.++-- * Every row belongs to one person (owner: their usr_ subject). Nothing here is public, searched, counted in++-- analytics or used for training.++-- * Payees and notes are stored encrypted with a key for that person alone (server/crypto.js); amounts, dates and++-- categories stay plain so the person's own sums can be computed.++-- * Money is integer cents in the account's currency.++-- * A raw import row never changes: a correction (a category, a payee) is a revision on the transaction, and the++-- category says where it came from (you, a rule, the bank's file).++++CREATE TABLE finance_accounts (++ id text COLLATE "C" PRIMARY KEY,++ owner text COLLATE "C" NOT NULL,++ name text NOT NULL,++ kind text COLLATE "C" NOT NULL CHECK (kind IN ('checking', 'savings', 'credit', 'cash', 'loan', 'investment', 'other')),++ currency text COLLATE "C" NOT NULL DEFAULT 'USD' CHECK (currency ~ '^[A-Z]{3}$'),++ opening_cents bigint NOT NULL DEFAULT 0,++ created_at timestamptz NOT NULL DEFAULT now(),++ updated_at timestamptz NOT NULL DEFAULT now(),++ archived_at timestamptz++);++CREATE INDEX finance_accounts_owner ON finance_accounts (owner, created_at);++++CREATE TABLE finance_imports (++ id text COLLATE "C" PRIMARY KEY,++ owner text COLLATE "C" NOT NULL,++ account_id text COLLATE "C" NOT NULL REFERENCES finance_accounts (id) ON DELETE CASCADE,++ format text COLLATE "C" NOT NULL DEFAULT 'csv',++ rows_read integer NOT NULL DEFAULT 0,++ rows_added integer NOT NULL DEFAULT 0,++ rows_skipped integer NOT NULL DEFAULT 0,++ created_at timestamptz NOT NULL DEFAULT now()++);++CREATE INDEX finance_imports_owner ON finance_imports (owner, created_at);++++CREATE TABLE finance_transactions (++ id text COLLATE "C" PRIMARY KEY,++ owner text COLLATE "C" NOT NULL,++ account_id text COLLATE "C" NOT NULL REFERENCES finance_accounts (id) ON DELETE CASCADE,++ posted_on date NOT NULL,++ amount_cents bigint NOT NULL,++ payee_enc text NOT NULL DEFAULT '',++ memo_enc text NOT NULL DEFAULT '',++ category text NOT NULL DEFAULT 'Uncategorized',++ category_from text COLLATE "C" NOT NULL DEFAULT 'none' CHECK (category_from IN ('none', 'you', 'rule', 'file')),++ import_id text COLLATE "C" REFERENCES finance_imports (id) ON DELETE SET NULL,++ -- The same bank row imported twice is one transaction: an HMAC (the person's key) of its account, date, amount and++ -- payee, and its place among identical rows in the file.++ dedupe text COLLATE "C",++ revision integer NOT NULL DEFAULT 1,++ created_at timestamptz NOT NULL DEFAULT now(),++ updated_at timestamptz NOT NULL DEFAULT now()++);++CREATE INDEX finance_transactions_account ON finance_transactions (account_id, posted_on DESC, id);++CREATE INDEX finance_transactions_owner_month ON finance_transactions (owner, posted_on);++CREATE UNIQUE INDEX finance_transactions_dedupe ON finance_transactions (account_id, dedupe) WHERE dedupe IS NOT NULL;nnew file mode 100644@@@ -0,0 +1,1564 @@++{++ "name": "openvibe-finance",++ "version": "0.1.0",++ "lockfileVersion": 3,++ "requires": true,++ "packages": {++ "": {++ "name": "openvibe-finance",++ "version": "0.1.0",++ "license": "AGPL-3.0-only",++ "dependencies": {++ "@electric-sql/pglite": "^0.5.8",++ "express": "^4.21.2",++ "openvibe-sdk": "https://git.openvibe.codes/api/v1/repos/openvibers/openvibe.sdk/archive/v0.187.0.tar.gz",++ "openvibe-shared": "https://git.openvibe.codes/api/v1/repos/openvibers/openvibe.shared/archive/v4.314.0.tar.gz",++ "pg": "^8.23.1"++ },++ "engines": {++ "node": ">=22"++ }++ },++ "node_modules/@electric-sql/pglite": {++ "version": "0.5.16",++ "resolved": "https://registry.npmjs.org/@electric-sql/pglite/-/pglite-0.5.16.tgz",++ "integrity": "sha512-Nj8KcIsJL748W408U2N8q4+9IlONdpRIU8MJypIAAINMJ5nqKyqpX7Mgg/5XKkXiAib3AoZGR6hnJFlrlLBrcg==",++ "license": "Apache-2.0"++ },++ "node_modules/@jridgewell/gen-mapping": {++ "version": "0.3.13",++ "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz",++ "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==",++ "license": "MIT",++ "dependencies": {++ "@jridgewell/sourcemap-codec": "^1.5.0",++ "@jridgewell/trace-mapping": "^0.3.24"++ }++ },++ "node_modules/@jridgewell/resolve-uri": {++ "version": "3.1.3",++ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.3.tgz",++ "integrity": "sha512-lhTtjtoEArWBjismtfS761S9Hlyn+nIZqOZVYoZ1Xn82PMNMVnk+jj/NhC4fAXGTs7ydONcJiR5vyQBTMDu27g==",++ "license": "MIT",++ "engines": {++ "node": ">=6.0.0"++ }++ },++ "node_modules/@jridgewell/source-map": {++ "version": "0.3.11",++ "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.11.tgz",++ "integrity": "sha512-ZMp1V8ZFcPG5dIWnQLr3NSI1MiCU7UETdS/A0G8V/XWHvJv3ZsFqutJn1Y5RPmAPX6F3BiE397OqveU/9NCuIA==",++ "license": "MIT",++ "dependencies": {++ "@jridgewell/gen-mapping": "^0.3.5",++ "@jridgewell/trace-mapping": "^0.3.25"++ }++ },++ "node_modules/@jridgewell/sourcemap-codec": {++ "version": "1.6.0",++ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz",++ "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==",++ "license": "MIT"++ },++ "node_modules/@jridgewell/trace-mapping": {++ "version": "0.3.31",++ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz",++ "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==",++ "license": "MIT",++ "dependencies": {++ "@jridgewell/resolve-uri": "^3.1.0",++ "@jridgewell/sourcemap-codec": "^1.4.14"++ }++ },++ "node_modules/accepts": {++ "version": "1.3.8",++ "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz",++ "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==",++ "license": "MIT",++ "dependencies": {++ "mime-types": "~2.1.34",++ "negotiator": "0.6.3"++ },++ "engines": {++ "node": ">= 0.6"++ }++ },++ "node_modules/acorn": {++ "version": "8.19.0",++ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.19.0.tgz",++ "integrity": "sha512-oJlA3XiRm7Cyk6qFD2Jn8ak9B7jSy0qy00ADO3+8dpT0LSjFihQYv4C02LFCSYJV3Q37xYwwRy5m+IpIiUzqWw==",++ "license": "MIT",++ "bin": {++ "acorn": "bin/acorn"++ },++ "engines": {++ "node": ">=0.4.0"++ }++ },++ "node_modules/array-flatten": {++ "version": "1.1.1",++ "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",++ "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==",++ "license": "MIT"++ },++ "node_modules/body-parser": {++ "version": "1.20.9",++ "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.9.tgz",++ "integrity": "sha512-FISIQxV5u91Y9gvuFq3q/tA/qTqLJn3AhRcEvyozyhJTh5OBFFtv827AdHU7Rbyct4r+Ba1/99oFa1Y3yuFsdw==",++ "license": "MIT",++ "dependencies": {++ "bytes": "~3.1.2",++ "content-type": "~1.0.5",++ "debug": "2.6.9",++ "depd": "2.0.0",++ "destroy": "~1.2.0",++ "http-errors": "~2.0.1",++ "iconv-lite": "~0.4.24",++ "on-finished": "~2.4.1",++ "qs": "~6.16.0",++ "raw-body": "~2.5.3",++ "type-is": "~1.6.18",++ "unpipe": "~1.0.0"++ },++ "engines": {++ "node": ">= 0.8",++ "npm": "1.2.8000 || >= 1.4.16"++ }++ },++ "node_modules/boolbase": {++ "version": "2.0.0",++ "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-2.0.0.tgz",++ "integrity": "sha512-DkVaaQHymRhpYEYo9x1oo7Q7B0Y6KJUsjm3c9eTyFDby4MHLBTwZ6ZDWBel5zrYxj1WsZgC5oLpiz+93MluXeA==",++ "license": "ISC",++ "engines": {++ "node": ">=20.19.0"++ },++ "funding": {++ "type": "github",++ "url": "https://github.com/sponsors/fb55"++ }++ },++ "node_modules/buffer-equal-constant-time": {++ "version": "1.0.1",++ "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz",++ "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==",++ "license": "BSD-3-Clause"++ },++ "node_modules/buffer-from": {++ "version": "1.1.2",++ "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz",++ "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==",++ "license": "MIT"++ },++ "node_modules/bytes": {++ "version": "3.1.2",++ "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",++ "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==",++ "license": "MIT",++ "engines": {++ "node": ">= 0.8"++ }++ },++ "node_modules/call-bind-apply-helpers": {++ "version": "1.0.2",++ "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",++ "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==",++ "license": "MIT",++ "dependencies": {++ "es-errors": "^1.3.0",++ "function-bind": "^1.1.2"++ },++ "engines": {++ "node": ">= 0.4"++ }++ },++ "node_modules/call-bound": {++ "version": "1.0.4",++ "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz",++ "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==",++ "license": "MIT",++ "dependencies": {++ "call-bind-apply-helpers": "^1.0.2",++ "get-intrinsic": "^1.3.0"++ },++ "engines": {++ "node": ">= 0.4"++ },++ "funding": {++ "url": "https://github.com/sponsors/ljharb"++ }++ },++ "node_modules/clean-css": {++ "version": "5.3.3",++ "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.3.3.tgz",++ "integrity": "sha512-D5J+kHaVb/wKSFcyyV75uCn8fiY4sV38XJoe4CUyGQ+mOU/fMVYUdH1hJC+CJQ5uY3EnW27SbJYS4X8BiLrAFg==",++ "license": "MIT",++ "dependencies": {++ "source-map": "~0.6.0"++ },++ "engines": {++ "node": ">= 10.0"++ }++ },++ "node_modules/commander": {++ "version": "2.20.3",++ "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",++ "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",++ "license": "MIT"++ },++ "node_modules/content-disposition": {++ "version": "0.5.4",++ "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz",++ "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==",++ "license": "MIT",++ "dependencies": {++ "safe-buffer": "5.2.1"++ },++ "engines": {++ "node": ">= 0.6"++ }++ },++ "node_modules/content-type": {++ "version": "1.0.5",++ "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz",++ "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==",++ "license": "MIT",++ "engines": {++ "node": ">= 0.6"++ }++ },++ "node_modules/cookie": {++ "version": "0.7.2",++ "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz",++ "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==",++ "license": "MIT",++ "engines": {++ "node": ">= 0.6"++ }++ },++ "node_modules/cookie-signature": {++ "version": "1.0.7",++ "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.7.tgz",++ "integrity": "sha512-NXdYc3dLr47pBkpUCHtKSwIOQXLVn8dZEuywboCOJY/osA0wFSLlSawr3KN8qXJEyX66FcONTH8EIlVuK0yyFA==",++ "license": "MIT"++ },++ "node_modules/css-select": {++ "version": "7.0.0",++ "resolved": "https://registry.npmjs.org/css-select/-/css-select-7.0.0.tgz",++ "integrity": "sha512-snmjEVXy+1LnwXdxhYvTMj1d9tOh4HxkA1YmoayVBeeyR2C14Pum7fcxJIm4SswYspVy866eYNwlH6xC3/VH5g==",++ "license": "BSD-2-Clause",++ "dependencies": {++ "boolbase": "^2.0.0",++ "css-what": "^8.0.0",++ "domhandler": "^6.0.1",++ "domutils": "^4.0.2",++ "nth-check": "^3.0.1"++ },++ "engines": {++ "node": ">=20.19.0"++ },++ "funding": {++ "type": "github",++ "url": "https://github.com/sponsors/fb55"++ }++ },++ "node_modules/css-what": {++ "version": "8.0.0",++ "resolved": "https://registry.npmjs.org/css-what/-/css-what-8.0.0.tgz",++ "integrity": "sha512-DH0Bqq3DNp5tdOReuNyAA+Ev4Y2GS5FMbZpeTLP6C4CDi0h5nL0BmUPChXw3o/qbHLDWHl49sbNqQVY7bMSDdw==",++ "license": "BSD-2-Clause",++ "engines": {++ "node": ">=20.19.0"++ },++ "funding": {++ "type": "github",++ "url": "https://github.com/sponsors/fb55"++ }++ },++ "node_modules/cssomnom": {++ "version": "0.1.12",++ "resolved": "https://registry.npmjs.org/cssomnom/-/cssomnom-0.1.12.tgz",++ "integrity": "sha512-nlsLjRxRN2RPomw3r+e+oD3KQBbEbKK0+oBUATbodf5N38FlOMg/5nqV0CdClNvpVsjFLikD63H6dgKTgeuuUg==",++ "license": "Apache-2.0",++ "engines": {++ "node": ">=20.0.0"++ }++ },++ "node_modules/debug": {++ "version": "2.6.9",++ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",++ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",++ "license": "MIT",++ "dependencies": {++ "ms": "2.0.0"++ }++ },++ "node_modules/depd": {++ "version": "2.0.0",++ "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",++ "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==",++ "license": "MIT",++ "engines": {++ "node": ">= 0.8"++ }++ },++ "node_modules/destroy": {++ "version": "1.2.0",++ "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz",++ "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==",++ "license": "MIT",++ "engines": {++ "node": ">= 0.8",++ "npm": "1.2.8000 || >= 1.4.16"++ }++ },++ "node_modules/dom-serializer": {++ "version": "3.1.1",++ "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-3.1.1.tgz",++ "integrity": "sha512-4MEa38/QexBob6gFNwu+EGdWvhJ1OKuNwdYY3Y3NyeWDQfnGeDYQUDfIRzWu5B5gsv03so2Uxd28YC6zrsx3Lw==",++ "license": "MIT",++ "dependencies": {++ "domelementtype": "^3.0.0",++ "domhandler": "^6.0.0",++ "entities": "^8.0.0"++ },++ "engines": {++ "node": ">=20.19.0"++ },++ "funding": {++ "type": "github",++ "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1"++ }++ },++ "node_modules/domelementtype": {++ "version": "3.0.0",++ "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-3.0.0.tgz",++ "integrity": "sha512-umCQid3jKbDmVjx8jGaW7uUykm4DEUeyV21hPxNMo2nV955DhUThwqyOIDtreepP31hl84X7G5U9ZfsWvIB3Pg==",++ "funding": [++ {++ "type": "github",++ "url": "https://github.com/sponsors/fb55"++ }++ ],++ "license": "BSD-2-Clause",++ "engines": {++ "node": ">=20.19.0"++ }++ },++ "node_modules/domhandler": {++ "version": "6.0.1",++ "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-6.0.1.tgz",++ "integrity": "sha512-gYzvtM72ZtxQO0T048kd6HWSbbGCNOUwcnfQ01cqIJ4X2IYKFFHZ5mKvrQETcFXxsRObZulDaKmy//R7TPtsBg==",++ "license": "BSD-2-Clause",++ "dependencies": {++ "domelementtype": "^3.0.0"++ },++ "engines": {++ "node": ">=20.19.0"++ },++ "funding": {++ "type": "github",++ "url": "https://github.com/fb55/domhandler?sponsor=1"++ }++ },++ "node_modules/domutils": {++ "version": "4.0.2",++ "resolved": "https://registry.npmjs.org/domutils/-/domutils-4.0.2.tgz",++ "integrity": "sha512-qI4JLRKnSzqFqr7hAlS5xQDusBCjKSEG4t4+7aNrIQMHBcsC2TGEhuyABJdYkgSewL57PNLYEiibY2iPKhKpaA==",++ "license": "BSD-2-Clause",++ "dependencies": {++ "dom-serializer": "^3.0.0",++ "domelementtype": "^3.0.0",++ "domhandler": "^6.0.0"++ },++ "engines": {++ "node": ">=20.19.0"++ },++ "funding": {++ "type": "github",++ "url": "https://github.com/fb55/domutils?sponsor=1"++ }++ },++ "node_modules/dunder-proto": {++ "version": "1.0.1",++ "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",++ "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",++ "license": "MIT",++ "dependencies": {++ "call-bind-apply-helpers": "^1.0.1",++ "es-errors": "^1.3.0",++ "gopd": "^1.2.0"++ },++ "engines": {++ "node": ">= 0.4"++ }++ },++ "node_modules/ecdsa-sig-formatter": {++ "version": "1.0.11",++ "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz",++ "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==",++ "license": "Apache-2.0",++ "dependencies": {++ "safe-buffer": "^5.0.1"++ }++ },++ "node_modules/ee-first": {++ "version": "1.1.1",++ "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",++ "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==",++ "license": "MIT"++ },++ "node_modules/encodeurl": {++ "version": "2.0.3",++ "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.3.tgz",++ "integrity": "sha512-mIteYONiEfc4xWf2F1WXovh1c8npzS00vNeiUPdwFF+QlVJni+gNvpQltLMQhob8rew/bWWc/bGTuUr0EUGt0w==",++ "license": "MIT",++ "engines": {++ "node": ">= 0.8"++ },++ "funding": {++ "type": "opencollective",++ "url": "https://opencollective.com/express"++ }++ },++ "node_modules/entities": {++ "version": "8.1.0",++ "resolved": "https://registry.npmjs.org/entities/-/entities-8.1.0.tgz",++ "integrity": "sha512-kxL7msIffSuh9aaFAMD7rxAIuTRMAHMeBtgHW2yUdWw732ZNh4MehkF2gdjvtdmikkaIP9bFDDJOPlsvm7avrA==",++ "license": "BSD-2-Clause",++ "engines": {++ "node": ">=20.19.0"++ },++ "funding": {++ "url": "https://github.com/fb55/entities?sponsor=1"++ }++ },++ "node_modules/es-define-property": {++ "version": "1.0.1",++ "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz",++ "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",++ "license": "MIT",++ "engines": {++ "node": ">= 0.4"++ }++ },++ "node_modules/es-errors": {++ "version": "1.3.0",++ "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",++ "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",++ "license": "MIT",++ "engines": {++ "node": ">= 0.4"++ }++ },++ "node_modules/es-object-atoms": {++ "version": "1.1.2",++ "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz",++ "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==",++ "license": "MIT",++ "dependencies": {++ "es-errors": "^1.3.0"++ },++ "engines": {++ "node": ">= 0.4"++ }++ },++ "node_modules/escape-html": {++ "version": "1.0.3",++ "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",++ "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==",++ "license": "MIT"++ },++ "node_modules/etag": {++ "version": "1.8.1",++ "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",++ "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==",++ "license": "MIT",++ "engines": {++ "node": ">= 0.6"++ }++ },++ "node_modules/express": {++ "version": "4.22.3",++ "resolved": "https://registry.npmjs.org/express/-/express-4.22.3.tgz",++ "integrity": "sha512-Bdcs4+3qlpVlx2NRn6fgX2Ue2/gGRaPeawebgclM0ERSCqDpA+owF1fdPwjJUTAJWMTuAaxjDf+hzb0/4eKvvw==",++ "license": "MIT",++ "dependencies": {++ "accepts": "~1.3.8",++ "array-flatten": "1.1.1",++ "body-parser": "~1.20.5",++ "content-disposition": "~0.5.4",++ "content-type": "~1.0.4",++ "cookie": "~0.7.1",++ "cookie-signature": "~1.0.6",++ "debug": "2.6.9",++ "depd": "2.0.0",++ "encodeurl": "~2.0.0",++ "escape-html": "~1.0.3",++ "etag": "~1.8.1",++ "finalhandler": "~1.3.1",++ "fresh": "~0.5.2",++ "http-errors": "~2.0.0",++ "merge-descriptors": "1.0.3",++ "methods": "~1.1.2",++ "on-finished": "~2.4.1",++ "parseurl": "~1.3.3",++ "path-to-regexp": "~0.1.13",++ "proxy-addr": "~2.0.7",++ "qs": "~6.16.0",++ "range-parser": "~1.2.1",++ "safe-buffer": "5.2.1",++ "send": "~0.19.0",++ "serve-static": "~1.16.2",++ "setprototypeof": "1.2.0",++ "statuses": "~2.0.1",++ "type-is": "~1.6.18",++ "utils-merge": "1.0.1",++ "vary": "~1.1.2"++ },++ "engines": {++ "node": ">= 0.10.0"++ },++ "funding": {++ "type": "opencollective",++ "url": "https://opencollective.com/express"++ }++ },++ "node_modules/finalhandler": {++ "version": "1.3.2",++ "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.2.tgz",++ "integrity": "sha512-aA4RyPcd3badbdABGDuTXCMTtOneUCAYH/gxoYRTZlIJdF0YPWuGqiAsIrhNnnqdXGswYk6dGujem4w80UJFhg==",++ "license": "MIT",++ "dependencies": {++ "debug": "2.6.9",++ "encodeurl": "~2.0.0",++ "escape-html": "~1.0.3",++ "on-finished": "~2.4.1",++ "parseurl": "~1.3.3",++ "statuses": "~2.0.2",++ "unpipe": "~1.0.0"++ },++ "engines": {++ "node": ">= 0.8"++ }++ },++ "node_modules/forwarded": {++ "version": "0.2.0",++ "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",++ "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==",++ "license": "MIT",++ "engines": {++ "node": ">= 0.6"++ }++ },++ "node_modules/fresh": {++ "version": "0.5.2",++ "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",++ "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==",++ "license": "MIT",++ "engines": {++ "node": ">= 0.6"++ }++ },++ "node_modules/function-bind": {++ "version": "1.1.2",++ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",++ "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",++ "license": "MIT",++ "funding": {++ "url": "https://github.com/sponsors/ljharb"++ }++ },++ "node_modules/get-intrinsic": {++ "version": "1.3.0",++ "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",++ "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==",++ "license": "MIT",++ "dependencies": {++ "call-bind-apply-helpers": "^1.0.2",++ "es-define-property": "^1.0.1",++ "es-errors": "^1.3.0",++ "es-object-atoms": "^1.1.1",++ "function-bind": "^1.1.2",++ "get-proto": "^1.0.1",++ "gopd": "^1.2.0",++ "has-symbols": "^1.1.0",++ "hasown": "^2.0.2",++ "math-intrinsics": "^1.1.0"++ },++ "engines": {++ "node": ">= 0.4"++ },++ "funding": {++ "url": "https://github.com/sponsors/ljharb"++ }++ },++ "node_modules/get-proto": {++ "version": "1.0.1",++ "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz",++ "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",++ "license": "MIT",++ "dependencies": {++ "dunder-proto": "^1.0.1",++ "es-object-atoms": "^1.0.0"++ },++ "engines": {++ "node": ">= 0.4"++ }++ },++ "node_modules/gopd": {++ "version": "1.2.0",++ "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",++ "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",++ "license": "MIT",++ "engines": {++ "node": ">= 0.4"++ },++ "funding": {++ "url": "https://github.com/sponsors/ljharb"++ }++ },++ "node_modules/has-symbols": {++ "version": "1.1.0",++ "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz",++ "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==",++ "license": "MIT",++ "engines": {++ "node": ">= 0.4"++ },++ "funding": {++ "url": "https://github.com/sponsors/ljharb"++ }++ },++ "node_modules/hasown": {++ "version": "2.0.4",++ "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz",++ "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==",++ "license": "MIT",++ "dependencies": {++ "function-bind": "^1.1.2"++ },++ "engines": {++ "node": ">= 0.4"++ }++ },++ "node_modules/html-escaper": {++ "version": "3.0.3",++ "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-3.0.3.tgz",++ "integrity": "sha512-RuMffC89BOWQoY0WKGpIhn5gX3iI54O6nRA0yC124NYVtzjmFWBIiFd8M0x+ZdX0P9R4lADg1mgP8C7PxGOWuQ==",++ "license": "MIT"++ },++ "node_modules/htmlparser2": {++ "version": "10.1.0",++ "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-10.1.0.tgz",++ "integrity": "sha512-VTZkM9GWRAtEpveh7MSF6SjjrpNVNNVJfFup7xTY3UpFtm67foy9HDVXneLtFVt4pMz5kZtgNcvCniNFb1hlEQ==",++ "funding": [++ "https://github.com/fb55/htmlparser2?sponsor=1",++ {++ "type": "github",++ "url": "https://github.com/sponsors/fb55"++ }++ ],++ "license": "MIT",++ "dependencies": {++ "domelementtype": "^2.3.0",++ "domhandler": "^5.0.3",++ "domutils": "^3.2.2",++ "entities": "^7.0.1"++ }++ },++ "node_modules/htmlparser2/node_modules/dom-serializer": {++ "version": "2.0.0",++ "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz",++ "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==",++ "license": "MIT",++ "dependencies": {++ "domelementtype": "^2.3.0",++ "domhandler": "^5.0.2",++ "entities": "^4.2.0"++ },++ "funding": {++ "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1"++ }++ },++ "node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities": {++ "version": "4.5.0",++ "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz",++ "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==",++ "license": "BSD-2-Clause",++ "engines": {++ "node": ">=0.12"++ },++ "funding": {++ "url": "https://github.com/fb55/entities?sponsor=1"++ }++ },++ "node_modules/htmlparser2/node_modules/domelementtype": {++ "version": "2.3.0",++ "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz",++ "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==",++ "funding": [++ {++ "type": "github",++ "url": "https://github.com/sponsors/fb55"++ }++ ],++ "license": "BSD-2-Clause"++ },++ "node_modules/htmlparser2/node_modules/domhandler": {++ "version": "5.0.3",++ "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz",++ "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==",++ "license": "BSD-2-Clause",++ "dependencies": {++ "domelementtype": "^2.3.0"++ },++ "engines": {++ "node": ">= 4"++ },++ "funding": {++ "url": "https://github.com/fb55/domhandler?sponsor=1"++ }++ },++ "node_modules/htmlparser2/node_modules/domutils": {++ "version": "3.2.2",++ "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.2.2.tgz",++ "integrity": "sha512-6kZKyUajlDuqlHKVX1w7gyslj9MPIXzIFiz/rGu35uC1wMi+kMhQwGhl4lt9unC9Vb9INnY9Z3/ZA3+FhASLaw==",++ "license": "BSD-2-Clause",++ "dependencies": {++ "dom-serializer": "^2.0.0",++ "domelementtype": "^2.3.0",++ "domhandler": "^5.0.3"++ },++ "funding": {++ "url": "https://github.com/fb55/domutils?sponsor=1"++ }++ },++ "node_modules/htmlparser2/node_modules/entities": {++ "version": "7.0.1",++ "resolved": "https://registry.npmjs.org/entities/-/entities-7.0.1.tgz",++ "integrity": "sha512-TWrgLOFUQTH994YUyl1yT4uyavY5nNB5muff+RtWaqNVCAK408b5ZnnbNAUEWLTCpum9w6arT70i1XdQ4UeOPA==",++ "license": "BSD-2-Clause",++ "engines": {++ "node": ">=0.12"++ },++ "funding": {++ "url": "https://github.com/fb55/entities?sponsor=1"++ }++ },++ "node_modules/http-errors": {++ "version": "2.0.1",++ "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz",++ "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==",++ "license": "MIT",++ "dependencies": {++ "depd": "~2.0.0",++ "inherits": "~2.0.4",++ "setprototypeof": "~1.2.0",++ "statuses": "~2.0.2",++ "toidentifier": "~1.0.1"++ },++ "engines": {++ "node": ">= 0.8"++ },++ "funding": {++ "type": "opencollective",++ "url": "https://opencollective.com/express"++ }++ },++ "node_modules/iconv-lite": {++ "version": "0.4.24",++ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",++ "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",++ "license": "MIT",++ "dependencies": {++ "safer-buffer": ">= 2.1.2 < 3"++ },++ "engines": {++ "node": ">=0.10.0"++ }++ },++ "node_modules/inherits": {++ "version": "2.0.4",++ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",++ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",++ "license": "ISC"++ },++ "node_modules/ipaddr.js": {++ "version": "1.9.1",++ "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",++ "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==",++ "license": "MIT",++ "engines": {++ "node": ">= 0.10"++ }++ },++ "node_modules/jsonwebtoken": {++ "version": "9.0.3",++ "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.3.tgz",++ "integrity": "sha512-MT/xP0CrubFRNLNKvxJ2BYfy53Zkm++5bX9dtuPbqAeQpTVe0MQTFhao8+Cp//EmJp244xt6Drw/GVEGCUj40g==",++ "license": "MIT",++ "dependencies": {++ "jws": "^4.0.1",++ "lodash.includes": "^4.3.0",++ "lodash.isboolean": "^3.0.3",++ "lodash.isinteger": "^4.0.4",++ "lodash.isnumber": "^3.0.3",++ "lodash.isplainobject": "^4.0.6",++ "lodash.isstring": "^4.0.1",++ "lodash.once": "^4.0.0",++ "ms": "^2.1.1",++ "semver": "^7.5.4"++ },++ "engines": {++ "node": ">=12",++ "npm": ">=6"++ }++ },++ "node_modules/jsonwebtoken/node_modules/ms": {++ "version": "2.1.3",++ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",++ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",++ "license": "MIT"++ },++ "node_modules/jwa": {++ "version": "2.0.1",++ "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.1.tgz",++ "integrity": "sha512-hRF04fqJIP8Abbkq5NKGN0Bbr3JxlQ+qhZufXVr0DvujKy93ZCbXZMHDL4EOtodSbCWxOqR8MS1tXA5hwqCXDg==",++ "license": "MIT",++ "dependencies": {++ "buffer-equal-constant-time": "^1.0.1",++ "ecdsa-sig-formatter": "1.0.11",++ "safe-buffer": "^5.0.1"++ }++ },++ "node_modules/jws": {++ "version": "4.0.1",++ "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.1.tgz",++ "integrity": "sha512-EKI/M/yqPncGUUh44xz0PxSidXFr/+r0pA70+gIYhjv+et7yxM+s29Y+VGDkovRofQem0fs7Uvf4+YmAdyRduA==",++ "license": "MIT",++ "dependencies": {++ "jwa": "^2.0.1",++ "safe-buffer": "^5.0.1"++ }++ },++ "node_modules/linkedom": {++ "version": "0.18.15",++ "resolved": "https://registry.npmjs.org/linkedom/-/linkedom-0.18.15.tgz",++ "integrity": "sha512-o0w7eD/SvoCao+pUi6dzocCLuMR11g4Tv/et0W2OUzwWmUcewntSzyl+Ua/K+0yKym0Y/Mav3nFAaI5Av5jvZg==",++ "license": "ISC",++ "dependencies": {++ "css-select": "^7.0.0",++ "cssomnom": "^0.1.11",++ "html-escaper": "^3.0.3",++ "htmlparser2": "^10.1.0",++ "uhyphen": "^0.2.0"++ },++ "engines": {++ "node": ">=16"++ },++ "peerDependencies": {++ "canvas": ">= 2"++ },++ "peerDependenciesMeta": {++ "canvas": {++ "optional": true++ }++ }++ },++ "node_modules/lodash.includes": {++ "version": "4.3.0",++ "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz",++ "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==",++ "license": "MIT"++ },++ "node_modules/lodash.isboolean": {++ "version": "3.0.3",++ "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz",++ "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==",++ "license": "MIT"++ },++ "node_modules/lodash.isinteger": {++ "version": "4.0.4",++ "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz",++ "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==",++ "license": "MIT"++ },++ "node_modules/lodash.isnumber": {++ "version": "3.0.3",++ "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz",++ "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==",++ "license": "MIT"++ },++ "node_modules/lodash.isplainobject": {++ "version": "4.0.6",++ "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz",++ "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==",++ "license": "MIT"++ },++ "node_modules/lodash.isstring": {++ "version": "4.0.1",++ "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz",++ "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==",++ "license": "MIT"++ },++ "node_modules/lodash.once": {++ "version": "4.1.1",++ "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz",++ "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==",++ "license": "MIT"++ },++ "node_modules/math-intrinsics": {++ "version": "1.1.0",++ "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",++ "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==",++ "license": "MIT",++ "engines": {++ "node": ">= 0.4"++ }++ },++ "node_modules/media-typer": {++ "version": "0.3.0",++ "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",++ "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==",++ "license": "MIT",++ "engines": {++ "node": ">= 0.6"++ }++ },++ "node_modules/merge-descriptors": {++ "version": "1.0.3",++ "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz",++ "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==",++ "license": "MIT",++ "funding": {++ "url": "https://github.com/sponsors/sindresorhus"++ }++ },++ "node_modules/methods": {++ "version": "1.1.2",++ "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",++ "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==",++ "license": "MIT",++ "engines": {++ "node": ">= 0.6"++ }++ },++ "node_modules/mime": {++ "version": "1.6.0",++ "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",++ "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==",++ "license": "MIT",++ "bin": {++ "mime": "cli.js"++ },++ "engines": {++ "node": ">=4"++ }++ },++ "node_modules/mime-db": {++ "version": "1.52.0",++ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",++ "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",++ "license": "MIT",++ "engines": {++ "node": ">= 0.6"++ }++ },++ "node_modules/mime-types": {++ "version": "2.1.35",++ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",++ "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",++ "license": "MIT",++ "dependencies": {++ "mime-db": "1.52.0"++ },++ "engines": {++ "node": ">= 0.6"++ }++ },++ "node_modules/ms": {++ "version": "2.0.0",++ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",++ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==",++ "license": "MIT"++ },++ "node_modules/negotiator": {++ "version": "0.6.3",++ "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz",++ "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==",++ "license": "MIT",++ "engines": {++ "node": ">= 0.6"++ }++ },++ "node_modules/nth-check": {++ "version": "3.0.1",++ "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-3.0.1.tgz",++ "integrity": "sha512-GX0gsdbGVCgnRgbeGaubfjpBXyYRWOOCVeYh08bSQvDZqxz5ndXs1OTfAt/h36G1xvI94YIspsI0sVFqAV9+RQ==",++ "license": "BSD-2-Clause",++ "dependencies": {++ "boolbase": "^2.0.0"++ },++ "engines": {++ "node": ">=20.19.0"++ },++ "funding": {++ "type": "github",++ "url": "https://github.com/fb55/nth-check?sponsor=1"++ }++ },++ "node_modules/object-inspect": {++ "version": "1.13.4",++ "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz",++ "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==",++ "license": "MIT",++ "engines": {++ "node": ">= 0.4"++ },++ "funding": {++ "url": "https://github.com/sponsors/ljharb"++ }++ },++ "node_modules/on-finished": {++ "version": "2.4.2",++ "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.2.tgz",++ "integrity": "sha512-ATWUv387i+nLD49EiDoOft5scf32Vsdz3ktrQJG9bi7jRFmaXTssvyvj1EmeKVVgvesbqUtvQQvaS2TpTukAZQ==",++ "license": "MIT",++ "dependencies": {++ "ee-first": "1.1.1"++ },++ "engines": {++ "node": ">= 0.8"++ },++ "funding": {++ "type": "opencollective",++ "url": "https://opencollective.com/express"++ }++ },++ "node_modules/openvibe-sdk": {++ "version": "0.187.0",++ "resolved": "https://git.openvibe.codes/api/v1/repos/openvibers/openvibe.sdk/archive/v0.187.0.tar.gz",++ "integrity": "sha512-usvpN1PvjhtWF1IRuxI3zn34j+DG3UM79xVOFI4nQFpgOFPzHR4V+4EjsCLBENgW8BI1dWegHAibEGCOjWkcAg==",++ "license": "MIT",++ "bin": {++ "openvibe-download": "bin/openvibe-download.js"++ },++ "engines": {++ "node": ">=20"++ },++ "peerDependencies": {++ "@electric-sql/pglite": "^0.5.8",++ "iovalkey": "^0.4.0",++ "pg": "^8.23.0"++ },++ "peerDependenciesMeta": {++ "@electric-sql/pglite": {++ "optional": true++ },++ "iovalkey": {++ "optional": true++ },++ "pg": {++ "optional": true++ }++ }++ },++ "node_modules/openvibe-shared": {++ "version": "4.314.0",++ "resolved": "https://git.openvibe.codes/api/v1/repos/openvibers/openvibe.shared/archive/v4.314.0.tar.gz",++ "integrity": "sha512-f+xvo4A55iHoUMZ8pNgeK0t+ocrJveQRehP4zgv11oFUFFPg3KYmp0Y9Knq24ApK0ibk5p5okzhNj1UR/lxchw==",++ "license": "MIT",++ "dependencies": {++ "clean-css": "^5.3.3",++ "jsonwebtoken": "^9.0.0",++ "linkedom": "^0.18.13",++ "terser": "^5.51.2"++ },++ "bin": {++ "openvibe-build-assets": "scripts/build-assets.js",++ "ov-icon-audit": "scripts/icon-audit.js"++ }++ },++ "node_modules/parseurl": {++ "version": "1.3.3",++ "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",++ "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==",++ "license": "MIT",++ "engines": {++ "node": ">= 0.8"++ }++ },++ "node_modules/path-to-regexp": {++ "version": "0.1.13",++ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.13.tgz",++ "integrity": "sha512-A/AGNMFN3c8bOlvV9RreMdrv7jsmF9XIfDeCd87+I8RNg6s78BhJxMu69NEMHBSJFxKidViTEdruRwEk/WIKqA==",++ "license": "MIT"++ },++ "node_modules/pg": {++ "version": "8.23.1",++ "resolved": "https://registry.npmjs.org/pg/-/pg-8.23.1.tgz",++ "integrity": "sha512-aL96AHANtWjPLDOLqnhx+ngp9+UK7ETEU8VJrDCGvsSSi/mGLcWYsS6Herg7lmaBJe4uwrfqsa7gTEFaSizDoQ==",++ "license": "MIT",++ "dependencies": {++ "pg-connection-string": "^2.14.1",++ "pg-pool": "^3.14.0",++ "pg-protocol": "^1.16.1",++ "pg-types": "2.2.0",++ "pgpass": "1.0.5"++ },++ "engines": {++ "node": ">= 16.0.0"++ },++ "optionalDependencies": {++ "pg-cloudflare": "^1.4.1"++ },++ "peerDependencies": {++ "pg-native": ">=3.0.1"++ },++ "peerDependenciesMeta": {++ "pg-native": {++ "optional": true++ }++ }++ },++ "node_modules/pg-cloudflare": {++ "version": "1.4.1",++ "resolved": "https://registry.npmjs.org/pg-cloudflare/-/pg-cloudflare-1.4.1.tgz",++ "integrity": "sha512-6PQbsFWZcp9EmJEwy5cGQ2La+AMWpP46lgbb8X+U/XsHIUweYDNCpeuKck5RxL2MdVFi7krbbEi5nX4Zh7JhrQ==",++ "license": "MIT",++ "optional": true++ },++ "node_modules/pg-connection-string": {++ "version": "2.14.1",++ "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.14.1.tgz",++ "integrity": "sha512-qR3kGNPBLpCNtz0evbKA0Y/MRFXwSSdT+pTJvYp/bXTcReZbvX1kzF0IyTc1QnxqF7AZbOeBhNL8R5mYQZV/MA==",++ "license": "MIT"++ },++ "node_modules/pg-int8": {++ "version": "1.0.1",++ "resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz",++ "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==",++ "license": "ISC",++ "engines": {++ "node": ">=4.0.0"++ }++ },++ "node_modules/pg-pool": {++ "version": "3.14.0",++ "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.14.0.tgz",++ "integrity": "sha512-gKtPkFdQPU3DksooVLi9LsjZxrsBUZIpa+7aVx+LV5pNh0KzP4Zleud2po+ConrxbuXGBJ6Hfer6hdgpIBpBaw==",++ "license": "MIT",++ "peerDependencies": {++ "pg": ">=8.0"++ }++ },++ "node_modules/pg-protocol": {++ "version": "1.16.1",++ "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.16.1.tgz",++ "integrity": "sha512-p9VOFMiHB/ZbJATetbg+99PxssTVSQRnyuPSQ67mN1+1KBOjZaZ83ZQzltnxPhJwSsC3nwVjJ10DVJlerbFzLg==",++ "license": "MIT"++ },++ "node_modules/pg-types": {++ "version": "2.2.0",++ "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz",++ "integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==",++ "license": "MIT",++ "dependencies": {++ "pg-int8": "1.0.1",++ "postgres-array": "~2.0.0",++ "postgres-bytea": "~1.0.0",++ "postgres-date": "~1.0.4",++ "postgres-interval": "^1.1.0"++ },++ "engines": {++ "node": ">=4"++ }++ },++ "node_modules/pgpass": {++ "version": "1.0.5",++ "resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.5.tgz",++ "integrity": "sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==",++ "license": "MIT",++ "dependencies": {++ "split2": "^4.1.0"++ }++ },++ "node_modules/postgres-array": {++ "version": "2.0.0",++ "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz",++ "integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==",++ "license": "MIT",++ "engines": {++ "node": ">=4"++ }++ },++ "node_modules/postgres-bytea": {++ "version": "1.0.1",++ "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.1.tgz",++ "integrity": "sha512-5+5HqXnsZPE65IJZSMkZtURARZelel2oXUEO8rH83VS/hxH5vv1uHquPg5wZs8yMAfdv971IU+kcPUczi7NVBQ==",++ "license": "MIT",++ "engines": {++ "node": ">=0.10.0"++ }++ },++ "node_modules/postgres-date": {++ "version": "1.0.7",++ "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz",++ "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==",++ "license": "MIT",++ "engines": {++ "node": ">=0.10.0"++ }++ },++ "node_modules/postgres-interval": {++ "version": "1.2.0",++ "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz",++ "integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==",++ "license": "MIT",++ "dependencies": {++ "xtend": "^4.0.0"++ },++ "engines": {++ "node": ">=0.10.0"++ }++ },++ "node_modules/proxy-addr": {++ "version": "2.0.8",++ "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.8.tgz",++ "integrity": "sha512-5nnx0yGyVUcY6t9RnWcARWtwT9F1D8O9rt08htPvnd49W1IgZtmLkhu9WfMzQj1cFxjHIO6connUNVW5k7AVyQ==",++ "license": "MIT",++ "dependencies": {++ "forwarded": "0.2.0",++ "ipaddr.js": "1.9.1"++ },++ "engines": {++ "node": ">= 0.10"++ },++ "funding": {++ "type": "opencollective",++ "url": "https://opencollective.com/express"++ }++ },++ "node_modules/qs": {++ "version": "6.16.2",++ "resolved": "https://registry.npmjs.org/qs/-/qs-6.16.2.tgz",++ "integrity": "sha512-VYdnB5S7/0IeXzBacUtwNAaM6d7Y/PgYnNC7bJCI6meqA/OgnsQbZMtVW8Dt2D1PHgbHGtYmhSoEIgvt7xZ2ZA==",++ "license": "BSD-3-Clause",++ "dependencies": {++ "es-define-property": "^1.0.1",++ "side-channel": "^1.1.1"++ },++ "engines": {++ "node": ">=0.6"++ },++ "funding": {++ "url": "https://github.com/sponsors/ljharb"++ }++ },++ "node_modules/range-parser": {++ "version": "1.2.1",++ "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",++ "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==",++ "license": "MIT",++ "engines": {++ "node": ">= 0.6"++ }++ },++ "node_modules/raw-body": {++ "version": "2.5.3",++ "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.3.tgz",++ "integrity": "sha512-s4VSOf6yN0rvbRZGxs8Om5CWj6seneMwK3oDb4lWDH0UPhWcxwOWw5+qk24bxq87szX1ydrwylIOp2uG1ojUpA==",++ "license": "MIT",++ "dependencies": {++ "bytes": "~3.1.2",++ "http-errors": "~2.0.1",++ "iconv-lite": "~0.4.24",++ "unpipe": "~1.0.0"++ },++ "engines": {++ "node": ">= 0.8"++ }++ },++ "node_modules/safe-buffer": {++ "version": "5.2.1",++ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",++ "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",++ "funding": [++ {++ "type": "github",++ "url": "https://github.com/sponsors/feross"++ },++ {++ "type": "patreon",++ "url": "https://www.patreon.com/feross"++ },++ {++ "type": "consulting",++ "url": "https://feross.org/support"++ }++ ],++ "license": "MIT"++ },++ "node_modules/safer-buffer": {++ "version": "2.1.2",++ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",++ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",++ "license": "MIT"++ },++ "node_modules/semver": {++ "version": "7.8.6",++ "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.6.tgz",++ "integrity": "sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==",++ "license": "ISC",++ "bin": {++ "semver": "bin/semver.js"++ },++ "engines": {++ "node": ">=10"++ }++ },++ "node_modules/send": {++ "version": "0.19.2",++ "resolved": "https://registry.npmjs.org/send/-/send-0.19.2.tgz",++ "integrity": "sha512-VMbMxbDeehAxpOtWJXlcUS5E8iXh6QmN+BkRX1GARS3wRaXEEgzCcB10gTQazO42tpNIya8xIyNx8fll1OFPrg==",++ "license": "MIT",++ "dependencies": {++ "debug": "2.6.9",++ "depd": "2.0.0",++ "destroy": "1.2.0",++ "encodeurl": "~2.0.0",++ "escape-html": "~1.0.3",++ "etag": "~1.8.1",++ "fresh": "~0.5.2",++ "http-errors": "~2.0.1",++ "mime": "1.6.0",++ "ms": "2.1.3",++ "on-finished": "~2.4.1",++ "range-parser": "~1.2.1",++ "statuses": "~2.0.2"++ },++ "engines": {++ "node": ">= 0.8.0"++ }++ },++ "node_modules/send/node_modules/ms": {++ "version": "2.1.3",++ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",++ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",++ "license": "MIT"++ },++ "node_modules/serve-static": {++ "version": "1.16.3",++ "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.3.tgz",++ "integrity": "sha512-x0RTqQel6g5SY7Lg6ZreMmsOzncHFU7nhnRWkKgWuMTu5NN0DR5oruckMqRvacAN9d5w6ARnRBXl9xhDCgfMeA==",++ "license": "MIT",++ "dependencies": {++ "encodeurl": "~2.0.0",++ "escape-html": "~1.0.3",++ "parseurl": "~1.3.3",++ "send": "~0.19.1"++ },++ "engines": {++ "node": ">= 0.8.0"++ }++ },++ "node_modules/setprototypeof": {++ "version": "1.2.0",++ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",++ "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==",++ "license": "ISC"++ },++ "node_modules/side-channel": {++ "version": "1.1.1",++ "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.1.tgz",++ "integrity": "sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==",++ "license": "MIT",++ "dependencies": {++ "es-errors": "^1.3.0",++ "object-inspect": "^1.13.4",++ "side-channel-list": "^1.0.1",++ "side-channel-map": "^1.0.1",++ "side-channel-weakmap": "^1.0.2"++ },++ "engines": {++ "node": ">= 0.4"++ },++ "funding": {++ "url": "https://github.com/sponsors/ljharb"++ }++ },++ "node_modules/side-channel-list": {++ "version": "1.0.1",++ "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.1.tgz",++ "integrity": "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==",++ "license": "MIT",++ "dependencies": {++ "es-errors": "^1.3.0",++ "object-inspect": "^1.13.4"++ },++ "engines": {++ "node": ">= 0.4"++ },++ "funding": {++ "url": "https://github.com/sponsors/ljharb"++ }++ },++ "node_modules/side-channel-map": {++ "version": "1.0.1",++ "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz",++ "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==",++ "license": "MIT",++ "dependencies": {++ "call-bound": "^1.0.2",++ "es-errors": "^1.3.0",++ "get-intrinsic": "^1.2.5",++ "object-inspect": "^1.13.3"++ },++ "engines": {++ "node": ">= 0.4"++ },++ "funding": {++ "url": "https://github.com/sponsors/ljharb"++ }++ },++ "node_modules/side-channel-weakmap": {++ "version": "1.0.2",++ "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz",++ "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==",++ "license": "MIT",++ "dependencies": {++ "call-bound": "^1.0.2",++ "es-errors": "^1.3.0",++ "get-intrinsic": "^1.2.5",++ "object-inspect": "^1.13.3",++ "side-channel-map": "^1.0.1"++ },++ "engines": {++ "node": ">= 0.4"++ },++ "funding": {++ "url": "https://github.com/sponsors/ljharb"++ }++ },++ "node_modules/source-map": {++ "version": "0.6.1",++ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",++ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",++ "license": "BSD-3-Clause",++ "engines": {++ "node": ">=0.10.0"++ }++ },++ "node_modules/source-map-support": {++ "version": "0.5.21",++ "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz",++ "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==",++ "license": "MIT",++ "dependencies": {++ "buffer-from": "^1.0.0",++ "source-map": "^0.6.0"++ }++ },++ "node_modules/split2": {++ "version": "4.2.0",++ "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz",++ "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==",++ "license": "ISC",++ "engines": {++ "node": ">= 10.x"++ }++ },++ "node_modules/statuses": {++ "version": "2.0.2",++ "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz",++ "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==",++ "license": "MIT",++ "engines": {++ "node": ">= 0.8"++ }++ },++ "node_modules/terser": {++ "version": "5.51.2",++ "resolved": "https://registry.npmjs.org/terser/-/terser-5.51.2.tgz",++ "integrity": "sha512-bWnjSNscmuI+GJze6ZupnHP8G/cTcsJF+bXCeQknk2SHQsgbNJnLrqiH9jZ2W4STPVXH2mDKKRX3iwPhc9Cn/Q==",++ "license": "BSD-2-Clause",++ "dependencies": {++ "@jridgewell/source-map": "^0.3.3",++ "acorn": "^8.15.0",++ "commander": "^2.20.0",++ "source-map-support": "~0.5.20"++ },++ "bin": {++ "terser": "bin/terser"++ },++ "engines": {++ "node": ">=10"++ }++ },++ "node_modules/toidentifier": {++ "version": "1.0.1",++ "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",++ "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==",++ "license": "MIT",++ "engines": {++ "node": ">=0.6"++ }++ },++ "node_modules/type-is": {++ "version": "1.6.18",++ "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",++ "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==",++ "license": "MIT",++ "dependencies": {++ "media-typer": "0.3.0",++ "mime-types": "~2.1.24"++ },++ "engines": {++ "node": ">= 0.6"++ }++ },++ "node_modules/uhyphen": {++ "version": "0.2.0",++ "resolved": "https://registry.npmjs.org/uhyphen/-/uhyphen-0.2.0.tgz",++ "integrity": "sha512-qz3o9CHXmJJPGBdqzab7qAYuW8kQGKNEuoHFYrBwV6hWIMcpAmxDLXojcHfFr9US1Pe6zUswEIJIbLI610fuqA==",++ "license": "ISC"++ },++ "node_modules/unpipe": {++ "version": "1.0.0",++ "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",++ "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==",++ "license": "MIT",++ "engines": {++ "node": ">= 0.8"++ }++ },++ "node_modules/utils-merge": {++ "version": "1.0.1",++ "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",++ "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==",++ "license": "MIT",++ "engines": {++ "node": ">= 0.4.0"++ }++ },++ "node_modules/vary": {++ "version": "1.1.2",++ "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",++ "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==",++ "license": "MIT",++ "engines": {++ "node": ">= 0.8"++ }++ },++ "node_modules/xtend": {++ "version": "4.0.2",++ "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",++ "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==",++ "license": "MIT",++ "engines": {++ "node": ">=0.4"++ }++ }++ }++}nnew file mode 100644@@@ -0,0 +1,23 @@++{++ "name": "openvibe-finance",++ "version": "0.1.0",++ "private": true,++ "description": "Your money, your rules, your data: accounts, CSV imports and a monthly picture, private to you",++ "main": "server/index.js",++ "scripts": {++ "start": "node server/index.js",++ "test": "node test/run.js",++ "test:pg": "FINANCE_TEST_STORE=pg node test/run.js"++ },++ "engines": {++ "node": ">=22"++ },++ "license": "AGPL-3.0-only",++ "dependencies": {++ "@electric-sql/pglite": "^0.5.8",++ "express": "^4.21.2",++ "openvibe-sdk": "https://git.openvibe.codes/api/v1/repos/openvibers/openvibe.sdk/archive/v0.187.0.tar.gz",++ "openvibe-shared": "https://git.openvibe.codes/api/v1/repos/openvibers/openvibe.shared/archive/v4.314.0.tar.gz",++ "pg": "^8.23.1"++ }++}nnew file mode 100644@@@ -0,0 +1,88 @@++/* OpenVibe.Finance: theme tokens only (kit.css defines them for both themes), phone first, 44 px targets. */++.fin { max-width: 860px; }++.fin h1 { margin: 0; font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); letter-spacing: -0.02em; }++.fin-head { display: grid; gap: 4px; margin: 0 0 14px; }++.fin-crumb { margin: 0; font-size: 14px; }++.fin-crumb a, .fin-foot a { color: var(--text-secondary, #9aa4b2); }++.fin-total { margin: 0; font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }++.fin-lede { max-width: 60ch; color: var(--text-secondary, #9aa4b2); font-size: 1.05rem; line-height: 1.55; }++.fin-hero { padding: 8px 0 4px; }++.fin-promises { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 10px; max-width: 62ch; }++.fin-promises li { padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border, #1f2937); line-height: 1.5; }++.fin-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: 12px;++ border: 1px solid var(--border, #1f2937); background: var(--surface, transparent); color: var(--text, #e8ecf3); font: inherit; font-weight: 600;++ text-decoration: none; cursor: pointer; transition: transform .12s ease, filter .12s ease; }++.fin-btn--primary { background: var(--accent, #5b8cff); border-color: transparent; color: var(--accent-contrast, #fff); }++.fin-btn--danger { border-color: var(--danger, #b91c1c); color: var(--danger, #fca5a5); }++.fin-btn:active { transform: scale(.97); }++.fin-error { padding: 10px 14px; border-radius: 12px; border: 1px solid var(--danger, #b91c1c); color: var(--danger, #fca5a5); }++.fin-said { padding: 10px 14px; border-radius: 12px; background: var(--accent-soft, rgba(91, 140, 255, .12)); }++.fin-empty, .fin-note { color: var(--text-secondary, #9aa4b2); line-height: 1.5; }++.fin-month-card { margin: 0 0 12px; }++.fin-month-link { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; padding: 12px 14px; border-radius: 14px;++ border: 1px solid var(--border, #1f2937); color: inherit; text-decoration: none; }++.fin-month-link > span:first-child { font-weight: 700; flex: 1 1 100%; }++.fin-in { color: var(--success, #22c55e); font-variant-numeric: tabular-nums; }++.fin-out { color: var(--text, #e8ecf3); font-variant-numeric: tabular-nums; }++.is-neg { color: var(--danger, #f87171); }++.fin-accounts, .fin-txns, .fin-bars { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }++.fin-account { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; padding: 10px 14px; border-radius: 14px;++ border: 1px solid var(--border, #1f2937); color: inherit; text-decoration: none; transition: border-color .12s ease, transform .12s ease; }++.fin-account:hover { border-color: var(--accent, #5b8cff); }++.fin-account:active { transform: scale(.99); }++.fin-account-name { display: grid; gap: 2px; min-width: 0; font-weight: 600; }++.fin-account-name small { font-weight: 400; color: var(--text-secondary, #9aa4b2); }++.fin-account-balance { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }++.fin-fold { margin: 0 0 10px; border: 1px solid var(--border, #1f2937); border-radius: 14px; padding: 0 14px; }++.fin-fold > summary { min-height: 48px; display: flex; align-items: center; font-weight: 600; cursor: pointer; }++.fin-form { display: grid; gap: 10px; padding-bottom: 12px; }++.fin-row { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }++.fin-field { display: grid; gap: 6px; font-weight: 600; min-width: 0; }++.fin-field input, .fin-field textarea { min-height: 44px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border, #1f2937);++ background: var(--bg-input, #0f1626); color: inherit; font: inherit; font-weight: 400; min-width: 0; }++.fin-field textarea { resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }++.fin-field input:focus-visible, .fin-field textarea:focus-visible { outline: 2px solid var(--accent, #5b8cff); outline-offset: 1px; }++.fin-chips { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }++.fin-chips legend { font-weight: 600; padding: 0; margin-bottom: 6px; width: 100%; }++.fin-chip { position: relative; display: inline-flex; }++.fin-chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }++.fin-chip span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--border, #1f2937);++ color: var(--text-secondary, #9aa4b2); font-size: 14px; transition: background .12s ease, color .12s ease; }++.fin-chip input:checked + span { background: var(--accent, #5b8cff); border-color: transparent; color: var(--accent-contrast, #fff); }++.fin-chip input:focus-visible + span { outline: 2px solid var(--accent, #5b8cff); outline-offset: 2px; }++.fin-check { display: flex; align-items: center; gap: 10px; min-height: 44px; }++.fin-check input { width: 20px; height: 20px; accent-color: var(--danger, #b91c1c); }++.fin-monthnav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 14px 0 10px; font-size: 14px; }++.fin-monthnav a { color: var(--text-secondary, #9aa4b2); min-height: 44px; display: inline-flex; align-items: center; }++.fin-txn { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px 12px; border-radius: 12px;++ border: 1px solid var(--border, #1f2937); }++.fin-txn-date { color: var(--text-secondary, #9aa4b2); font-size: 13px; font-variant-numeric: tabular-nums; padding-top: 2px; }++.fin-txn-what { display: grid; gap: 4px; min-width: 0; }++.fin-txn-what b, .fin-txn-what small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }++.fin-txn-what small { color: var(--text-secondary, #9aa4b2); }++.fin-txn-amount { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }++.fin-txn-amount.is-pos { color: var(--success, #22c55e); }++.fin-cat { display: flex; gap: 6px; align-items: center; }++.fin-cat input { min-height: 36px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--border, #1f2937); background: transparent; color: inherit;++ font: inherit; font-size: 13px; min-width: 0; flex: 1 1 auto; max-width: 220px; }++.fin-mini { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border, #1f2937); background: transparent; color: var(--text-secondary, #9aa4b2); font: inherit; font-size: 13px; cursor: pointer; }++.fin-sums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 14px; }++.fin-sums p { margin: 0; padding: 12px; border-radius: 14px; border: 1px solid var(--border, #1f2937); display: grid; gap: 2px; }++.fin-sums span { color: var(--text-secondary, #9aa4b2); font-size: 13px; }++.fin-sums b { font-size: 1.1rem; font-variant-numeric: tabular-nums; }++.fin-bars li { display: grid; grid-template-columns: minmax(0, 9rem) minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 36px; }++.fin-bar-name { display: flex; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }++.fin-bar-name small { color: var(--text-secondary, #9aa4b2); }++.fin-bar { height: 10px; border-radius: 999px; background: var(--surface-2, rgba(148, 163, 184, .15)); overflow: hidden; }++.fin-bar > span { display: block; height: 100%; width: var(--w); border-radius: inherit; background: var(--accent, #5b8cff); transition: width .3s ease; }++.fin-bar-sum { font-variant-numeric: tabular-nums; white-space: nowrap; }++.fin-sec { margin: 0 0 18px; }++.fin-sec h2 { font-size: 1.1rem; margin: 0 0 4px; }++@media (min-width: 900px) { .fin-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; } }++html[data-ov-motion="off"] .fin-btn, html[data-ov-motion="off"] .fin-account, html[data-ov-motion="off"] .fin-chip span, html[data-ov-motion="off"] .fin-bar > span { transition: none; }++html[data-ov-motion="off"] .fin-btn:active, html[data-ov-motion="off"] .fin-account:active { transform: none; }++/* The file picker: our button over a hidden native input (still reachable by keyboard and readers). */++.fin-file { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; cursor: pointer; }++.fin-file input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }++.fin-file input:focus-visible + .fin-btn { outline: 2px solid var(--accent, #5b8cff); outline-offset: 2px; }++.fin-file-name { color: var(--text-secondary, #9aa4b2); font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }nnew file mode 100644@@@ -0,0 +1,17 @@++// OpenVibe.Finance: a chosen CSV file goes into the paste box (the form posts the text; nothing leaves before Import).++(function () {++ document.addEventListener('change', function (e) {++ var input = e.target;++ if (!input || !input.matches || !input.matches('input[data-fin-file="csv"]') || !input.files || !input.files[0]) return;++ var file = input.files[0];++ input.setCustomValidity('');++ if (file.size > 4 * 1024 * 1024) { input.setCustomValidity('That file is over 4 MB. Export fewer months at a time.'); input.reportValidity(); input.value = ''; return; }++ var box = input.closest('form') && input.closest('form').querySelector('textarea[data-fin-csv]');++ if (!box) return;++ var reader = new FileReader();++ var named = input.closest('label') && input.closest('label').querySelector('[data-fin-file-name]');++ if (named) named.textContent = file.name;++ reader.onload = function () { box.value = String(reader.result || ''); };++ reader.readAsText(file);++ });++})();nnew file mode 100644@@@ -0,0 +1,170 @@++'use strict';++/**++ * OpenVibe.Finance (plan §L.2): the pages and the JSON API over one person's accounts and transactions.++ *++ * createApp({ db, vault, auth, baseUrl }) → an Express app++ * auth: openvibe-sdk/sso's client (router, optionalAuth); tests pass a stand-in that sets req.user.++ *++ * Pages: / (signed out: what it is; signed in: your accounts and this month), /accounts/:id (?m=YYYY-MM), /month,++ * /data (download or delete everything). API (JSON, the same person, same rules): /api/v1/accounts,++ * /api/v1/accounts/:id/transactions, /api/v1/accounts/:id/import (text/csv), /api/v1/months/:m, /api/v1/export.++ * Every write is same-origin (a page form) or a Bearer call; nothing is cached; every answer says noindex.++ */++const express = require('express');++const path = require('node:path');++const { createStore, FinanceError } = require('./store');++const { readCsv, readAmount } = require('./csv');++const v = require('./views');++++function createApp({ db, vault, auth, baseUrl = 'https://openvibe.finance', now = () => new Date() }) {++ const store = createStore({ db, vault });++ const app = express();++ app.disable('x-powered-by');++ app.set('trust proxy', 'loopback');++ try {++ const release = require('openvibe-shared/release').createRelease({ service: 'finance', root: path.join(__dirname, '..') });++ require('openvibe-shared/metrics').instrument(app, { service: 'finance', release: release.release });++ app.get('/release.json', release.handler);++ } catch { /* metrics are optional in tests */ }++ app.use((req, res, next) => {++ res.set({ 'X-Content-Type-Options': 'nosniff', 'Referrer-Policy': 'same-origin', 'X-Frame-Options': 'DENY', 'X-Robots-Tag': 'noindex, nofollow' });++ next();++ });++ app.get('/api/health', (_req, res) => res.json({ status: 'ok', service: 'finance' }));++ app.get('/api/ready', async (_req, res) => {++ try { await db.value('SELECT 1'); res.json({ status: 'ok', service: 'finance' }); } catch { res.status(503).json({ status: 'unavailable' }); }++ });++ app.get('/robots.txt', (_req, res) => res.type('text').send('User-agent: *\nAllow: /$\nDisallow: /\n'));++ app.use(express.static(path.join(__dirname, '..', 'public'), { maxAge: '1h' }));++ app.use('/shared', require('openvibe-shared/serve').handler());++ if (auth) app.use('/auth', auth.router(express));++ app.use(auth ? auth.optionalAuth() : (_req, _res, next) => next());++ app.use((req, res, next) => { res.set('Cache-Control', 'private, no-store'); next(); });++++ const who = (req) => (req.user && /^usr_/.test(String(req.user.subject_id || '')) ? String(req.user.subject_id) : null);++ const own = new URL(baseUrl).origin;++ const sameOrigin = (req) => {++ if (/^Bearer\s/i.test(String(req.get('authorization') || ''))) return true;++ const site = req.get('sec-fetch-site');++ if (site) return site === 'same-origin';++ const origin = req.get('origin');++ return !origin || origin === own;++ };++ const form = express.urlencoded({ extended: false, limit: '4mb' });++ const handle = (fn) => async (req, res, next) => {++ try { await fn(req, res); } catch (err) {++ if (err instanceof FinanceError) return req.path.startsWith('/api/') ? res.status(err.status).json({ error: err.message, code: err.code }) : res.status(err.status).send(v.page({ title: 'Something is wrong', body: `<p class="fin-error" role="alert">${v.esc(err.message)}</p><p><a href="/">Back</a></p>` }));++ next(err);++ }++ };++ const signIn = (req, res) => res.redirect(303, `/auth/login?next=${encodeURIComponent(req.originalUrl)}`);++ const thisMonth = () => now().toISOString().slice(0, 7);++ const monthOf = (q) => (/^\d{4}-(0[1-9]|1[0-2])$/.test(String(q || '')) ? String(q) : thisMonth());++ const said = (q) => {++ if (q.imported) { const [a, s] = String(q.imported).split(','); return `Imported ${Number(a) || 0} new transaction${Number(a) === 1 ? '' : 's'}${Number(s) ? `; ${Number(s)} already here` : ''}.`; }++ if (q.added) return 'Added.';++ if (q.deleted) return 'Everything is deleted.';++ return '';++ };++ /** A typed amount and its direction → signed cents, or null. */++ const amountOf = (text, direction) => { const c = readAmount(text); return c == null ? null : (direction === 'in' ? Math.abs(c) : -Math.abs(c)); };++++ // ── Pages ──++ app.get('/', handle(async (req, res) => {++ const me = who(req);++ if (!me) return res.send(v.welcome());++ res.send(v.home({ accounts: await store.accounts(me), month: await store.month(me, thisMonth()), o: { said: said(req.query) } }));++ }));++ app.post('/accounts', form, handle(async (req, res) => {++ const me = who(req);++ if (!me) return signIn(req, res);++ if (!sameOrigin(req)) return res.status(403).send('A change must come from openvibe.finance itself.');++ const opening = String(req.body.opening || '').trim() ? readAmount(req.body.opening) : 0;++ if (opening == null) return res.status(422).send(v.home({ accounts: await store.accounts(me), month: await store.month(me, thisMonth()), o: { error: 'The opening balance is not a number.' } }));++ const acc = await store.addAccount(me, { name: req.body.name, kind: req.body.kind, currency: req.body.currency, opening_cents: opening });++ res.redirect(303, `/accounts/${acc.id}?added=1`);++ }));++ app.get('/accounts/:id', handle(async (req, res) => {++ const me = who(req);++ if (!me) return signIn(req, res);++ const account = await store.account(me, req.params.id);++ if (!account) return res.status(404).send(v.page({ title: 'No such account', body: '<h1>No such account of yours</h1><p><a href="/">Your money</a></p>' }));++ const month = monthOf(req.query.m);++ const all = (await store.accounts(me)).find((a) => a.id === account.id);++ res.send(v.accountPage({ account, balance: all ? all.balance_cents : account.opening_cents, txns: await store.transactions(me, account.id, { month }), month, o: { said: said(req.query) } }));++ }));++ app.post('/accounts/:id/transactions', form, handle(async (req, res) => {++ const me = who(req);++ if (!me) return signIn(req, res);++ if (!sameOrigin(req)) return res.status(403).send('A change must come from openvibe.finance itself.');++ const cents = amountOf(req.body.amount, req.body.direction);++ if (cents == null) throw new FinanceError(422, 'finance.transaction.amount', 'The amount is not a number.');++ const t = await store.addTransaction(me, req.params.id, { posted_on: req.body.posted_on, amount_cents: cents, payee: req.body.payee, category: req.body.category });++ res.redirect(303, `/accounts/${encodeURIComponent(req.params.id)}?m=${t.posted_on.slice(0, 7)}&added=1`);++ }));++ app.post('/accounts/:id/import', form, handle(async (req, res) => {++ const me = who(req);++ if (!me) return signIn(req, res);++ if (!sameOrigin(req)) return res.status(403).send('A change must come from openvibe.finance itself.');++ const read = readCsv(req.body.csv);++ if (read.problem) throw new FinanceError(422, 'finance.import.unreadable', read.problem);++ const out = await store.importRows(me, req.params.id, read.rows);++ const latest = read.rows.map((r) => r.posted_on).sort().pop();++ res.redirect(303, `/accounts/${encodeURIComponent(req.params.id)}?m=${latest.slice(0, 7)}&imported=${out.added},${out.skipped}`);++ }));++ app.post('/transactions/:id/category', form, handle(async (req, res) => {++ const me = who(req);++ if (!me) return signIn(req, res);++ if (!sameOrigin(req)) return res.status(403).send('A change must come from openvibe.finance itself.');++ const t = await store.setCategory(me, req.params.id, req.body.category);++ res.redirect(303, `/accounts/${encodeURIComponent(t.account_id)}?m=${t.posted_on.slice(0, 7)}`);++ }));++ app.get('/month', handle(async (req, res) => {++ const me = who(req);++ if (!me) return signIn(req, res);++ res.send(v.monthPage({ m: await store.month(me, monthOf(req.query.m)) }));++ }));++ app.get('/data', handle(async (req, res) => {++ if (!who(req)) return signIn(req, res);++ res.send(v.dataPage({ o: { said: said(req.query) } }));++ }));++ app.get('/data/export', handle(async (req, res) => {++ const me = who(req);++ if (!me) return signIn(req, res);++ res.set('Content-Disposition', `attachment; filename="openvibe-finance-${thisMonth()}.json"`);++ res.json(await store.exportAll(me));++ }));++ app.post('/data/delete', form, handle(async (req, res) => {++ const me = who(req);++ if (!me) return signIn(req, res);++ if (!sameOrigin(req)) return res.status(403).send('A change must come from openvibe.finance itself.');++ if (req.body.sure !== 'yes') return res.status(422).send(v.dataPage({ o: { error: 'Tick the box to say you are sure.' } }));++ await store.removeAll(me);++ res.redirect(303, '/data?deleted=1');++ }));++++ // ── API (JSON) ──++ const api = express.Router();++ api.use((req, res, next) => { if (!who(req)) return res.status(401).json({ error: 'Sign in first.', code: 'finance.person' }); if (req.method !== 'GET' && !sameOrigin(req)) return res.status(403).json({ error: 'Cross-site writes are refused.', code: 'finance.cross_site' }); next(); });++ api.get('/accounts', handle(async (req, res) => res.json({ accounts: await store.accounts(who(req)) })));++ api.post('/accounts', express.json({ limit: '16kb' }), handle(async (req, res) => res.status(201).json(await store.addAccount(who(req), req.body || {}))));++ api.get('/accounts/:id/transactions', handle(async (req, res) => {++ if (!(await store.account(who(req), req.params.id))) throw new FinanceError(404, 'finance.account.not_found', 'No such account of yours.');++ res.json({ transactions: await store.transactions(who(req), req.params.id, { month: req.query.m ? String(req.query.m) : null }) });++ }));++ api.post('/accounts/:id/transactions', express.json({ limit: '16kb' }), handle(async (req, res) => res.status(201).json(await store.addTransaction(who(req), req.params.id, req.body || {}))));++ api.post('/accounts/:id/import', express.text({ type: ['text/csv', 'text/plain'], limit: '4mb' }), handle(async (req, res) => {++ const read = readCsv(typeof req.body === 'string' ? req.body : '');++ if (read.problem) throw new FinanceError(422, 'finance.import.unreadable', read.problem);++ res.status(201).json({ ...(await store.importRows(who(req), req.params.id, read.rows)), unreadable: read.skipped.slice(0, 50) });++ }));++ api.get('/months/:m', handle(async (req, res) => res.json(await store.month(who(req), req.params.m))));++ api.get('/export', handle(async (req, res) => res.json(await store.exportAll(who(req)))));++ app.use('/api/v1', api);++++ app.use((_req, res) => res.status(404).send(v.page({ title: 'Not here', body: '<h1>Not here</h1><p><a href="/">Your money</a></p>' })));++ app.use((err, _req, res, _next) => { console.error('[finance]', err && err.message); res.status(500).send('Something went wrong on our side.'); });++ return app;++}++++module.exports = { createApp };nnew file mode 100644@@@ -0,0 +1,60 @@++'use strict';++/**++ * Per-person encryption of the words in a person's money data (plan §L.2, "hosted private: encrypted per person").++ *++ * const vault = createVault(process.env.FINANCE_DATA_KEY); // 32 bytes, base64++ * const sealed = vault.seal(subject, 'Whole Foods'); // 'v1.<iv>.<tag>.<ciphertext>' (base64url)++ * vault.open(subject, sealed) // 'Whole Foods'++ * vault.mark(subject, 'some text') // an HMAC: equal inputs, equal marks (dedupe)++ *++ * Each person's key is HKDF-SHA256 of the service key with their subject as the info, so one person's rows cannot be++ * opened with another's key, and a database copy without the service key reads as noise. This is encryption at rest:++ * the service holds the key and opens a row only to show it to its owner.++ */++const crypto = require('node:crypto');++++const SALT = Buffer.from('openvibe-finance/v1');++++function createVault(keyBase64) {++ const master = Buffer.from(String(keyBase64 || ''), 'base64');++ if (master.length !== 32) throw new Error('FINANCE_DATA_KEY must be 32 bytes, base64');++ const keys = new Map();++ const keyOf = (subject, use) => {++ const id = `${use}\u0000${subject}`;++ let k = keys.get(id);++ if (!k) {++ k = Buffer.from(crypto.hkdfSync('sha256', master, SALT, Buffer.from(id), 32));++ if (keys.size > 5000) keys.clear();++ keys.set(id, k);++ }++ return k;++ };++ const subjectOk = (subject) => {++ if (!/^usr_[0-9A-Za-z]{10,40}$/.test(String(subject || ''))) throw new Error('a person (usr_ subject) is required');++ };++ function seal(subject, text) {++ subjectOk(subject);++ const plain = String(text == null ? '' : text);++ if (!plain) return '';++ const iv = crypto.randomBytes(12);++ const c = crypto.createCipheriv('aes-256-gcm', keyOf(subject, 'seal'), iv);++ const body = Buffer.concat([c.update(plain, 'utf8'), c.final()]);++ return ['v1', iv.toString('base64url'), c.getAuthTag().toString('base64url'), body.toString('base64url')].join('.');++ }++ function open(subject, sealed) {++ subjectOk(subject);++ if (!sealed) return '';++ const [v, iv, tag, body] = String(sealed).split('.');++ if (v !== 'v1' || !iv || !tag || body == null) throw new Error('not a sealed value');++ const d = crypto.createDecipheriv('aes-256-gcm', keyOf(subject, 'seal'), Buffer.from(iv, 'base64url'));++ d.setAuthTag(Buffer.from(tag, 'base64url'));++ return Buffer.concat([d.update(Buffer.from(body, 'base64url')), d.final()]).toString('utf8');++ }++ function mark(subject, text) {++ subjectOk(subject);++ return crypto.createHmac('sha256', keyOf(subject, 'mark')).update(String(text)).digest('base64url');++ }++ return { seal, open, mark };++}++++module.exports = { createVault };nnew file mode 100644@@@ -0,0 +1,151 @@++'use strict';++/**++ * A bank's CSV export → transactions (plan §L.2: "manual entry, CSV … always free").++ *++ * readCsv(text) → { rows: [{ posted_on, amount_cents, payee, memo, category }], columns, skipped: [{ line, why }] }++ *++ * What banks send differs, so this reads the file rather than a fixed layout:++ * - the delimiter: comma, semicolon or tab, whichever splits the header into the most columns;++ * - quoted fields with commas, doubled quotes and line breaks inside;++ * - the columns by their header: a date, then either one signed amount or a debit and a credit, a payee or++ * description, a memo, a category;++ * - dates as 2026-11-18, 11/18/2026, 18/11/2026 (day first when a day over 12 says so, or when the file is++ * day-first throughout), 18.11.2026, 2026/11/18, and "Nov 18, 2026";++ * - amounts as -12.34, (12.34), $1,234.56, 1.234,56 (comma decimals), 12.34 CR / DR.++ * A row that cannot be read is skipped and said, never guessed.++ */++++const MAX_ROWS = 20000;++++function splitRows(text, delim) {++ const rows = [];++ let row = [], cell = '', quoted = false;++ for (let i = 0; i < text.length; i++) {++ const c = text[i];++ if (quoted) {++ if (c === '"') { if (text[i + 1] === '"') { cell += '"'; i++; } else quoted = false; }++ else cell += c;++ } else if (c === '"' && cell === '') quoted = true;++ else if (c === delim) { row.push(cell); cell = ''; }++ else if (c === '\n' || c === '\r') {++ if (c === '\r' && text[i + 1] === '\n') i++;++ row.push(cell); cell = '';++ if (row.length > 1 || row[0].trim() !== '') rows.push(row);++ row = [];++ if (rows.length > MAX_ROWS + 1) break;++ } else cell += c;++ }++ if (cell !== '' || row.length) { row.push(cell); if (row.length > 1 || row[0].trim() !== '') rows.push(row); }++ return rows;++}++++const norm = (h) => String(h || '').toLowerCase().replace(/[^a-z]/g, '');++const HEADERS = {++ date: ['date', 'transactiondate', 'posteddate', 'postingdate', 'bookingdate', 'valuedate', 'transdate', 'datum'],++ amount: ['amount', 'transactionamount', 'amountusd', 'value', 'betrag', 'montant', 'sum'],++ debit: ['debit', 'debitamount', 'withdrawal', 'withdrawals', 'moneyout', 'paidout', 'outflow', 'charge'],++ credit: ['credit', 'creditamount', 'deposit', 'deposits', 'moneyin', 'paidin', 'inflow', 'payment'],++ payee: ['payee', 'description', 'name', 'merchant', 'merchantname', 'details', 'transactiondescription', 'narrative', 'counterparty', 'originaldescription'],++ memo: ['memo', 'notes', 'note', 'reference', 'comment', 'extendeddescription'],++ category: ['category', 'categoryname'],++};++++function columnsOf(header) {++ const n = header.map(norm);++ const pick = (names) => { for (const name of names) { const i = n.indexOf(name); if (i >= 0) return i; } return -1; };++ const cols = {};++ for (const [k, names] of Object.entries(HEADERS)) cols[k] = pick(names);++ // "Description" as the payee when there is no payee column; otherwise the description is the memo.++ if (cols.payee >= 0 && cols.memo < 0) {++ const desc = n.indexOf('description');++ if (desc >= 0 && desc !== cols.payee) cols.memo = desc;++ }++ return cols;++}++++const MONTHS = { jan: 1, feb: 2, mar: 3, apr: 4, may: 5, jun: 6, jul: 7, aug: 8, sep: 9, sept: 9, oct: 10, nov: 11, dec: 12 };++const pad = (n) => String(n).padStart(2, '0');++const valid = (y, m, d) => {++ if (!(y >= 1900 && y <= 2200 && m >= 1 && m <= 12 && d >= 1 && d <= 31)) return null;++ const t = new Date(Date.UTC(y, m - 1, d));++ return t.getUTCMonth() === m - 1 ? `${y}-${pad(m)}-${pad(d)}` : null;++};++/** One date → 'YYYY-MM-DD' or null. `dayFirst`: read 01/02/2026 as the 1st of February. */++function readDate(s, dayFirst = false) {++ const t = String(s || '').trim();++ let m = /^(\d{4})[-/.](\d{1,2})[-/.](\d{1,2})/.exec(t);++ if (m) return valid(+m[1], +m[2], +m[3]);++ m = /^(\d{1,2})[/.-](\d{1,2})[/.-](\d{2,4})$/.exec(t);++ if (m) {++ let y = +m[3]; if (y < 100) y += 2000;++ const a = +m[1], b = +m[2];++ const sep = t.includes('.') ? '.' : null;++ const df = dayFirst || sep === '.' || a > 12;++ return df ? valid(y, b, a) : valid(y, a, b);++ }++ m = /^([A-Za-z]{3,4})[a-z]*\.? (\d{1,2}),? (\d{4})$/.exec(t);++ if (m && MONTHS[m[1].toLowerCase()]) return valid(+m[3], MONTHS[m[1].toLowerCase()], +m[2]);++ m = /^(\d{1,2}) ([A-Za-z]{3,4})[a-z]*\.? (\d{4})$/.exec(t);++ if (m && MONTHS[m[2].toLowerCase()]) return valid(+m[3], MONTHS[m[2].toLowerCase()], +m[1]);++ return null;++}++++/** One amount → integer cents (signed) or null. */++function readAmount(s) {++ let t = String(s == null ? '' : s).trim();++ if (!t) return null;++ let sign = 1;++ if (/^\(.*\)$/.test(t)) { sign = -1; t = t.slice(1, -1); }++ if (/\bDR$/i.test(t)) { sign = -1; t = t.replace(/\s*DR$/i, ''); }++ t = t.replace(/\s*CR$/i, '');++ t = t.replace(/[^\d.,\-+]/g, '');++ if (t.startsWith('-')) { sign = -sign; t = t.slice(1); } else if (t.startsWith('+')) t = t.slice(1);++ if (t.endsWith('-')) { sign = -sign; t = t.slice(0, -1); }++ if (!/\d/.test(t)) return null;++ // 1.234,56 or 12,34: a comma decimal when the last separator is a comma followed by 1-2 digits.++ const lastComma = t.lastIndexOf(','), lastDot = t.lastIndexOf('.');++ if (lastComma > lastDot && /,\d{1,2}$/.test(t)) t = t.replace(/\./g, '').replace(',', '.');++ else t = t.replace(/,/g, '');++ if (!/^\d+(\.\d+)?$/.test(t)) return null;++ const [whole, frac = ''] = t.split('.');++ const cents = Number(whole) * 100 + Number((frac + '00').slice(0, 2)) + (Number(frac[2] || 0) >= 5 ? 1 : 0);++ return Number.isSafeInteger(cents) ? sign * cents : null;++}++++function readCsv(text) {++ const src = String(text || '').replace(/^/, '');++ const firstLine = src.split(/\r?\n/, 1)[0] || '';++ const delim = [',', ';', '\t'].map((d) => [d, firstLine.split(d).length]).sort((a, b) => b[1] - a[1])[0][0];++ const all = splitRows(src, delim);++ if (all.length < 2) return { rows: [], columns: null, skipped: [], problem: 'The file has no rows under its header.' };++ const header = all[0];++ const cols = columnsOf(header);++ if (cols.date < 0) return { rows: [], columns: cols, skipped: [], problem: 'No date column: the header needs a column named Date (or Posted Date, Transaction Date).' };++ if (cols.amount < 0 && cols.debit < 0 && cols.credit < 0) return { rows: [], columns: cols, skipped: [], problem: 'No amount column: the header needs Amount, or Debit and Credit.' };++ const body = all.slice(1, MAX_ROWS + 1);++ // Day first when any date's first number is over 12 (and none's second is): the file is one layout throughout.++ let dayFirst = false;++ for (const r of body) {++ const m = /^(\d{1,2})[/-](\d{1,2})[/-]\d{2,4}$/.exec(String(r[cols.date] || '').trim());++ if (m && +m[1] > 12) { dayFirst = true; break; }++ }++ const rows = [], skipped = [];++ body.forEach((r, i) => {++ const line = i + 2;++ const posted_on = readDate(r[cols.date], dayFirst);++ if (!posted_on) { skipped.push({ line, why: `the date "${String(r[cols.date] || '').slice(0, 30)}" is not one this reads` }); return; }++ let amount = null;++ if (cols.amount >= 0) amount = readAmount(r[cols.amount]);++ if (amount == null && (cols.debit >= 0 || cols.credit >= 0)) {++ const out = cols.debit >= 0 ? readAmount(r[cols.debit]) : null;++ const inn = cols.credit >= 0 ? readAmount(r[cols.credit]) : null;++ if (out != null || inn != null) amount = (inn != null ? Math.abs(inn) : 0) - (out != null ? Math.abs(out) : 0);++ }++ if (amount == null) { skipped.push({ line, why: 'no amount' }); return; }++ const text = (k) => (cols[k] >= 0 ? String(r[cols[k]] || '').replace(/\s+/g, ' ').trim().slice(0, 300) : '');++ rows.push({ posted_on, amount_cents: amount, payee: text('payee'), memo: text('memo'), category: text('category').slice(0, 60) });++ });++ return { rows, columns: cols, skipped, problem: rows.length ? null : 'No row could be read.' };++}++++module.exports = { readCsv, readDate, readAmount, splitRows, columnsOf };nnew file mode 100644@@@ -0,0 +1,30 @@++'use strict';++/**++ * OpenVibe.Finance's process: the database (DATABASE_URL through PgBouncer; migrations on DATABASE_DIRECT_URL), the++ * vault (FINANCE_DATA_KEY), sign-in through OpenVibe.Network (OV_OAUTH_CLIENT_ID / OV_OAUTH_CLIENT_SECRET), and the++ * app on 127.0.0.1:PORT (5292). SIGTERM closes the server and the pool.++ */++const path = require('node:path');++const { createDb } = require('openvibe-sdk/db');++const { createSsoClient } = require('openvibe-sdk/sso');++const { createVault } = require('./crypto');++const { createApp } = require('./app');++++async function main() {++ const env = process.env;++ const port = Number(env.PORT || 5292);++ const baseUrl = env.BASE_URL || 'https://openvibe.finance';++ const db = createDb({ service: 'finance' });++ await db.migrate({ dir: path.join(__dirname, '..', 'migrations') });++ const vault = createVault(env.FINANCE_DATA_KEY);++ const auth = env.OV_OAUTH_CLIENT_ID && env.OV_OAUTH_CLIENT_SECRET ? createSsoClient({++ site: 'finance', siteName: 'OpenVibe.Finance', baseUrl, clientId: env.OV_OAUTH_CLIENT_ID, clientSecret: env.OV_OAUTH_CLIENT_SECRET,++ networkUrl: env.OV_NETWORK_URL || 'https://openvibe.network', networkInternalUrl: env.OV_NETWORK_INTERNAL_URL || 'http://127.0.0.1:4000',++ secureCookies: env.NODE_ENV === 'production',++ }) : null;++ if (!auth) console.warn('[finance] no OAuth client: sign-in is off');++ const server = createApp({ db, vault, auth, baseUrl }).listen(port, '127.0.0.1', () => console.log(`[finance] listening on 127.0.0.1:${port}`));++ process.on('SIGTERM', () => server.close(async () => { try { await db.close(); } finally { process.exit(0); } }));++}++++main().catch((err) => { console.error('[finance] could not start:', err && err.message); process.exit(1); });nnew file mode 100644@@@ -0,0 +1,197 @@++'use strict';++/**++ * A person's accounts and transactions (migrations/0001_finance.sql). Every function takes the person (owner, a usr_++ * subject) and reads or writes only their rows; payees and memos are sealed with their key (server/crypto.js) on the++ * way in and opened on the way out.++ *++ * const store = createStore({ db, vault });++ * accounts(owner) → [{ id, name, kind, currency, balance_cents, count, last_on }]++ * account(owner, id) → one, or null++ * addAccount(owner, { name, kind, currency, opening_cents })++ * transactions(owner, accountId, { month }) → [{ id, posted_on, amount_cents, payee, memo, category, category_from }]++ * addTransaction(owner, accountId, { posted_on, amount_cents, payee, memo, category })++ * setCategory(owner, id, category) a correction: a new revision, category_from 'you'++ * removeTransaction(owner, id)++ * importRows(owner, accountId, rows) → { import_id, read, added, skipped } (the same row twice is one)++ * month(owner, 'YYYY-MM') → { month, income_cents, spent_cents, by_category: [{ category, cents, count }] }++ * exportAll(owner) → everything, opened (the person's own copy)++ * removeAll(owner) → everything of theirs deleted++ */++const crypto = require('node:crypto');++++const KINDS = ['checking', 'savings', 'credit', 'cash', 'loan', 'investment', 'other'];++const CATEGORIES = ['Income', 'Housing', 'Utilities', 'Groceries', 'Eating out', 'Transport', 'Health', 'Insurance', 'Shopping',++ 'Subscriptions', 'Entertainment', 'Travel', 'Education', 'Gifts and giving', 'Fees', 'Transfers', 'Savings', 'Debt payments', 'Taxes', 'Other', 'Uncategorized'];++const newId = (prefix) => `${prefix}_${crypto.randomBytes(12).toString('base64url')}`;++const MONTH = /^\d{4}-(0[1-9]|1[0-2])$/;++const DAY = /^\d{4}-\d{2}-\d{2}$/;++++class FinanceError extends Error {++ constructor(status, code, message) { super(message); this.status = status; this.code = code; }++}++const fail = (status, code, message) => { throw new FinanceError(status, code, message); };++++function cleanCategory(c) {++ const t = String(c || '').replace(/\s+/g, ' ').trim().slice(0, 60);++ return t || 'Uncategorized';++}++++function createStore({ db, vault }) {++ const own = (owner) => { if (!/^usr_[0-9A-Za-z]{10,40}$/.test(String(owner || ''))) fail(401, 'finance.person', 'Sign in first.'); return owner; };++ const open = (owner, row) => ({++ id: row.id, account_id: row.account_id, posted_on: row.posted_on, amount_cents: Number(row.amount_cents),++ payee: vault.open(owner, row.payee_enc), memo: vault.open(owner, row.memo_enc),++ category: row.category, category_from: row.category_from, revision: row.revision,++ });++++ async function accounts(owner) {++ own(owner);++ const rows = await db.many(`SELECT a.id, a.name, a.kind, a.currency, a.opening_cents,++ COALESCE(SUM(t.amount_cents), 0)::bigint AS moved, COUNT(t.id)::int AS count, MAX(t.posted_on) AS last_on++ FROM finance_accounts a LEFT JOIN finance_transactions t ON t.account_id = a.id++ WHERE a.owner = $1 AND a.archived_at IS NULL GROUP BY a.id ORDER BY a.created_at, a.id`, [owner]);++ return rows.map((r) => ({ id: r.id, name: r.name, kind: r.kind, currency: r.currency, balance_cents: Number(r.opening_cents) + Number(r.moved), count: r.count, last_on: r.last_on || null }));++ }++++ async function account(owner, id) {++ own(owner);++ const r = await db.maybe('SELECT id, name, kind, currency, opening_cents FROM finance_accounts WHERE id = $1 AND owner = $2 AND archived_at IS NULL', [String(id || ''), owner]);++ return r ? { ...r, opening_cents: Number(r.opening_cents) } : null;++ }++++ async function addAccount(owner, input = {}) {++ own(owner);++ const name = String(input.name || '').replace(/\s+/g, ' ').trim().slice(0, 80);++ if (!name) fail(422, 'finance.account.name', 'Give the account a name.');++ const kind = KINDS.includes(input.kind) ? input.kind : 'checking';++ const currency = /^[A-Z]{3}$/.test(String(input.currency || '').toUpperCase()) ? String(input.currency).toUpperCase() : 'USD';++ const opening = Number.isSafeInteger(input.opening_cents) ? input.opening_cents : 0;++ const count = Number(await db.value('SELECT count(*) FROM finance_accounts WHERE owner = $1 AND archived_at IS NULL', [owner]));++ if (count >= 100) fail(422, 'finance.account.limit', 'A hundred accounts is the most for now.');++ const id = newId('acc');++ await db.exec('INSERT INTO finance_accounts (id, owner, name, kind, currency, opening_cents) VALUES ($1, $2, $3, $4, $5, $6)', [id, owner, name, kind, currency, opening]);++ return account(owner, id);++ }++++ async function transactions(owner, accountId, { month = null, limit = 500 } = {}) {++ own(owner);++ const args = [owner, String(accountId || '')];++ let where = 'owner = $1 AND account_id = $2';++ if (month) {++ if (!MONTH.test(month)) fail(422, 'finance.month', 'A month is YYYY-MM.');++ args.push(`${month}-01`);++ where += ` AND posted_on >= $3::date AND posted_on < ($3::date + interval '1 month')`;++ }++ const rows = await db.many(`SELECT * FROM finance_transactions WHERE ${where} ORDER BY posted_on DESC, created_at DESC, id LIMIT ${Math.max(1, Math.min(2000, Number(limit) || 500))}`, args);++ return rows.map((r) => open(owner, r));++ }++++ function checkRow(input) {++ const posted_on = String(input.posted_on || '');++ if (!DAY.test(posted_on) || Number.isNaN(Date.parse(`${posted_on}T00:00:00Z`))) fail(422, 'finance.transaction.date', 'A date is YYYY-MM-DD.');++ if (!Number.isSafeInteger(input.amount_cents) || Math.abs(input.amount_cents) > 1e13) fail(422, 'finance.transaction.amount', 'An amount is a number of cents.');++ return {++ posted_on, amount_cents: input.amount_cents,++ payee: String(input.payee || '').replace(/\s+/g, ' ').trim().slice(0, 300),++ memo: String(input.memo || '').replace(/\s+/g, ' ').trim().slice(0, 500),++ category: cleanCategory(input.category),++ };++ }++++ async function addTransaction(owner, accountId, input = {}) {++ own(owner);++ const acc = await account(owner, accountId);++ if (!acc) fail(404, 'finance.account.not_found', 'No such account of yours.');++ const r = checkRow(input);++ const id = newId('txn');++ await db.exec(`INSERT INTO finance_transactions (id, owner, account_id, posted_on, amount_cents, payee_enc, memo_enc, category, category_from)++ VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9)`,++ [id, owner, acc.id, r.posted_on, r.amount_cents, vault.seal(owner, r.payee), vault.seal(owner, r.memo), r.category, r.category === 'Uncategorized' ? 'none' : 'you']);++ return open(owner, await db.one('SELECT * FROM finance_transactions WHERE id = $1', [id]));++ }++++ async function setCategory(owner, id, category) {++ own(owner);++ const c = cleanCategory(category);++ const n = await db.exec(`UPDATE finance_transactions SET category = $3, category_from = 'you', revision = revision + 1, updated_at = now()++ WHERE id = $1 AND owner = $2`, [String(id || ''), owner, c]);++ if (!n) fail(404, 'finance.transaction.not_found', 'No such transaction of yours.');++ return open(owner, await db.one('SELECT * FROM finance_transactions WHERE id = $1', [String(id)]));++ }++++ async function removeTransaction(owner, id) {++ own(owner);++ await db.exec('DELETE FROM finance_transactions WHERE id = $1 AND owner = $2', [String(id || ''), owner]);++ }++++ async function importRows(owner, accountId, rows) {++ own(owner);++ const acc = await account(owner, accountId);++ if (!acc) fail(404, 'finance.account.not_found', 'No such account of yours.');++ const list = Array.isArray(rows) ? rows.slice(0, 20000) : [];++ const importId = newId('imp');++ let added = 0;++ await db.tx(async (t) => {++ await t.exec('INSERT INTO finance_imports (id, owner, account_id, format, rows_read) VALUES ($1, $2, $3, $4, $5)', [importId, owner, acc.id, 'csv', list.length]);++ // The same row twice in one file is two transactions (two coffees on one day); the same file twice is not.++ const seen = new Map();++ for (const input of list) {++ const r = checkRow(input);++ const key = `${acc.id}|${r.posted_on}|${r.amount_cents}|${r.payee.toLowerCase()}`;++ const nth = (seen.get(key) || 0) + 1;++ seen.set(key, nth);++ const out = await t.exec(`INSERT INTO finance_transactions (id, owner, account_id, posted_on, amount_cents, payee_enc, memo_enc, category, category_from, import_id, dedupe)++ VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) ON CONFLICT (account_id, dedupe) WHERE dedupe IS NOT NULL DO NOTHING`,++ [newId('txn'), owner, acc.id, r.posted_on, r.amount_cents, vault.seal(owner, r.payee), vault.seal(owner, r.memo), r.category,++ r.category === 'Uncategorized' ? 'none' : 'file', importId, vault.mark(owner, `${key}|${nth}`)]);++ if (out) added++;++ }++ await t.exec('UPDATE finance_imports SET rows_added = $2, rows_skipped = $3 WHERE id = $1', [importId, added, list.length - added]);++ });++ return { import_id: importId, read: list.length, added, skipped: list.length - added };++ }++++ async function month(owner, m) {++ own(owner);++ if (!MONTH.test(String(m || ''))) fail(422, 'finance.month', 'A month is YYYY-MM.');++ // In and out by each transaction's sign, never a category's net: a paycheck and a coffee in one category are $2,500++ // in and $4.50 out, not $2,495.50 in.++ const rows = await db.many(`SELECT t.category,++ SUM(CASE WHEN t.amount_cents > 0 THEN t.amount_cents ELSE 0 END)::bigint AS in_cents,++ SUM(CASE WHEN t.amount_cents < 0 THEN -t.amount_cents ELSE 0 END)::bigint AS out_cents, COUNT(*)::int AS count++ FROM finance_transactions t JOIN finance_accounts a ON a.id = t.account_id AND a.archived_at IS NULL++ WHERE t.owner = $1 AND t.posted_on >= $2::date AND t.posted_on < ($2::date + interval '1 month') AND t.category <> 'Transfers'++ GROUP BY t.category ORDER BY 3 DESC, 2 DESC`, [owner, `${m}-01`]);++ let income = 0, spent = 0;++ const by = rows.map((r) => {++ const i = Number(r.in_cents), o = Number(r.out_cents);++ income += i; spent += o;++ return { category: r.category, in_cents: i, out_cents: o, cents: i - o, count: r.count };++ });++ return { month: m, income_cents: income, spent_cents: spent, by_category: by };++ }++++ async function exportAll(owner) {++ own(owner);++ const accs = await db.many('SELECT id, name, kind, currency, opening_cents, created_at, archived_at FROM finance_accounts WHERE owner = $1 ORDER BY created_at', [owner]);++ const txns = await db.many('SELECT * FROM finance_transactions WHERE owner = $1 ORDER BY posted_on, created_at', [owner]);++ return {++ exported_at: new Date().toISOString(), format: 'openvibe.finance.export@1',++ accounts: accs.map((a) => ({ ...a, opening_cents: Number(a.opening_cents) })),++ transactions: txns.map((r) => open(owner, r)),++ };++ }++++ async function removeAll(owner) {++ own(owner);++ await db.tx(async (t) => {++ await t.exec('DELETE FROM finance_transactions WHERE owner = $1', [owner]);++ await t.exec('DELETE FROM finance_imports WHERE owner = $1', [owner]);++ await t.exec('DELETE FROM finance_accounts WHERE owner = $1', [owner]);++ });++ }++++ return { accounts, account, addAccount, transactions, addTransaction, setCategory, removeTransaction, importRows, month, exportAll, removeAll };++}++++module.exports = { createStore, FinanceError, KINDS, CATEGORIES };nnew file mode 100644@@@ -0,0 +1,140 @@++'use strict';++/**++ * Finance's pages, server-rendered in the network's shell (openvibe-shared/shell, kit.css) with this site's own++ * finance.css. Every value that reaches markup goes through esc(). Forms post to the same origin and work without++ * script; public/finance.js only reads a chosen CSV file into the paste box.++ */++const shell = require('openvibe-shared/shell');++const serve = require('openvibe-shared/serve');++const { CATEGORIES, KINDS } = require('./store');++++const SITE = 'https://openvibe.finance';++const esc = (v) => String(v == null ? '' : v).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]));++const money = (cents, currency = 'USD') => {++ try { return new Intl.NumberFormat('en-US', { style: 'currency', currency }).format(cents / 100); }++ catch { return `${(cents / 100).toFixed(2)} ${currency}`; }++};++const monthName = (m) => new Date(`${m}-01T00:00:00Z`).toLocaleDateString('en-US', { month: 'long', year: 'numeric', timeZone: 'UTC' });++const shiftMonth = (m, by) => { const d = new Date(`${m}-01T00:00:00Z`); d.setUTCMonth(d.getUTCMonth() + by); return d.toISOString().slice(0, 7); };++const KIND_WORDS = { checking: 'Checking', savings: 'Savings', credit: 'Credit card', cash: 'Cash', loan: 'Loan', investment: 'Investments', other: 'Other' };++++function page({ title, body, path = '/', description = 'Your money, your rules, your data: accounts, imports and a monthly picture, private to you.', robots = 'noindex, nofollow' }) {++ return shell.page({++ name: 'OpenVibe.Finance', siteName: 'OpenVibe.Finance', title, description, canonical: `${SITE}${path}`, robots,++ navbar: { service: 'finance', apiBase: 'https://openvibe.network', links: [{ label: 'Money', href: '/' }, { label: 'This month', href: '/month' }] },++ footer: { service: 'finance', variant: 'full', mount: '#ov-footer' },++ head: `<link rel="stylesheet" href="${serve.url('kit.css')}"><link rel="stylesheet" href="/finance.css"><script src="/finance.js" defer></script>`,++ body: `<div id="navbar-mount"></div><main id="main" class="ovk-page fin">${body}</main>`,++ });++}++++const notice = (o) => (o.error ? `<p class="fin-error" role="alert">${esc(o.error)}</p>` : '') + (o.said ? `<p class="fin-said" role="status">${esc(o.said)}</p>` : '');++++function welcome() {++ return page({++ title: 'Your money, your rules, your data', robots: 'index, follow', body: `++<section class="fin-hero">++<h1>Your money, your rules, your data</h1>++<p class="fin-lede">Your accounts in one place, from a bank's CSV export or typed in, and a clear picture of each month. Free, with nothing to connect.</p>++<p><a class="fin-btn fin-btn--primary" href="/auth/login?next=%2F">Sign in to start</a></p>++</section>++<ul class="fin-promises">++<li><b>Private to you.</b> Payees and notes are stored encrypted under a key for your account alone. Nothing here enters search, analytics or AI training.</li>++<li><b>No money moves.</b> It reads and plans. It never pays, transfers or cancels anything.</li>++<li><b>Yours to take.</b> Download everything as one file, or delete everything, any time.</li>++</ul>` });++}++++function home({ accounts, month, o = {} }) {++ const total = {};++ for (const a of accounts) total[a.currency] = (total[a.currency] || 0) + a.balance_cents;++ const totals = Object.entries(total).map(([c, v]) => money(v, c)).join(' · ');++ const kindChips = KINDS.map((k, i) => `<label class="fin-chip"><input type="radio" name="kind" value="${k}"${i === 0 ? ' checked' : ''}><span>${esc(KIND_WORDS[k])}</span></label>`).join('');++ return page({++ title: 'Your money', body: `++<header class="fin-head"><h1>Your money</h1>${accounts.length ? `<p class="fin-total">${esc(totals)}</p>` : ''}</header>++${notice(o)}++${accounts.length ? `<section class="fin-month-card" aria-label="${esc(monthName(month.month))}">++<a class="fin-month-link" href="/month?m=${month.month}"><span>${esc(monthName(month.month))}</span>++<span class="fin-in">In ${esc(money(month.income_cents))}</span><span class="fin-out">Out ${esc(money(month.spent_cents))}</span></a></section>++<ul class="fin-accounts">${accounts.map((a) => `<li><a class="fin-account" href="/accounts/${esc(a.id)}">++<span class="fin-account-name">${esc(a.name)}<small>${esc(KIND_WORDS[a.kind] || a.kind)} · ${a.count} transaction${a.count === 1 ? '' : 's'}</small></span>++<span class="fin-account-balance${a.balance_cents < 0 ? ' is-neg' : ''}">${esc(money(a.balance_cents, a.currency))}</span></a></li>`).join('')}</ul>`++ : `<p class="fin-empty">Start with an account: name it, then type in transactions or import your bank's CSV export.</p>`}++<details class="fin-fold"${accounts.length ? '' : ' open'}><summary>Add an account</summary>++<form class="fin-form" method="post" action="/accounts">++<label class="fin-field"><span>Name</span><input name="name" maxlength="80" required placeholder="Everyday checking" autocomplete="off"></label>++<fieldset class="fin-chips"><legend>Kind</legend>${kindChips}</fieldset>++<div class="fin-row"><label class="fin-field"><span>Currency</span><input name="currency" value="USD" maxlength="3" pattern="[A-Za-z]{3}" autocomplete="off"></label>++<label class="fin-field"><span>Balance before the first transaction</span><input name="opening" inputmode="decimal" placeholder="0.00" autocomplete="off"></label></div>++<p><button class="fin-btn fin-btn--primary" type="submit">Add the account</button></p>++</form></details>++<p class="fin-foot"><a href="/data">Your data: download or delete everything</a></p>` });++}++++function accountPage({ account, balance, txns, month, o = {} }) {++ const groups = new Map();++ for (const t of txns) { const m = t.posted_on.slice(0, 7); if (!groups.has(m)) groups.set(m, []); groups.get(m).push(t); }++ const cats = `<datalist id="fin-cats">${CATEGORIES.map((c) => `<option value="${esc(c)}">`).join('')}</datalist>`;++ const row = (t) => `<li class="fin-txn"><span class="fin-txn-date">${esc(t.posted_on.slice(5))}</span>++<span class="fin-txn-what"><b>${esc(t.payee || 'No payee')}</b>${t.memo ? `<small>${esc(t.memo)}</small>` : ''}++<form class="fin-cat" method="post" action="/transactions/${esc(t.id)}/category"><input name="category" list="fin-cats" value="${esc(t.category)}" aria-label="Category" maxlength="60"><button type="submit" class="fin-mini">Save</button></form></span>++<span class="fin-txn-amount${t.amount_cents < 0 ? ' is-neg' : ' is-pos'}">${esc(money(t.amount_cents, account.currency))}</span></li>`;++ const today = new Date().toISOString().slice(0, 10);++ return page({++ title: account.name, path: `/accounts/${account.id}`, body: `++<header class="fin-head"><p class="fin-crumb"><a href="/">Your money</a></p><h1>${esc(account.name)}</h1>++<p class="fin-total${balance < 0 ? ' is-neg' : ''}">${esc(money(balance, account.currency))}</p></header>++${notice(o)}${cats}++<div class="fin-tools">++<details class="fin-fold"><summary>Add a transaction</summary>++<form class="fin-form" method="post" action="/accounts/${esc(account.id)}/transactions">++<div class="fin-row"><label class="fin-field"><span>Date</span><input type="date" name="posted_on" value="${today}" required></label>++<label class="fin-field"><span>Amount</span><input name="amount" inputmode="decimal" required placeholder="12.34" autocomplete="off"></label></div>++<fieldset class="fin-chips"><legend>Money</legend><label class="fin-chip"><input type="radio" name="direction" value="out" checked><span>Out</span></label><label class="fin-chip"><input type="radio" name="direction" value="in"><span>In</span></label></fieldset>++<label class="fin-field"><span>Payee</span><input name="payee" maxlength="300" autocomplete="off"></label>++<label class="fin-field"><span>Category</span><input name="category" list="fin-cats" maxlength="60" autocomplete="off" placeholder="Groceries"></label>++<p><button class="fin-btn fin-btn--primary" type="submit">Add it</button></p>++</form></details>++<details class="fin-fold"><summary>Import a bank's CSV export</summary>++<form class="fin-form" method="post" action="/accounts/${esc(account.id)}/import">++<p class="fin-note">Most banks export a CSV with a date, an amount (or debit and credit) and a description. Importing the same file twice adds nothing twice.</p>++<label class="fin-file"><input type="file" accept=".csv,text/csv,text/plain" data-fin-file="csv"><span class="fin-btn">Choose a CSV file</span><span class="fin-file-name" data-fin-file-name>No file chosen yet</span></label>++<label class="fin-field"><span>Or paste it</span><textarea name="csv" rows="6" required data-fin-csv placeholder="Date,Description,Amount 2026-11-02,Corner Grocer,-23.18"></textarea></label>++<p><button class="fin-btn fin-btn--primary" type="submit">Import</button></p>++</form></details>++</div>++<nav class="fin-monthnav" aria-label="Month"><a href="/accounts/${esc(account.id)}?m=${shiftMonth(month, -1)}">${esc(monthName(shiftMonth(month, -1)))}</a>++<b>${esc(monthName(month))}</b><a href="/accounts/${esc(account.id)}?m=${shiftMonth(month, 1)}">${esc(monthName(shiftMonth(month, 1)))}</a></nav>++${txns.length ? [...groups.values()].map((list) => `<ul class="fin-txns">${list.map(row).join('')}</ul>`).join('') : `<p class="fin-empty">Nothing in ${esc(monthName(month))}. Add a transaction, or import a CSV.</p>`}` });++}++++function monthPage({ m, o = {} }) {++ const spent = m.by_category.filter((c) => c.out_cents > 0);++ const most = Math.max(1, ...spent.map((c) => c.out_cents));++ return page({++ title: `${monthName(m.month)}`, path: '/month', body: `++<header class="fin-head"><p class="fin-crumb"><a href="/">Your money</a></p><h1>${esc(monthName(m.month))}</h1></header>++${notice(o)}++<nav class="fin-monthnav" aria-label="Month"><a href="/month?m=${shiftMonth(m.month, -1)}">${esc(monthName(shiftMonth(m.month, -1)))}</a><b>${esc(monthName(m.month))}</b><a href="/month?m=${shiftMonth(m.month, 1)}">${esc(monthName(shiftMonth(m.month, 1)))}</a></nav>++<div class="fin-sums"><p><span>In</span><b class="fin-in">${esc(money(m.income_cents))}</b></p><p><span>Out</span><b class="fin-out">${esc(money(m.spent_cents))}</b></p>++<p><span>Left</span><b class="${m.income_cents - m.spent_cents < 0 ? 'is-neg' : ''}">${esc(money(m.income_cents - m.spent_cents))}</b></p></div>++${spent.length ? `<ul class="fin-bars">${spent.map((c) => `<li><span class="fin-bar-name">${esc(c.category)}<small>${c.count}</small></span>++<span class="fin-bar"><span style="--w:${Math.max(2, Math.round((c.out_cents / most) * 100))}%"></span></span><span class="fin-bar-sum">${esc(money(c.out_cents))}</span></li>`).join('')}</ul>`++ : '<p class="fin-empty">No spending this month.</p>'}++<p class="fin-note">Transfers between your own accounts are left out. Amounts in other currencies are added as they are.</p>` });++}++++function dataPage({ o = {} }) {++ return page({++ title: 'Your data', path: '/data', body: `++<header class="fin-head"><p class="fin-crumb"><a href="/">Your money</a></p><h1>Your data</h1></header>++${notice(o)}++<section class="fin-sec"><h2>Download everything</h2><p>Every account and transaction, as one JSON file, readable anywhere.</p>++<p><a class="fin-btn" href="/data/export" download>Download</a></p></section>++<section class="fin-sec"><h2>Delete everything</h2><p>Every account, transaction and import of yours, for good. There is no undo.</p>++<form method="post" action="/data/delete" class="fin-form"><label class="fin-check"><input type="checkbox" name="sure" value="yes" required><span>Yes, delete all my finance data</span></label>++<p><button class="fin-btn fin-btn--danger" type="submit">Delete everything</button></p></form></section>` });++}++++module.exports = { page, welcome, home, accountPage, monthPage, dataPage, money, esc, monthName };nnew file mode 100644@@@ -0,0 +1,149 @@++'use strict';++/**++ * Finance end to end on a migrated PostgreSQL (PGlite, or the containers with FINANCE_TEST_STORE=pg): two people,++ * accounts, typed and imported transactions, the same file twice, categories, the month, the API, export, deletion,++ * and nobody reading another's rows. A stand-in signs people in with an x-test-user header.++ */++const assert = require('assert');++const path = require('node:path');++const crypto = require('node:crypto');++const { createTestDb } = require('openvibe-sdk/testing');++const { createVault } = require('../server/crypto');++const { createApp } = require('../server/app');++++const ADA = 'usr_01JCZ3NDEKTSV4RRFFQ69G5FAW';++const BO = 'usr_01JCZ3NDEKTSV4RRFFQ69G5FAX';++const SAME = { 'sec-fetch-site': 'same-origin' };++++(async () => {++ const { db, close } = await createTestDb({ migrations: path.join(__dirname, '..', 'migrations'), store: process.env.FINANCE_TEST_STORE || 'pglite', service: 'finance' });++ const auth = {++ router: (express) => express.Router(),++ optionalAuth: () => (req, _res, next) => { const u = req.get('x-test-user'); if (u) req.user = { subject_id: u }; next(); },++ };++ const app = createApp({ db, vault: createVault(crypto.randomBytes(32).toString('base64')), auth, now: () => new Date('2026-11-18T12:00:00Z') });++ const server = app.listen(0, '127.0.0.1');++ await new Promise((r) => server.once('listening', r));++ const base = `http://127.0.0.1:${server.address().port}`;++ const go = async (p, { as = null, method = 'GET', form = null, json = null, text = null, headers = {} } = {}) => {++ const h = { ...headers };++ if (as) h['x-test-user'] = as;++ let body;++ if (form) { h['content-type'] = 'application/x-www-form-urlencoded'; body = new URLSearchParams(form).toString(); }++ if (json) { h['content-type'] = 'application/json'; body = JSON.stringify(json); }++ if (text != null) { h['content-type'] = 'text/csv'; body = text; }++ const r = await fetch(base + p, { method, headers: h, body, redirect: 'manual' });++ const t = await r.text();++ return { status: r.status, location: r.headers.get('location'), text: t, json: () => JSON.parse(t), headers: r.headers };++ };++ let failed = 0;++ const check = async (name, fn) => { try { await fn(); console.log(` ✓ ${name}`); } catch (e) { failed++; console.log(` ✗ ${name}\n ${e.stack}`); } };++++ try {++ let acc;++ await check('signed out: what it is and its promises, never anyone\'s data; a page that needs you signs you in', async () => {++ const home = await go('/');++ assert.strictEqual(home.status, 200);++ assert.match(home.text, /Your money, your rules, your data/);++ assert.match(home.text, /No money moves/);++ assert.strictEqual(home.headers.get('cache-control'), 'private, no-store');++ const month = await go('/month');++ assert.strictEqual(month.status, 303);++ assert.match(month.location, /^\/auth\/login\?next=/);++ assert.strictEqual((await go('/api/v1/accounts')).status, 401);++ });++++ await check('an account from the home page; its page shows the balance', async () => {++ const r = await go('/accounts', { as: ADA, method: 'POST', headers: SAME, form: { name: 'Everyday checking', kind: 'checking', currency: 'usd', opening: '1,000.00' } });++ assert.strictEqual(r.status, 303, r.text);++ acc = /^\/accounts\/(acc_[A-Za-z0-9_-]+)\?added=1$/.exec(r.location)[1];++ const page = await go(`/accounts/${acc}`, { as: ADA });++ assert.strictEqual(page.status, 200);++ assert.match(page.text, /Everyday checking/);++ assert.match(page.text, /\$1,000\.00/);++ });++++ await check('a typed transaction: money out by default, its payee sealed in the database', async () => {++ const r = await go(`/accounts/${acc}/transactions`, { as: ADA, method: 'POST', headers: SAME, form: { posted_on: '2026-11-03', amount: '42.50', direction: 'out', payee: 'Corner Grocer', category: 'Groceries' } });++ assert.strictEqual(r.status, 303, r.text);++ const row = await db.maybe('SELECT payee_enc, amount_cents, category, category_from FROM finance_transactions WHERE account_id = $1', [acc]);++ assert.strictEqual(Number(row.amount_cents), -4250);++ assert.ok(row.payee_enc.startsWith('v1.') && !row.payee_enc.includes('Corner'), 'stored sealed');++ assert.deepStrictEqual([row.category, row.category_from], ['Groceries', 'you']);++ const page = await go(`/accounts/${acc}?m=2026-11`, { as: ADA });++ assert.match(page.text, /Corner Grocer/);++ assert.match(page.text, /\$957\.50/, 'the balance moved');++ });++++ await check('a CSV import adds the new rows; the same file again adds nothing; two equal rows in one file stay two', async () => {++ const csv = 'Date,Description,Amount\n2026-11-04,Coffee Bar,-4.50\n2026-11-04,Coffee Bar,-4.50\n2026-11-01,Paycheck,2500.00\n2026-10-28,Electric Co,-80.00\n';++ let r = await go(`/accounts/${acc}/import`, { as: ADA, method: 'POST', headers: SAME, form: { csv } });++ assert.strictEqual(r.status, 303, r.text);++ assert.match(r.location, /imported=4,0$/);++ r = await go(`/accounts/${acc}/import`, { as: ADA, method: 'POST', headers: SAME, form: { csv } });++ assert.match(r.location, /imported=0,4$/);++ const page = await go(r.location, { as: ADA });++ assert.match(page.text, /Imported 0 new transactions; 4 already here/);++ assert.strictEqual(Number(await db.value('SELECT count(*) FROM finance_transactions WHERE account_id = $1', [acc])), 5);++ const bad = await go(`/accounts/${acc}/import`, { as: ADA, method: 'POST', headers: SAME, form: { csv: 'Description,Amount\nx,1\n' } });++ assert.strictEqual(bad.status, 422);++ assert.match(bad.text, /No date column/);++ });++++ await check('a category is corrected as a new revision; the month adds up by category, transfers left out', async () => {++ const txns = (await go(`/api/v1/accounts/${acc}/transactions?m=2026-11`, { as: ADA })).json().transactions;++ const coffee = txns.find((t) => t.payee === 'Coffee Bar');++ const r = await go(`/transactions/${coffee.id}/category`, { as: ADA, method: 'POST', headers: SAME, form: { category: 'Eating out' } });++ assert.strictEqual(r.status, 303);++ const row = await db.maybe('SELECT category, category_from, revision FROM finance_transactions WHERE id = $1', [coffee.id]);++ assert.deepStrictEqual([row.category, row.category_from, row.revision], ['Eating out', 'you', 2]);++ const m = (await go('/api/v1/months/2026-11', { as: ADA })).json();++ assert.strictEqual(m.income_cents, 250000);++ assert.strictEqual(m.spent_cents, 4250 + 450 + 450);++ const page = await go('/month?m=2026-11', { as: ADA });++ assert.match(page.text, /November 2026/);++ assert.match(page.text, /Groceries/);++ });++++ await check('nobody reads or writes another person\'s rows', async () => {++ assert.strictEqual((await go(`/accounts/${acc}`, { as: BO })).status, 404);++ assert.strictEqual((await go(`/api/v1/accounts/${acc}/transactions`, { as: BO })).status, 404);++ const sneak = await go(`/accounts/${acc}/transactions`, { as: BO, method: 'POST', headers: SAME, form: { posted_on: '2026-11-05', amount: '1', payee: 'x' } });++ assert.strictEqual(sneak.status, 404);++ assert.deepStrictEqual((await go('/api/v1/accounts', { as: BO })).json().accounts, []);++ assert.strictEqual((await go('/api/v1/months/2026-11', { as: BO })).json().spent_cents, 0);++ });++++ await check('a cross-site form post is refused; the API takes a CSV body and JSON', async () => {++ const cross = await go('/accounts', { as: ADA, method: 'POST', headers: { 'sec-fetch-site': 'cross-site' }, form: { name: 'x' } });++ assert.strictEqual(cross.status, 403);++ const apiCross = await go('/api/v1/accounts', { as: ADA, method: 'POST', headers: { 'sec-fetch-site': 'cross-site' }, json: { name: 'x' } });++ assert.strictEqual(apiCross.status, 403);++ const made = await go('/api/v1/accounts', { as: ADA, method: 'POST', headers: SAME, json: { name: 'Card', kind: 'credit' } });++ assert.strictEqual(made.status, 201, made.text);++ const imp = await go(`/api/v1/accounts/${made.json().id}/import`, { as: ADA, method: 'POST', headers: SAME, text: 'Date,Payee,Amount\n2026-11-10,Bookshop,-15.00\nsoon,x,1\n' });++ assert.strictEqual(imp.status, 201, imp.text);++ assert.strictEqual(imp.json().added, 1);++ assert.strictEqual(imp.json().unreadable.length, 1);++ });++++ await check('export is everything, readable; delete is everything, after a yes', async () => {++ const ex = await go('/data/export', { as: ADA });++ assert.match(ex.headers.get('content-disposition'), /attachment; filename="openvibe-finance-2026-11\.json"/);++ const data = ex.json();++ assert.strictEqual(data.accounts.length, 2);++ assert.ok(data.transactions.some((t) => t.payee === 'Corner Grocer'), 'opened for its owner');++ const no = await go('/data/delete', { as: ADA, method: 'POST', headers: SAME, form: {} });++ assert.strictEqual(no.status, 422);++ const yes = await go('/data/delete', { as: ADA, method: 'POST', headers: SAME, form: { sure: 'yes' } });++ assert.strictEqual(yes.status, 303);++ assert.strictEqual(Number(await db.value("SELECT count(*) FROM finance_transactions WHERE owner = $1", [ADA])), 0);++ assert.strictEqual(Number(await db.value("SELECT count(*) FROM finance_accounts WHERE owner = $1", [ADA])), 0);++ });++ } finally {++ server.close();++ await close();++ }++ if (failed) { console.log(`${failed} failed`); process.exit(1); }++ console.log('finance: accounts, imports, months, privacy, export and deletion');++})().catch((err) => { console.error(err); process.exit(1); });nnew file mode 100644@@@ -0,0 +1,26 @@++'use strict';++// The vault (server/crypto.js): a person's words sealed with their key alone, opened only with it, tamper refused.++const assert = require('assert');++const crypto = require('node:crypto');++const { createVault } = require('../server/crypto');++++const ADA = 'usr_01JCZ3NDEKTSV4RRFFQ69G5FAW';++const BO = 'usr_01JCZ3NDEKTSV4RRFFQ69G5FAX';++const vault = createVault(crypto.randomBytes(32).toString('base64'));++++const sealed = vault.seal(ADA, 'Corner Grocer');++assert.match(sealed, /^v1\./);++assert.ok(!sealed.includes('Corner'), 'the words are not readable');++assert.strictEqual(vault.open(ADA, sealed), 'Corner Grocer');++assert.notStrictEqual(vault.seal(ADA, 'Corner Grocer'), sealed, 'a fresh IV each time');++assert.throws(() => vault.open(BO, sealed), 'another person\'s key does not open it');++const parts = sealed.split('.');++parts[3] = Buffer.from('tampered').toString('base64url');++assert.throws(() => vault.open(ADA, parts.join('.')), 'a changed value is refused');++assert.strictEqual(vault.seal(ADA, ''), '');++assert.strictEqual(vault.open(ADA, ''), '');++assert.strictEqual(vault.mark(ADA, 'x'), vault.mark(ADA, 'x'), 'a mark is stable');++assert.notStrictEqual(vault.mark(ADA, 'x'), vault.mark(BO, 'x'), 'and per person');++assert.throws(() => vault.seal('nobody', 'x'), /usr_/);++assert.throws(() => createVault('short'), /32 bytes/);++console.log('vault: sealed per person, refused for others and when changed');nnew file mode 100644@@@ -0,0 +1,54 @@++'use strict';++// Reading a bank's CSV export (server/csv.js): the delimiter, quotes, the columns by their header, dates and amounts in++// the shapes banks send, debit/credit pairs, and rows that cannot be read said, never guessed.++const assert = require('assert');++const { readCsv, readDate, readAmount } = require('../server/csv');++++assert.strictEqual(readDate('2026-11-18'), '2026-11-18');++assert.strictEqual(readDate('11/18/2026'), '2026-11-18');++assert.strictEqual(readDate('18/11/2026'), '2026-11-18', 'a first number over 12 is a day');++assert.strictEqual(readDate('01/02/2026', true), '2026-02-01', 'a day-first file');++assert.strictEqual(readDate('18.11.2026'), '2026-11-18');++assert.strictEqual(readDate('Nov 18, 2026'), '2026-11-18');++assert.strictEqual(readDate('18 Nov 2026'), '2026-11-18');++assert.strictEqual(readDate('2026-02-30'), null, 'no 30th of February');++assert.strictEqual(readDate('soon'), null);++++assert.strictEqual(readAmount('-12.34'), -1234);++assert.strictEqual(readAmount('(12.34)'), -1234);++assert.strictEqual(readAmount('$1,234.56'), 123456);++assert.strictEqual(readAmount('1.234,56'), 123456, 'comma decimals');++assert.strictEqual(readAmount('12,5'), 1250);++assert.strictEqual(readAmount('12.34 DR'), -1234);++assert.strictEqual(readAmount('12.34 CR'), 1234);++assert.strictEqual(readAmount('7'), 700);++assert.strictEqual(readAmount(''), null);++assert.strictEqual(readAmount('n/a'), null);++++// A typical export: quoted payees with commas, a signed amount.++let r = readCsv('Date,Description,Amount,Category\n2026-11-02,"Corner Grocer, Main St",-23.18,Groceries\n2026-11-01,Paycheck,2500.00,\n');++assert.strictEqual(r.problem, null);++assert.deepStrictEqual(r.rows, [++ { posted_on: '2026-11-02', amount_cents: -2318, payee: 'Corner Grocer, Main St', memo: '', category: 'Groceries' },++ { posted_on: '2026-11-01', amount_cents: 250000, payee: 'Paycheck', memo: '', category: '' },++]);++++// Debit and credit columns, semicolons, a day-first file, a byte order mark, a row that cannot be read.++r = readCsv('Booking Date;Payee;Memo;Debit;Credit\r\n15/10/2026;Rent;October;1200,00;\r\n03/11/2026;Refund;;;"19,99"\r\nlater;Mystery;;5,00;\r\n');++assert.deepStrictEqual(r.rows.map((x) => [x.posted_on, x.amount_cents, x.payee, x.memo]), [++ ['2026-10-15', -120000, 'Rent', 'October'],++ ['2026-11-03', 1999, 'Refund', ''],++]);++assert.deepStrictEqual(r.skipped.map((s) => s.line), [4]);++assert.match(r.skipped[0].why, /date/);++++// Tabs, and a description beside a payee is the memo.++r = readCsv('Posted Date\tPayee\tDescription\tAmount\n2026-11-05\tSTREAMCO\tMonthly plan\t-9.99\n');++assert.deepStrictEqual(r.rows[0], { posted_on: '2026-11-05', amount_cents: -999, payee: 'STREAMCO', memo: 'Monthly plan', category: '' });++++// What a file is missing is said.++assert.match(readCsv('Description,Amount\nx,1\n').problem, /No date column/);++assert.match(readCsv('Date,Description\n2026-11-01,x\n').problem, /No amount column/);++assert.match(readCsv('Date,Amount\n').problem, /no rows/);++++console.log('csv: dates, amounts, columns, delimiters and unreadable rows');nnew file mode 100644@@@ -0,0 +1,43 @@++'use strict';++/**++ * A local look at Finance's pages (not a test): the real app on PGlite, a stand-in sign-in as one person, and a month++ * of sample data. node test/harness/serve-sample.js [port] → prints the port, serves until killed.++ */++const path = require('node:path');++const crypto = require('node:crypto');++const { createTestDb } = require('openvibe-sdk/testing');++const { createVault } = require('../../server/crypto');++const { createApp } = require('../../server/app');++const { createStore } = require('../../server/store');++const { readCsv } = require('../../server/csv');++++const ADA = 'usr_01JCZ3NDEKTSV4RRFFQ69G5FAW';++(async () => {++ const { db } = await createTestDb({ migrations: path.join(__dirname, '..', '..', 'migrations') });++ const vault = createVault(crypto.randomBytes(32).toString('base64'));++ const store = createStore({ db, vault });++ const checking = await store.addAccount(ADA, { name: 'Everyday checking', kind: 'checking', opening_cents: 184250 });++ await store.addAccount(ADA, { name: 'Rainy day', kind: 'savings', opening_cents: 520000 });++ const card = await store.addAccount(ADA, { name: 'Travel card', kind: 'credit', opening_cents: -32075 });++ const csv = `Date,Description,Amount,Category++2026-11-01,Paycheck ACME Corp,3120.00,Income++2026-11-01,Lakeview Apartments,-1450.00,Housing++2026-11-02,Corner Grocer,-86.42,Groceries++2026-11-03,City Power & Light,-71.30,Utilities++2026-11-04,Bean There Coffee,-4.75,Eating out++2026-11-05,StreamFlix,-15.99,Subscriptions++2026-11-06,Metro Transit,-40.00,Transport++2026-11-08,Corner Grocer,-54.10,Groceries++2026-11-09,Pharmacy Plus,-23.80,Health++2026-11-11,Thai Garden,-38.60,Eating out++2026-11-12,Transfer to savings,-300.00,Transfers++2026-11-14,Bookshop on Main,-18.99,++2026-11-15,Paycheck ACME Corp,3120.00,Income++2026-11-16,Gym Monthly,-29.00,Subscriptions++`;++ await store.importRows(ADA, checking.id, readCsv(csv).rows);++ await store.importRows(ADA, card.id, readCsv('Date,Payee,Amount\n2026-11-07,Airline Tickets,-412.20\n2026-11-10,Hotel Downtown,-268.00\n').rows);++ const auth = { router: (express) => express.Router(), optionalAuth: () => (req, _res, next) => { if (!req.get('x-guest')) req.user = { subject_id: ADA }; next(); } };++ const app = createApp({ db, vault, auth, baseUrl: 'http://127.0.0.1', now: () => new Date('2026-11-18T12:00:00Z') });++ const server = app.listen(Number(process.argv[2] || 0), '127.0.0.1', () => console.log(`port ${server.address().port} account ${checking.id}`));++})().catch((e) => { console.error(e); process.exit(1); });nnew file mode 100644@@@ -0,0 +1,5 @@++/**++ * Runs every *.test.js in test/ (openvibe-shared/test-runner), each in its own process with a database of its own.++ */++'use strict';++require('openvibe-shared/test-runner').main({ dir: __dirname, timeoutMs: 60000, pad: 28, ...(process.env.FINANCE_TEST_STORE === 'pg' ? { parallel: 1 } : {}) });
new file mode 100644
new file mode 100644
@@ -0,0 +1,12 @@
@@ -0,0 +1,12 @@
+# OpenVibe.Finance (/etc/openvibe/finance.env on the host). Values are never committed.
+BASE_URL=https://openvibe.finance
+PORT=5292
+DATABASE_URL=
+DATABASE_DIRECT_URL=
+# 32 random bytes, base64: the service key every person's key is derived from (server/crypto.js). Losing it loses the
+# payees and notes; rotating it needs a re-seal.
+FINANCE_DATA_KEY=
+OV_OAUTH_CLIENT_ID=finance
+OV_OAUTH_CLIENT_SECRET=
+OV_NETWORK_URL=https://openvibe.network
+OV_NETWORK_INTERNAL_URL=http://127.0.0.1:4000
new file mode 100644
new file mode 100644
@@ -0,0 +1,18 @@
@@ -0,0 +1,18 @@
+name: ci
+on:
+ push:
+ branches: [main]
+ pull_request:
+jobs:
+ test:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
+ with:
+ node-version: 22
+ cache: npm
+ - run: npm ci --ignore-scripts
+ - run: npm test
+ security:
+ uses: OpenVibers/OpenVibe.Shared/.github/workflows/security.yml@8a353d9e7557bfeed2b43deb51271171f8e48fc6
new file mode 100644
new file mode 100644
@@ -0,0 +1,3 @@
@@ -0,0 +1,3 @@
+node_modules/
+.env
+*.log
new file mode 100644
new file mode 100644
@@ -0,0 +1,18 @@
@@ -0,0 +1,18 @@
+# AGENTS.md — OpenVibe.Finance
+
+A person's own money data (plan §L.2): accounts, transactions, CSV imports and the month. Node/Express, server-rendered
+in the network's shell (openvibe-shared), PostgreSQL through `openvibe-sdk/db` (PGlite in tests).
+
+## Rules (the most sensitive data on the network)
+- **Every query names the owner** (`store.js`); a page or route never reads a row by id alone.
+- **Payees and memos are sealed** with the person's key (`server/crypto.js`); never log them, never return them to
+ anyone but their owner. Amounts, dates and categories stay plain for the person's own sums.
+- **Nothing leaves:** no search index, no analytics events with content, no training data, no third-party script.
+- **No money moves.** Paying, transferring or cancelling is a separate, later decision with its own review.
+- **Writes are same-origin** (a page form) or a Bearer call; answers are `private, no-store` and `noindex`.
+- **Export and deletion stay complete:** a new table gets its rows in `exportAll` and `removeAll` in the same change.
+- **Migrations:** `migrations/NNNN_name.sql` with `-- phase:`; never edit one that has run.
+
+## Commands
+`npm test` (all, PGlite) · `node test/<name>.test.js` · `node test/harness/serve-sample.js 18471` (a local look).
+Style: 4 spaces, single quotes, semicolons, CommonJS.
new file mode 100644
new file mode 100644
@@ -0,0 +1,37 @@
@@ -0,0 +1,37 @@
+# OpenVibe.Finance
+
+**Your money, your rules, your data** — [openvibe.finance](https://openvibe.finance), part of the OpenVibe network.
+
+Your accounts in one place, from a bank's CSV export or typed in, and a clear picture of each month. Free, with nothing
+to connect.
+
+- **Private to you.** Payees and notes are stored encrypted under a key derived for your account alone
+ (`server/crypto.js`). Nothing here enters search, analytics or AI training.
+- **No money moves.** It reads and plans; it never pays, transfers or cancels anything.
+- **Yours to take.** Download everything as one JSON file, or delete everything, at `/data`.
+
+## What it does today (v0.1)
+
+- Accounts (checking, savings, credit card, cash, loan, investments) with an opening balance and a running balance.
+- Transactions typed in, or imported from a bank's CSV export: the columns are read from the header (date; amount, or
+ debit and credit; payee or description; memo; category), with the date and amount shapes banks send. Importing the
+ same file twice adds nothing twice.
+- Categories, corrected per transaction (each correction is a new revision; the category says where it came from).
+- The month: money in, money out, and spending by category (transfers between your accounts left out).
+- A JSON API for all of it (`/api/v1/…`), for the person signed in.
+
+Plan: `OpenVibe_Plan_2026-11-13.md` §L.2. Next: rules and recurring bills, budgets, goals, OFX/QFX, the Link plugin
+for local-only import, and Finance Experts (Budget Coach, Subscription Auditor) with narrow read permission.
+
+## Running
+
+```bash
+npm install
+npm test # PGlite, a real PostgreSQL in-process
+node test/harness/serve-sample.js 18471 # a local look with sample data and a stand-in sign-in
+```
+
+Production: `/opt/openvibe.finance`, unit `openvibe-finance.service` (port 5292), env `/etc/openvibe/finance.env`
+(`.env.example`), nginx `deploy/nginx/openvibe.finance.conf`. Sign-in is OpenVibe.Network's OAuth client `finance`.
+
+License: AGPL-3.0-only.
new file mode 100644
new file mode 100644
@@ -0,0 +1,39 @@
@@ -0,0 +1,39 @@
+server {
+ listen 80;
+ listen [::]:80;
+ server_name openvibe.finance www.openvibe.finance;
+ location /.well-known/acme-challenge/ { root /var/www/certbot; }
+ location / { return 301 https://openvibe.finance$request_uri; }
+}
+server {
+ listen 443 ssl;
+ listen [::]:443 ssl;
+ http2 on;
+ server_name www.openvibe.finance;
+ ssl_certificate /etc/letsencrypt/live/openvibe.finance/fullchain.pem;
+ ssl_certificate_key /etc/letsencrypt/live/openvibe.finance/privkey.pem;
+ ssl_protocols TLSv1.2 TLSv1.3;
+ return 301 https://openvibe.finance$request_uri;
+}
+server {
+ listen 443 ssl;
+ listen [::]:443 ssl;
+ http2 on;
+ server_name openvibe.finance;
+ ssl_certificate /etc/letsencrypt/live/openvibe.finance/fullchain.pem;
+ ssl_certificate_key /etc/letsencrypt/live/openvibe.finance/privkey.pem;
+ ssl_protocols TLSv1.2 TLSv1.3;
+ # A bank's CSV export, pasted or chosen: up to 4 MB (the app's own limit).
+ client_max_body_size 5m;
+ proxy_http_version 1.1;
+ proxy_set_header Host $host;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $remote_addr;
+ proxy_set_header CF-Connecting-IP $remote_addr;
+ proxy_set_header X-Forwarded-Proto $scheme;
+ add_header Strict-Transport-Security "max-age=31536000" always;
+ location ~* ^/internal(/|$) { return 404; }
+ location ~* ^/metrics(/|$) { return 404; }
+ location / { proxy_pass http://127.0.0.1:5292; }
+ location ~ /\.(?!well-known) { deny all; }
+}
new file mode 100644
new file mode 100644
@@ -0,0 +1,23 @@
@@ -0,0 +1,23 @@
+[Unit]
+Description=OpenVibe.Finance
+After=network.target postgresql.service pgbouncer.service
+[Service]
+Type=simple
+User=ubuntu
+Group=ubuntu
+WorkingDirectory=/opt/openvibe.finance
+EnvironmentFile=/etc/openvibe/finance.env
+Environment=NODE_ENV=production
+Environment=PORT=5292
+Environment=PATH=/usr/local/bin:/usr/bin:/bin
+ExecStart=/usr/bin/env node /opt/openvibe.finance/server/index.js
+Restart=always
+RestartSec=5
+KillSignal=SIGTERM
+TimeoutStopSec=15
+NoNewPrivileges=true
+PrivateTmp=true
+ProtectSystem=strict
+ProtectHome=true
+[Install]
+WantedBy=multi-user.target
new file mode 100644
new file mode 100644
@@ -0,0 +1,57 @@
@@ -0,0 +1,57 @@
+-- phase: expand
+-- OpenVibe.Finance (plan §L.2: "your money, your rules, your data"): a person's accounts and transactions, entered by
+-- hand or imported from a bank's CSV. Read and plan only: no money moves.
+-- * Every row belongs to one person (owner: their usr_ subject). Nothing here is public, searched, counted in
+-- analytics or used for training.
+-- * Payees and notes are stored encrypted with a key for that person alone (server/crypto.js); amounts, dates and
+-- categories stay plain so the person's own sums can be computed.
+-- * Money is integer cents in the account's currency.
+-- * A raw import row never changes: a correction (a category, a payee) is a revision on the transaction, and the
+-- category says where it came from (you, a rule, the bank's file).
+
+CREATE TABLE finance_accounts (
+ id text COLLATE "C" PRIMARY KEY,
+ owner text COLLATE "C" NOT NULL,
+ name text NOT NULL,
+ kind text COLLATE "C" NOT NULL CHECK (kind IN ('checking', 'savings', 'credit', 'cash', 'loan', 'investment', 'other')),
+ currency text COLLATE "C" NOT NULL DEFAULT 'USD' CHECK (currency ~ '^[A-Z]{3}$'),
+ opening_cents bigint NOT NULL DEFAULT 0,
+ created_at timestamptz NOT NULL DEFAULT now(),
+ updated_at timestamptz NOT NULL DEFAULT now(),
+ archived_at timestamptz
+);
+CREATE INDEX finance_accounts_owner ON finance_accounts (owner, created_at);
+
+CREATE TABLE finance_imports (
+ id text COLLATE "C" PRIMARY KEY,
+ owner text COLLATE "C" NOT NULL,
+ account_id text COLLATE "C" NOT NULL REFERENCES finance_accounts (id) ON DELETE CASCADE,
+ format text COLLATE "C" NOT NULL DEFAULT 'csv',
+ rows_read integer NOT NULL DEFAULT 0,
+ rows_added integer NOT NULL DEFAULT 0,
+ rows_skipped integer NOT NULL DEFAULT 0,
+ created_at timestamptz NOT NULL DEFAULT now()
+);
+CREATE INDEX finance_imports_owner ON finance_imports (owner, created_at);
+
+CREATE TABLE finance_transactions (
+ id text COLLATE "C" PRIMARY KEY,
+ owner text COLLATE "C" NOT NULL,
+ account_id text COLLATE "C" NOT NULL REFERENCES finance_accounts (id) ON DELETE CASCADE,
+ posted_on date NOT NULL,
+ amount_cents bigint NOT NULL,
+ payee_enc text NOT NULL DEFAULT '',
+ memo_enc text NOT NULL DEFAULT '',
+ category text NOT NULL DEFAULT 'Uncategorized',
+ category_from text COLLATE "C" NOT NULL DEFAULT 'none' CHECK (category_from IN ('none', 'you', 'rule', 'file')),
+ import_id text COLLATE "C" REFERENCES finance_imports (id) ON DELETE SET NULL,
+ -- The same bank row imported twice is one transaction: an HMAC (the person's key) of its account, date, amount and
+ -- payee, and its place among identical rows in the file.
+ dedupe text COLLATE "C",
+ revision integer NOT NULL DEFAULT 1,
+ created_at timestamptz NOT NULL DEFAULT now(),
+ updated_at timestamptz NOT NULL DEFAULT now()
+);
+CREATE INDEX finance_transactions_account ON finance_transactions (account_id, posted_on DESC, id);
+CREATE INDEX finance_transactions_owner_month ON finance_transactions (owner, posted_on);
+CREATE UNIQUE INDEX finance_transactions_dedupe ON finance_transactions (account_id, dedupe) WHERE dedupe IS NOT NULL;
new file mode 100644
new file mode 100644
@@ -0,0 +1,1564 @@
@@ -0,0 +1,1564 @@
+{
+ "name": "openvibe-finance",
+ "version": "0.1.0",
+ "lockfileVersion": 3,
+ "requires": true,
+ "packages": {
+ "": {
+ "name": "openvibe-finance",
+ "version": "0.1.0",
+ "license": "AGPL-3.0-only",
+ "dependencies": {
+ "@electric-sql/pglite": "^0.5.8",
+ "express": "^4.21.2",
+ "openvibe-sdk": "https://git.openvibe.codes/api/v1/repos/openvibers/openvibe.sdk/archive/v0.187.0.tar.gz",
+ "openvibe-shared": "https://git.openvibe.codes/api/v1/repos/openvibers/openvibe.shared/archive/v4.314.0.tar.gz",
+ "pg": "^8.23.1"
+ },
+ "engines": {
+ "node": ">=22"
+ }
+ },
+ "node_modules/@electric-sql/pglite": {
+ "version": "0.5.16",
+ "resolved": "https://registry.npmjs.org/@electric-sql/pglite/-/pglite-0.5.16.tgz",
+ "integrity": "sha512-Nj8KcIsJL748W408U2N8q4+9IlONdpRIU8MJypIAAINMJ5nqKyqpX7Mgg/5XKkXiAib3AoZGR6hnJFlrlLBrcg==",
+ "license": "Apache-2.0"
+ },
+ "node_modules/@jridgewell/gen-mapping": {
+ "version": "0.3.13",
+ "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz",
+ "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==",
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/sourcemap-codec": "^1.5.0",
+ "@jridgewell/trace-mapping": "^0.3.24"
+ }
+ },
+ "node_modules/@jridgewell/resolve-uri": {
+ "version": "3.1.3",
+ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.3.tgz",
+ "integrity": "sha512-lhTtjtoEArWBjismtfS761S9Hlyn+nIZqOZVYoZ1Xn82PMNMVnk+jj/NhC4fAXGTs7ydONcJiR5vyQBTMDu27g==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/@jridgewell/source-map": {
+ "version": "0.3.11",
+ "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.11.tgz",
+ "integrity": "sha512-ZMp1V8ZFcPG5dIWnQLr3NSI1MiCU7UETdS/A0G8V/XWHvJv3ZsFqutJn1Y5RPmAPX6F3BiE397OqveU/9NCuIA==",
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/gen-mapping": "^0.3.5",
+ "@jridgewell/trace-mapping": "^0.3.25"
+ }
+ },
+ "node_modules/@jridgewell/sourcemap-codec": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz",
+ "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==",
+ "license": "MIT"
+ },
+ "node_modules/@jridgewell/trace-mapping": {
+ "version": "0.3.31",
+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz",
+ "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==",
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/resolve-uri": "^3.1.0",
+ "@jridgewell/sourcemap-codec": "^1.4.14"
+ }
+ },
+ "node_modules/accepts": {
+ "version": "1.3.8",
+ "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz",
+ "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==",
+ "license": "MIT",
+ "dependencies": {
+ "mime-types": "~2.1.34",
+ "negotiator": "0.6.3"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/acorn": {
+ "version": "8.19.0",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.19.0.tgz",
+ "integrity": "sha512-oJlA3XiRm7Cyk6qFD2Jn8ak9B7jSy0qy00ADO3+8dpT0LSjFihQYv4C02LFCSYJV3Q37xYwwRy5m+IpIiUzqWw==",
+ "license": "MIT",
+ "bin": {
+ "acorn": "bin/acorn"
+ },
+ "engines": {
+ "node": ">=0.4.0"
+ }
+ },
+ "node_modules/array-flatten": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
+ "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==",
+ "license": "MIT"
+ },
+ "node_modules/body-parser": {
+ "version": "1.20.9",
+ "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.9.tgz",
+ "integrity": "sha512-FISIQxV5u91Y9gvuFq3q/tA/qTqLJn3AhRcEvyozyhJTh5OBFFtv827AdHU7Rbyct4r+Ba1/99oFa1Y3yuFsdw==",
+ "license": "MIT",
+ "dependencies": {
+ "bytes": "~3.1.2",
+ "content-type": "~1.0.5",
+ "debug": "2.6.9",
+ "depd": "2.0.0",
+ "destroy": "~1.2.0",
+ "http-errors": "~2.0.1",
+ "iconv-lite": "~0.4.24",
+ "on-finished": "~2.4.1",
+ "qs": "~6.16.0",
+ "raw-body": "~2.5.3",
+ "type-is": "~1.6.18",
+ "unpipe": "~1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.8",
+ "npm": "1.2.8000 || >= 1.4.16"
+ }
+ },
+ "node_modules/boolbase": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-2.0.0.tgz",
+ "integrity": "sha512-DkVaaQHymRhpYEYo9x1oo7Q7B0Y6KJUsjm3c9eTyFDby4MHLBTwZ6ZDWBel5zrYxj1WsZgC5oLpiz+93MluXeA==",
+ "license": "ISC",
+ "engines": {
+ "node": ">=20.19.0"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/fb55"
+ }
+ },
+ "node_modules/buffer-equal-constant-time": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz",
+ "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==",
+ "license": "BSD-3-Clause"
+ },
+ "node_modules/buffer-from": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz",
+ "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==",
+ "license": "MIT"
+ },
+ "node_modules/bytes": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
+ "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/call-bind-apply-helpers": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",
+ "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==",
+ "license": "MIT",
+ "dependencies": {
+ "es-errors": "^1.3.0",
+ "function-bind": "^1.1.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/call-bound": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz",
+ "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==",
+ "license": "MIT",
+ "dependencies": {
+ "call-bind-apply-helpers": "^1.0.2",
+ "get-intrinsic": "^1.3.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/clean-css": {
+ "version": "5.3.3",
+ "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.3.3.tgz",
+ "integrity": "sha512-D5J+kHaVb/wKSFcyyV75uCn8fiY4sV38XJoe4CUyGQ+mOU/fMVYUdH1hJC+CJQ5uY3EnW27SbJYS4X8BiLrAFg==",
+ "license": "MIT",
+ "dependencies": {
+ "source-map": "~0.6.0"
+ },
+ "engines": {
+ "node": ">= 10.0"
+ }
+ },
+ "node_modules/commander": {
+ "version": "2.20.3",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
+ "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
+ "license": "MIT"
+ },
+ "node_modules/content-disposition": {
+ "version": "0.5.4",
+ "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz",
+ "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==",
+ "license": "MIT",
+ "dependencies": {
+ "safe-buffer": "5.2.1"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/content-type": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz",
+ "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/cookie": {
+ "version": "0.7.2",
+ "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz",
+ "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/cookie-signature": {
+ "version": "1.0.7",
+ "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.7.tgz",
+ "integrity": "sha512-NXdYc3dLr47pBkpUCHtKSwIOQXLVn8dZEuywboCOJY/osA0wFSLlSawr3KN8qXJEyX66FcONTH8EIlVuK0yyFA==",
+ "license": "MIT"
+ },
+ "node_modules/css-select": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/css-select/-/css-select-7.0.0.tgz",
+ "integrity": "sha512-snmjEVXy+1LnwXdxhYvTMj1d9tOh4HxkA1YmoayVBeeyR2C14Pum7fcxJIm4SswYspVy866eYNwlH6xC3/VH5g==",
+ "license": "BSD-2-Clause",
+ "dependencies": {
+ "boolbase": "^2.0.0",
+ "css-what": "^8.0.0",
+ "domhandler": "^6.0.1",
+ "domutils": "^4.0.2",
+ "nth-check": "^3.0.1"
+ },
+ "engines": {
+ "node": ">=20.19.0"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/fb55"
+ }
+ },
+ "node_modules/css-what": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/css-what/-/css-what-8.0.0.tgz",
+ "integrity": "sha512-DH0Bqq3DNp5tdOReuNyAA+Ev4Y2GS5FMbZpeTLP6C4CDi0h5nL0BmUPChXw3o/qbHLDWHl49sbNqQVY7bMSDdw==",
+ "license": "BSD-2-Clause",
+ "engines": {
+ "node": ">=20.19.0"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/fb55"
+ }
+ },
+ "node_modules/cssomnom": {
+ "version": "0.1.12",
+ "resolved": "https://registry.npmjs.org/cssomnom/-/cssomnom-0.1.12.tgz",
+ "integrity": "sha512-nlsLjRxRN2RPomw3r+e+oD3KQBbEbKK0+oBUATbodf5N38FlOMg/5nqV0CdClNvpVsjFLikD63H6dgKTgeuuUg==",
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=20.0.0"
+ }
+ },
+ "node_modules/debug": {
+ "version": "2.6.9",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+ "license": "MIT",
+ "dependencies": {
+ "ms": "2.0.0"
+ }
+ },
+ "node_modules/depd": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
+ "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/destroy": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz",
+ "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8",
+ "npm": "1.2.8000 || >= 1.4.16"
+ }
+ },
+ "node_modules/dom-serializer": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-3.1.1.tgz",
+ "integrity": "sha512-4MEa38/QexBob6gFNwu+EGdWvhJ1OKuNwdYY3Y3NyeWDQfnGeDYQUDfIRzWu5B5gsv03so2Uxd28YC6zrsx3Lw==",
+ "license": "MIT",
+ "dependencies": {
+ "domelementtype": "^3.0.0",
+ "domhandler": "^6.0.0",
+ "entities": "^8.0.0"
+ },
+ "engines": {
+ "node": ">=20.19.0"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1"
+ }
+ },
+ "node_modules/domelementtype": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-3.0.0.tgz",
+ "integrity": "sha512-umCQid3jKbDmVjx8jGaW7uUykm4DEUeyV21hPxNMo2nV955DhUThwqyOIDtreepP31hl84X7G5U9ZfsWvIB3Pg==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/fb55"
+ }
+ ],
+ "license": "BSD-2-Clause",
+ "engines": {
+ "node": ">=20.19.0"
+ }
+ },
+ "node_modules/domhandler": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-6.0.1.tgz",
+ "integrity": "sha512-gYzvtM72ZtxQO0T048kd6HWSbbGCNOUwcnfQ01cqIJ4X2IYKFFHZ5mKvrQETcFXxsRObZulDaKmy//R7TPtsBg==",
+ "license": "BSD-2-Clause",
+ "dependencies": {
+ "domelementtype": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=20.19.0"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/fb55/domhandler?sponsor=1"
+ }
+ },
+ "node_modules/domutils": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/domutils/-/domutils-4.0.2.tgz",
+ "integrity": "sha512-qI4JLRKnSzqFqr7hAlS5xQDusBCjKSEG4t4+7aNrIQMHBcsC2TGEhuyABJdYkgSewL57PNLYEiibY2iPKhKpaA==",
+ "license": "BSD-2-Clause",
+ "dependencies": {
+ "dom-serializer": "^3.0.0",
+ "domelementtype": "^3.0.0",
+ "domhandler": "^6.0.0"
+ },
+ "engines": {
+ "node": ">=20.19.0"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/fb55/domutils?sponsor=1"
+ }
+ },
+ "node_modules/dunder-proto": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
+ "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",
+ "license": "MIT",
+ "dependencies": {
+ "call-bind-apply-helpers": "^1.0.1",
+ "es-errors": "^1.3.0",
+ "gopd": "^1.2.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/ecdsa-sig-formatter": {
+ "version": "1.0.11",
+ "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz",
+ "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "safe-buffer": "^5.0.1"
+ }
+ },
+ "node_modules/ee-first": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
+ "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==",
+ "license": "MIT"
+ },
+ "node_modules/encodeurl": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.3.tgz",
+ "integrity": "sha512-mIteYONiEfc4xWf2F1WXovh1c8npzS00vNeiUPdwFF+QlVJni+gNvpQltLMQhob8rew/bWWc/bGTuUr0EUGt0w==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/entities": {
+ "version": "8.1.0",
+ "resolved": "https://registry.npmjs.org/entities/-/entities-8.1.0.tgz",
+ "integrity": "sha512-kxL7msIffSuh9aaFAMD7rxAIuTRMAHMeBtgHW2yUdWw732ZNh4MehkF2gdjvtdmikkaIP9bFDDJOPlsvm7avrA==",
+ "license": "BSD-2-Clause",
+ "engines": {
+ "node": ">=20.19.0"
+ },
+ "funding": {
+ "url": "https://github.com/fb55/entities?sponsor=1"
+ }
+ },
+ "node_modules/es-define-property": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz",
+ "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/es-errors": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
+ "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/es-object-atoms": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz",
+ "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==",
+ "license": "MIT",
+ "dependencies": {
+ "es-errors": "^1.3.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/escape-html": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
+ "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==",
+ "license": "MIT"
+ },
+ "node_modules/etag": {
+ "version": "1.8.1",
+ "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
+ "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/express": {
+ "version": "4.22.3",
+ "resolved": "https://registry.npmjs.org/express/-/express-4.22.3.tgz",
+ "integrity": "sha512-Bdcs4+3qlpVlx2NRn6fgX2Ue2/gGRaPeawebgclM0ERSCqDpA+owF1fdPwjJUTAJWMTuAaxjDf+hzb0/4eKvvw==",
+ "license": "MIT",
+ "dependencies": {
+ "accepts": "~1.3.8",
+ "array-flatten": "1.1.1",
+ "body-parser": "~1.20.5",
+ "content-disposition": "~0.5.4",
+ "content-type": "~1.0.4",
+ "cookie": "~0.7.1",
+ "cookie-signature": "~1.0.6",
+ "debug": "2.6.9",
+ "depd": "2.0.0",
+ "encodeurl": "~2.0.0",
+ "escape-html": "~1.0.3",
+ "etag": "~1.8.1",
+ "finalhandler": "~1.3.1",
+ "fresh": "~0.5.2",
+ "http-errors": "~2.0.0",
+ "merge-descriptors": "1.0.3",
+ "methods": "~1.1.2",
+ "on-finished": "~2.4.1",
+ "parseurl": "~1.3.3",
+ "path-to-regexp": "~0.1.13",
+ "proxy-addr": "~2.0.7",
+ "qs": "~6.16.0",
+ "range-parser": "~1.2.1",
+ "safe-buffer": "5.2.1",
+ "send": "~0.19.0",
+ "serve-static": "~1.16.2",
+ "setprototypeof": "1.2.0",
+ "statuses": "~2.0.1",
+ "type-is": "~1.6.18",
+ "utils-merge": "1.0.1",
+ "vary": "~1.1.2"
+ },
+ "engines": {
+ "node": ">= 0.10.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/finalhandler": {
+ "version": "1.3.2",
+ "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.2.tgz",
+ "integrity": "sha512-aA4RyPcd3badbdABGDuTXCMTtOneUCAYH/gxoYRTZlIJdF0YPWuGqiAsIrhNnnqdXGswYk6dGujem4w80UJFhg==",
+ "license": "MIT",
+ "dependencies": {
+ "debug": "2.6.9",
+ "encodeurl": "~2.0.0",
+ "escape-html": "~1.0.3",
+ "on-finished": "~2.4.1",
+ "parseurl": "~1.3.3",
+ "statuses": "~2.0.2",
+ "unpipe": "~1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/forwarded": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
+ "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/fresh": {
+ "version": "0.5.2",
+ "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
+ "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/function-bind": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
+ "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
+ "license": "MIT",
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/get-intrinsic": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
+ "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==",
+ "license": "MIT",
+ "dependencies": {
+ "call-bind-apply-helpers": "^1.0.2",
+ "es-define-property": "^1.0.1",
+ "es-errors": "^1.3.0",
+ "es-object-atoms": "^1.1.1",
+ "function-bind": "^1.1.2",
+ "get-proto": "^1.0.1",
+ "gopd": "^1.2.0",
+ "has-symbols": "^1.1.0",
+ "hasown": "^2.0.2",
+ "math-intrinsics": "^1.1.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/get-proto": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz",
+ "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",
+ "license": "MIT",
+ "dependencies": {
+ "dunder-proto": "^1.0.1",
+ "es-object-atoms": "^1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/gopd": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
+ "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/has-symbols": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz",
+ "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/hasown": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz",
+ "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==",
+ "license": "MIT",
+ "dependencies": {
+ "function-bind": "^1.1.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/html-escaper": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-3.0.3.tgz",
+ "integrity": "sha512-RuMffC89BOWQoY0WKGpIhn5gX3iI54O6nRA0yC124NYVtzjmFWBIiFd8M0x+ZdX0P9R4lADg1mgP8C7PxGOWuQ==",
+ "license": "MIT"
+ },
+ "node_modules/htmlparser2": {
+ "version": "10.1.0",
+ "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-10.1.0.tgz",
+ "integrity": "sha512-VTZkM9GWRAtEpveh7MSF6SjjrpNVNNVJfFup7xTY3UpFtm67foy9HDVXneLtFVt4pMz5kZtgNcvCniNFb1hlEQ==",
+ "funding": [
+ "https://github.com/fb55/htmlparser2?sponsor=1",
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/fb55"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "domelementtype": "^2.3.0",
+ "domhandler": "^5.0.3",
+ "domutils": "^3.2.2",
+ "entities": "^7.0.1"
+ }
+ },
+ "node_modules/htmlparser2/node_modules/dom-serializer": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz",
+ "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==",
+ "license": "MIT",
+ "dependencies": {
+ "domelementtype": "^2.3.0",
+ "domhandler": "^5.0.2",
+ "entities": "^4.2.0"
+ },
+ "funding": {
+ "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1"
+ }
+ },
+ "node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities": {
+ "version": "4.5.0",
+ "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz",
+ "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==",
+ "license": "BSD-2-Clause",
+ "engines": {
+ "node": ">=0.12"
+ },
+ "funding": {
+ "url": "https://github.com/fb55/entities?sponsor=1"
+ }
+ },
+ "node_modules/htmlparser2/node_modules/domelementtype": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz",
+ "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/fb55"
+ }
+ ],
+ "license": "BSD-2-Clause"
+ },
+ "node_modules/htmlparser2/node_modules/domhandler": {
+ "version": "5.0.3",
+ "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz",
+ "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==",
+ "license": "BSD-2-Clause",
+ "dependencies": {
+ "domelementtype": "^2.3.0"
+ },
+ "engines": {
+ "node": ">= 4"
+ },
+ "funding": {
+ "url": "https://github.com/fb55/domhandler?sponsor=1"
+ }
+ },
+ "node_modules/htmlparser2/node_modules/domutils": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.2.2.tgz",
+ "integrity": "sha512-6kZKyUajlDuqlHKVX1w7gyslj9MPIXzIFiz/rGu35uC1wMi+kMhQwGhl4lt9unC9Vb9INnY9Z3/ZA3+FhASLaw==",
+ "license": "BSD-2-Clause",
+ "dependencies": {
+ "dom-serializer": "^2.0.0",
+ "domelementtype": "^2.3.0",
+ "domhandler": "^5.0.3"
+ },
+ "funding": {
+ "url": "https://github.com/fb55/domutils?sponsor=1"
+ }
+ },
+ "node_modules/htmlparser2/node_modules/entities": {
+ "version": "7.0.1",
+ "resolved": "https://registry.npmjs.org/entities/-/entities-7.0.1.tgz",
+ "integrity": "sha512-TWrgLOFUQTH994YUyl1yT4uyavY5nNB5muff+RtWaqNVCAK408b5ZnnbNAUEWLTCpum9w6arT70i1XdQ4UeOPA==",
+ "license": "BSD-2-Clause",
+ "engines": {
+ "node": ">=0.12"
+ },
+ "funding": {
+ "url": "https://github.com/fb55/entities?sponsor=1"
+ }
+ },
+ "node_modules/http-errors": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz",
+ "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==",
+ "license": "MIT",
+ "dependencies": {
+ "depd": "~2.0.0",
+ "inherits": "~2.0.4",
+ "setprototypeof": "~1.2.0",
+ "statuses": "~2.0.2",
+ "toidentifier": "~1.0.1"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/iconv-lite": {
+ "version": "0.4.24",
+ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
+ "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
+ "license": "MIT",
+ "dependencies": {
+ "safer-buffer": ">= 2.1.2 < 3"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/inherits": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
+ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
+ "license": "ISC"
+ },
+ "node_modules/ipaddr.js": {
+ "version": "1.9.1",
+ "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
+ "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.10"
+ }
+ },
+ "node_modules/jsonwebtoken": {
+ "version": "9.0.3",
+ "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.3.tgz",
+ "integrity": "sha512-MT/xP0CrubFRNLNKvxJ2BYfy53Zkm++5bX9dtuPbqAeQpTVe0MQTFhao8+Cp//EmJp244xt6Drw/GVEGCUj40g==",
+ "license": "MIT",
+ "dependencies": {
+ "jws": "^4.0.1",
+ "lodash.includes": "^4.3.0",
+ "lodash.isboolean": "^3.0.3",
+ "lodash.isinteger": "^4.0.4",
+ "lodash.isnumber": "^3.0.3",
+ "lodash.isplainobject": "^4.0.6",
+ "lodash.isstring": "^4.0.1",
+ "lodash.once": "^4.0.0",
+ "ms": "^2.1.1",
+ "semver": "^7.5.4"
+ },
+ "engines": {
+ "node": ">=12",
+ "npm": ">=6"
+ }
+ },
+ "node_modules/jsonwebtoken/node_modules/ms": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
+ "license": "MIT"
+ },
+ "node_modules/jwa": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.1.tgz",
+ "integrity": "sha512-hRF04fqJIP8Abbkq5NKGN0Bbr3JxlQ+qhZufXVr0DvujKy93ZCbXZMHDL4EOtodSbCWxOqR8MS1tXA5hwqCXDg==",
+ "license": "MIT",
+ "dependencies": {
+ "buffer-equal-constant-time": "^1.0.1",
+ "ecdsa-sig-formatter": "1.0.11",
+ "safe-buffer": "^5.0.1"
+ }
+ },
+ "node_modules/jws": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.1.tgz",
+ "integrity": "sha512-EKI/M/yqPncGUUh44xz0PxSidXFr/+r0pA70+gIYhjv+et7yxM+s29Y+VGDkovRofQem0fs7Uvf4+YmAdyRduA==",
+ "license": "MIT",
+ "dependencies": {
+ "jwa": "^2.0.1",
+ "safe-buffer": "^5.0.1"
+ }
+ },
+ "node_modules/linkedom": {
+ "version": "0.18.15",
+ "resolved": "https://registry.npmjs.org/linkedom/-/linkedom-0.18.15.tgz",
+ "integrity": "sha512-o0w7eD/SvoCao+pUi6dzocCLuMR11g4Tv/et0W2OUzwWmUcewntSzyl+Ua/K+0yKym0Y/Mav3nFAaI5Av5jvZg==",
+ "license": "ISC",
+ "dependencies": {
+ "css-select": "^7.0.0",
+ "cssomnom": "^0.1.11",
+ "html-escaper": "^3.0.3",
+ "htmlparser2": "^10.1.0",
+ "uhyphen": "^0.2.0"
+ },
+ "engines": {
+ "node": ">=16"
+ },
+ "peerDependencies": {
+ "canvas": ">= 2"
+ },
+ "peerDependenciesMeta": {
+ "canvas": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/lodash.includes": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz",
+ "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==",
+ "license": "MIT"
+ },
+ "node_modules/lodash.isboolean": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz",
+ "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==",
+ "license": "MIT"
+ },
+ "node_modules/lodash.isinteger": {
+ "version": "4.0.4",
+ "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz",
+ "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==",
+ "license": "MIT"
+ },
+ "node_modules/lodash.isnumber": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz",
+ "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==",
+ "license": "MIT"
+ },
+ "node_modules/lodash.isplainobject": {
+ "version": "4.0.6",
+ "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz",
+ "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==",
+ "license": "MIT"
+ },
+ "node_modules/lodash.isstring": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz",
+ "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==",
+ "license": "MIT"
+ },
+ "node_modules/lodash.once": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz",
+ "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==",
+ "license": "MIT"
+ },
+ "node_modules/math-intrinsics": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
+ "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/media-typer": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
+ "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/merge-descriptors": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz",
+ "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==",
+ "license": "MIT",
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/methods": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
+ "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/mime": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
+ "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==",
+ "license": "MIT",
+ "bin": {
+ "mime": "cli.js"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/mime-db": {
+ "version": "1.52.0",
+ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
+ "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/mime-types": {
+ "version": "2.1.35",
+ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
+ "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
+ "license": "MIT",
+ "dependencies": {
+ "mime-db": "1.52.0"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/ms": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
+ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==",
+ "license": "MIT"
+ },
+ "node_modules/negotiator": {
+ "version": "0.6.3",
+ "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz",
+ "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/nth-check": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-3.0.1.tgz",
+ "integrity": "sha512-GX0gsdbGVCgnRgbeGaubfjpBXyYRWOOCVeYh08bSQvDZqxz5ndXs1OTfAt/h36G1xvI94YIspsI0sVFqAV9+RQ==",
+ "license": "BSD-2-Clause",
+ "dependencies": {
+ "boolbase": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=20.19.0"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/fb55/nth-check?sponsor=1"
+ }
+ },
+ "node_modules/object-inspect": {
+ "version": "1.13.4",
+ "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz",
+ "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/on-finished": {
+ "version": "2.4.2",
+ "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.2.tgz",
+ "integrity": "sha512-ATWUv387i+nLD49EiDoOft5scf32Vsdz3ktrQJG9bi7jRFmaXTssvyvj1EmeKVVgvesbqUtvQQvaS2TpTukAZQ==",
+ "license": "MIT",
+ "dependencies": {
+ "ee-first": "1.1.1"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/openvibe-sdk": {
+ "version": "0.187.0",
+ "resolved": "https://git.openvibe.codes/api/v1/repos/openvibers/openvibe.sdk/archive/v0.187.0.tar.gz",
+ "integrity": "sha512-usvpN1PvjhtWF1IRuxI3zn34j+DG3UM79xVOFI4nQFpgOFPzHR4V+4EjsCLBENgW8BI1dWegHAibEGCOjWkcAg==",
+ "license": "MIT",
+ "bin": {
+ "openvibe-download": "bin/openvibe-download.js"
+ },
+ "engines": {
+ "node": ">=20"
+ },
+ "peerDependencies": {
+ "@electric-sql/pglite": "^0.5.8",
+ "iovalkey": "^0.4.0",
+ "pg": "^8.23.0"
+ },
+ "peerDependenciesMeta": {
+ "@electric-sql/pglite": {
+ "optional": true
+ },
+ "iovalkey": {
+ "optional": true
+ },
+ "pg": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/openvibe-shared": {
+ "version": "4.314.0",
+ "resolved": "https://git.openvibe.codes/api/v1/repos/openvibers/openvibe.shared/archive/v4.314.0.tar.gz",
+ "integrity": "sha512-f+xvo4A55iHoUMZ8pNgeK0t+ocrJveQRehP4zgv11oFUFFPg3KYmp0Y9Knq24ApK0ibk5p5okzhNj1UR/lxchw==",
+ "license": "MIT",
+ "dependencies": {
+ "clean-css": "^5.3.3",
+ "jsonwebtoken": "^9.0.0",
+ "linkedom": "^0.18.13",
+ "terser": "^5.51.2"
+ },
+ "bin": {
+ "openvibe-build-assets": "scripts/build-assets.js",
+ "ov-icon-audit": "scripts/icon-audit.js"
+ }
+ },
+ "node_modules/parseurl": {
+ "version": "1.3.3",
+ "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
+ "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/path-to-regexp": {
+ "version": "0.1.13",
+ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.13.tgz",
+ "integrity": "sha512-A/AGNMFN3c8bOlvV9RreMdrv7jsmF9XIfDeCd87+I8RNg6s78BhJxMu69NEMHBSJFxKidViTEdruRwEk/WIKqA==",
+ "license": "MIT"
+ },
+ "node_modules/pg": {
+ "version": "8.23.1",
+ "resolved": "https://registry.npmjs.org/pg/-/pg-8.23.1.tgz",
+ "integrity": "sha512-aL96AHANtWjPLDOLqnhx+ngp9+UK7ETEU8VJrDCGvsSSi/mGLcWYsS6Herg7lmaBJe4uwrfqsa7gTEFaSizDoQ==",
+ "license": "MIT",
+ "dependencies": {
+ "pg-connection-string": "^2.14.1",
+ "pg-pool": "^3.14.0",
+ "pg-protocol": "^1.16.1",
+ "pg-types": "2.2.0",
+ "pgpass": "1.0.5"
+ },
+ "engines": {
+ "node": ">= 16.0.0"
+ },
+ "optionalDependencies": {
+ "pg-cloudflare": "^1.4.1"
+ },
+ "peerDependencies": {
+ "pg-native": ">=3.0.1"
+ },
+ "peerDependenciesMeta": {
+ "pg-native": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/pg-cloudflare": {
+ "version": "1.4.1",
+ "resolved": "https://registry.npmjs.org/pg-cloudflare/-/pg-cloudflare-1.4.1.tgz",
+ "integrity": "sha512-6PQbsFWZcp9EmJEwy5cGQ2La+AMWpP46lgbb8X+U/XsHIUweYDNCpeuKck5RxL2MdVFi7krbbEi5nX4Zh7JhrQ==",
+ "license": "MIT",
+ "optional": true
+ },
+ "node_modules/pg-connection-string": {
+ "version": "2.14.1",
+ "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.14.1.tgz",
+ "integrity": "sha512-qR3kGNPBLpCNtz0evbKA0Y/MRFXwSSdT+pTJvYp/bXTcReZbvX1kzF0IyTc1QnxqF7AZbOeBhNL8R5mYQZV/MA==",
+ "license": "MIT"
+ },
+ "node_modules/pg-int8": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz",
+ "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==",
+ "license": "ISC",
+ "engines": {
+ "node": ">=4.0.0"
+ }
+ },
+ "node_modules/pg-pool": {
+ "version": "3.14.0",
+ "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.14.0.tgz",
+ "integrity": "sha512-gKtPkFdQPU3DksooVLi9LsjZxrsBUZIpa+7aVx+LV5pNh0KzP4Zleud2po+ConrxbuXGBJ6Hfer6hdgpIBpBaw==",
+ "license": "MIT",
+ "peerDependencies": {
+ "pg": ">=8.0"
+ }
+ },
+ "node_modules/pg-protocol": {
+ "version": "1.16.1",
+ "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.16.1.tgz",
+ "integrity": "sha512-p9VOFMiHB/ZbJATetbg+99PxssTVSQRnyuPSQ67mN1+1KBOjZaZ83ZQzltnxPhJwSsC3nwVjJ10DVJlerbFzLg==",
+ "license": "MIT"
+ },
+ "node_modules/pg-types": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz",
+ "integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==",
+ "license": "MIT",
+ "dependencies": {
+ "pg-int8": "1.0.1",
+ "postgres-array": "~2.0.0",
+ "postgres-bytea": "~1.0.0",
+ "postgres-date": "~1.0.4",
+ "postgres-interval": "^1.1.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/pgpass": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.5.tgz",
+ "integrity": "sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==",
+ "license": "MIT",
+ "dependencies": {
+ "split2": "^4.1.0"
+ }
+ },
+ "node_modules/postgres-array": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz",
+ "integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/postgres-bytea": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.1.tgz",
+ "integrity": "sha512-5+5HqXnsZPE65IJZSMkZtURARZelel2oXUEO8rH83VS/hxH5vv1uHquPg5wZs8yMAfdv971IU+kcPUczi7NVBQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/postgres-date": {
+ "version": "1.0.7",
+ "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz",
+ "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/postgres-interval": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz",
+ "integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==",
+ "license": "MIT",
+ "dependencies": {
+ "xtend": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/proxy-addr": {
+ "version": "2.0.8",
+ "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.8.tgz",
+ "integrity": "sha512-5nnx0yGyVUcY6t9RnWcARWtwT9F1D8O9rt08htPvnd49W1IgZtmLkhu9WfMzQj1cFxjHIO6connUNVW5k7AVyQ==",
+ "license": "MIT",
+ "dependencies": {
+ "forwarded": "0.2.0",
+ "ipaddr.js": "1.9.1"
+ },
+ "engines": {
+ "node": ">= 0.10"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/qs": {
+ "version": "6.16.2",
+ "resolved": "https://registry.npmjs.org/qs/-/qs-6.16.2.tgz",
+ "integrity": "sha512-VYdnB5S7/0IeXzBacUtwNAaM6d7Y/PgYnNC7bJCI6meqA/OgnsQbZMtVW8Dt2D1PHgbHGtYmhSoEIgvt7xZ2ZA==",
+ "license": "BSD-3-Clause",
+ "dependencies": {
+ "es-define-property": "^1.0.1",
+ "side-channel": "^1.1.1"
+ },
+ "engines": {
+ "node": ">=0.6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/range-parser": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
+ "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/raw-body": {
+ "version": "2.5.3",
+ "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.3.tgz",
+ "integrity": "sha512-s4VSOf6yN0rvbRZGxs8Om5CWj6seneMwK3oDb4lWDH0UPhWcxwOWw5+qk24bxq87szX1ydrwylIOp2uG1ojUpA==",
+ "license": "MIT",
+ "dependencies": {
+ "bytes": "~3.1.2",
+ "http-errors": "~2.0.1",
+ "iconv-lite": "~0.4.24",
+ "unpipe": "~1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/safe-buffer": {
+ "version": "5.2.1",
+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
+ "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
+ "license": "MIT"
+ },
+ "node_modules/safer-buffer": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
+ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
+ "license": "MIT"
+ },
+ "node_modules/semver": {
+ "version": "7.8.6",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.6.tgz",
+ "integrity": "sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==",
+ "license": "ISC",
+ "bin": {
+ "semver": "bin/semver.js"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/send": {
+ "version": "0.19.2",
+ "resolved": "https://registry.npmjs.org/send/-/send-0.19.2.tgz",
+ "integrity": "sha512-VMbMxbDeehAxpOtWJXlcUS5E8iXh6QmN+BkRX1GARS3wRaXEEgzCcB10gTQazO42tpNIya8xIyNx8fll1OFPrg==",
+ "license": "MIT",
+ "dependencies": {
+ "debug": "2.6.9",
+ "depd": "2.0.0",
+ "destroy": "1.2.0",
+ "encodeurl": "~2.0.0",
+ "escape-html": "~1.0.3",
+ "etag": "~1.8.1",
+ "fresh": "~0.5.2",
+ "http-errors": "~2.0.1",
+ "mime": "1.6.0",
+ "ms": "2.1.3",
+ "on-finished": "~2.4.1",
+ "range-parser": "~1.2.1",
+ "statuses": "~2.0.2"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/send/node_modules/ms": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
+ "license": "MIT"
+ },
+ "node_modules/serve-static": {
+ "version": "1.16.3",
+ "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.3.tgz",
+ "integrity": "sha512-x0RTqQel6g5SY7Lg6ZreMmsOzncHFU7nhnRWkKgWuMTu5NN0DR5oruckMqRvacAN9d5w6ARnRBXl9xhDCgfMeA==",
+ "license": "MIT",
+ "dependencies": {
+ "encodeurl": "~2.0.0",
+ "escape-html": "~1.0.3",
+ "parseurl": "~1.3.3",
+ "send": "~0.19.1"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/setprototypeof": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",
+ "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==",
+ "license": "ISC"
+ },
+ "node_modules/side-channel": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.1.tgz",
+ "integrity": "sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==",
+ "license": "MIT",
+ "dependencies": {
+ "es-errors": "^1.3.0",
+ "object-inspect": "^1.13.4",
+ "side-channel-list": "^1.0.1",
+ "side-channel-map": "^1.0.1",
+ "side-channel-weakmap": "^1.0.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/side-channel-list": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.1.tgz",
+ "integrity": "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==",
+ "license": "MIT",
+ "dependencies": {
+ "es-errors": "^1.3.0",
+ "object-inspect": "^1.13.4"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/side-channel-map": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz",
+ "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==",
+ "license": "MIT",
+ "dependencies": {
+ "call-bound": "^1.0.2",
+ "es-errors": "^1.3.0",
+ "get-intrinsic": "^1.2.5",
+ "object-inspect": "^1.13.3"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/side-channel-weakmap": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz",
+ "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==",
+ "license": "MIT",
+ "dependencies": {
+ "call-bound": "^1.0.2",
+ "es-errors": "^1.3.0",
+ "get-intrinsic": "^1.2.5",
+ "object-inspect": "^1.13.3",
+ "side-channel-map": "^1.0.1"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/source-map": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+ "license": "BSD-3-Clause",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/source-map-support": {
+ "version": "0.5.21",
+ "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz",
+ "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==",
+ "license": "MIT",
+ "dependencies": {
+ "buffer-from": "^1.0.0",
+ "source-map": "^0.6.0"
+ }
+ },
+ "node_modules/split2": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz",
+ "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==",
+ "license": "ISC",
+ "engines": {
+ "node": ">= 10.x"
+ }
+ },
+ "node_modules/statuses": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz",
+ "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/terser": {
+ "version": "5.51.2",
+ "resolved": "https://registry.npmjs.org/terser/-/terser-5.51.2.tgz",
+ "integrity": "sha512-bWnjSNscmuI+GJze6ZupnHP8G/cTcsJF+bXCeQknk2SHQsgbNJnLrqiH9jZ2W4STPVXH2mDKKRX3iwPhc9Cn/Q==",
+ "license": "BSD-2-Clause",
+ "dependencies": {
+ "@jridgewell/source-map": "^0.3.3",
+ "acorn": "^8.15.0",
+ "commander": "^2.20.0",
+ "source-map-support": "~0.5.20"
+ },
+ "bin": {
+ "terser": "bin/terser"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/toidentifier": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
+ "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.6"
+ }
+ },
+ "node_modules/type-is": {
+ "version": "1.6.18",
+ "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
+ "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==",
+ "license": "MIT",
+ "dependencies": {
+ "media-typer": "0.3.0",
+ "mime-types": "~2.1.24"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/uhyphen": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/uhyphen/-/uhyphen-0.2.0.tgz",
+ "integrity": "sha512-qz3o9CHXmJJPGBdqzab7qAYuW8kQGKNEuoHFYrBwV6hWIMcpAmxDLXojcHfFr9US1Pe6zUswEIJIbLI610fuqA==",
+ "license": "ISC"
+ },
+ "node_modules/unpipe": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
+ "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/utils-merge": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
+ "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4.0"
+ }
+ },
+ "node_modules/vary": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
+ "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/xtend": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
+ "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.4"
+ }
+ }
+ }
+}
new file mode 100644
new file mode 100644
@@ -0,0 +1,23 @@
@@ -0,0 +1,23 @@
+{
+ "name": "openvibe-finance",
+ "version": "0.1.0",
+ "private": true,
+ "description": "Your money, your rules, your data: accounts, CSV imports and a monthly picture, private to you",
+ "main": "server/index.js",
+ "scripts": {
+ "start": "node server/index.js",
+ "test": "node test/run.js",
+ "test:pg": "FINANCE_TEST_STORE=pg node test/run.js"
+ },
+ "engines": {
+ "node": ">=22"
+ },
+ "license": "AGPL-3.0-only",
+ "dependencies": {
+ "@electric-sql/pglite": "^0.5.8",
+ "express": "^4.21.2",
+ "openvibe-sdk": "https://git.openvibe.codes/api/v1/repos/openvibers/openvibe.sdk/archive/v0.187.0.tar.gz",
+ "openvibe-shared": "https://git.openvibe.codes/api/v1/repos/openvibers/openvibe.shared/archive/v4.314.0.tar.gz",
+ "pg": "^8.23.1"
+ }
+}
new file mode 100644
new file mode 100644
@@ -0,0 +1,88 @@
@@ -0,0 +1,88 @@
+/* OpenVibe.Finance: theme tokens only (kit.css defines them for both themes), phone first, 44 px targets. */
+.fin { max-width: 860px; }
+.fin h1 { margin: 0; font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); letter-spacing: -0.02em; }
+.fin-head { display: grid; gap: 4px; margin: 0 0 14px; }
+.fin-crumb { margin: 0; font-size: 14px; }
+.fin-crumb a, .fin-foot a { color: var(--text-secondary, #9aa4b2); }
+.fin-total { margin: 0; font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
+.fin-lede { max-width: 60ch; color: var(--text-secondary, #9aa4b2); font-size: 1.05rem; line-height: 1.55; }
+.fin-hero { padding: 8px 0 4px; }
+.fin-promises { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 10px; max-width: 62ch; }
+.fin-promises li { padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border, #1f2937); line-height: 1.5; }
+.fin-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: 12px;
+ border: 1px solid var(--border, #1f2937); background: var(--surface, transparent); color: var(--text, #e8ecf3); font: inherit; font-weight: 600;
+ text-decoration: none; cursor: pointer; transition: transform .12s ease, filter .12s ease; }
+.fin-btn--primary { background: var(--accent, #5b8cff); border-color: transparent; color: var(--accent-contrast, #fff); }
+.fin-btn--danger { border-color: var(--danger, #b91c1c); color: var(--danger, #fca5a5); }
+.fin-btn:active { transform: scale(.97); }
+.fin-error { padding: 10px 14px; border-radius: 12px; border: 1px solid var(--danger, #b91c1c); color: var(--danger, #fca5a5); }
+.fin-said { padding: 10px 14px; border-radius: 12px; background: var(--accent-soft, rgba(91, 140, 255, .12)); }
+.fin-empty, .fin-note { color: var(--text-secondary, #9aa4b2); line-height: 1.5; }
+.fin-month-card { margin: 0 0 12px; }
+.fin-month-link { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; padding: 12px 14px; border-radius: 14px;
+ border: 1px solid var(--border, #1f2937); color: inherit; text-decoration: none; }
+.fin-month-link > span:first-child { font-weight: 700; flex: 1 1 100%; }
+.fin-in { color: var(--success, #22c55e); font-variant-numeric: tabular-nums; }
+.fin-out { color: var(--text, #e8ecf3); font-variant-numeric: tabular-nums; }
+.is-neg { color: var(--danger, #f87171); }
+.fin-accounts, .fin-txns, .fin-bars { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
+.fin-account { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; padding: 10px 14px; border-radius: 14px;
+ border: 1px solid var(--border, #1f2937); color: inherit; text-decoration: none; transition: border-color .12s ease, transform .12s ease; }
+.fin-account:hover { border-color: var(--accent, #5b8cff); }
+.fin-account:active { transform: scale(.99); }
+.fin-account-name { display: grid; gap: 2px; min-width: 0; font-weight: 600; }
+.fin-account-name small { font-weight: 400; color: var(--text-secondary, #9aa4b2); }
+.fin-account-balance { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
+.fin-fold { margin: 0 0 10px; border: 1px solid var(--border, #1f2937); border-radius: 14px; padding: 0 14px; }
+.fin-fold > summary { min-height: 48px; display: flex; align-items: center; font-weight: 600; cursor: pointer; }
+.fin-form { display: grid; gap: 10px; padding-bottom: 12px; }
+.fin-row { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
+.fin-field { display: grid; gap: 6px; font-weight: 600; min-width: 0; }
+.fin-field input, .fin-field textarea { min-height: 44px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border, #1f2937);
+ background: var(--bg-input, #0f1626); color: inherit; font: inherit; font-weight: 400; min-width: 0; }
+.fin-field textarea { resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
+.fin-field input:focus-visible, .fin-field textarea:focus-visible { outline: 2px solid var(--accent, #5b8cff); outline-offset: 1px; }
+.fin-chips { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
+.fin-chips legend { font-weight: 600; padding: 0; margin-bottom: 6px; width: 100%; }
+.fin-chip { position: relative; display: inline-flex; }
+.fin-chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
+.fin-chip span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--border, #1f2937);
+ color: var(--text-secondary, #9aa4b2); font-size: 14px; transition: background .12s ease, color .12s ease; }
+.fin-chip input:checked + span { background: var(--accent, #5b8cff); border-color: transparent; color: var(--accent-contrast, #fff); }
+.fin-chip input:focus-visible + span { outline: 2px solid var(--accent, #5b8cff); outline-offset: 2px; }
+.fin-check { display: flex; align-items: center; gap: 10px; min-height: 44px; }
+.fin-check input { width: 20px; height: 20px; accent-color: var(--danger, #b91c1c); }
+.fin-monthnav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 14px 0 10px; font-size: 14px; }
+.fin-monthnav a { color: var(--text-secondary, #9aa4b2); min-height: 44px; display: inline-flex; align-items: center; }
+.fin-txn { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px 12px; border-radius: 12px;
+ border: 1px solid var(--border, #1f2937); }
+.fin-txn-date { color: var(--text-secondary, #9aa4b2); font-size: 13px; font-variant-numeric: tabular-nums; padding-top: 2px; }
+.fin-txn-what { display: grid; gap: 4px; min-width: 0; }
+.fin-txn-what b, .fin-txn-what small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
+.fin-txn-what small { color: var(--text-secondary, #9aa4b2); }
+.fin-txn-amount { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
+.fin-txn-amount.is-pos { color: var(--success, #22c55e); }
+.fin-cat { display: flex; gap: 6px; align-items: center; }
+.fin-cat input { min-height: 36px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--border, #1f2937); background: transparent; color: inherit;
+ font: inherit; font-size: 13px; min-width: 0; flex: 1 1 auto; max-width: 220px; }
+.fin-mini { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border, #1f2937); background: transparent; color: var(--text-secondary, #9aa4b2); font: inherit; font-size: 13px; cursor: pointer; }
+.fin-sums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 14px; }
+.fin-sums p { margin: 0; padding: 12px; border-radius: 14px; border: 1px solid var(--border, #1f2937); display: grid; gap: 2px; }
+.fin-sums span { color: var(--text-secondary, #9aa4b2); font-size: 13px; }
+.fin-sums b { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
+.fin-bars li { display: grid; grid-template-columns: minmax(0, 9rem) minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 36px; }
+.fin-bar-name { display: flex; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
+.fin-bar-name small { color: var(--text-secondary, #9aa4b2); }
+.fin-bar { height: 10px; border-radius: 999px; background: var(--surface-2, rgba(148, 163, 184, .15)); overflow: hidden; }
+.fin-bar > span { display: block; height: 100%; width: var(--w); border-radius: inherit; background: var(--accent, #5b8cff); transition: width .3s ease; }
+.fin-bar-sum { font-variant-numeric: tabular-nums; white-space: nowrap; }
+.fin-sec { margin: 0 0 18px; }
+.fin-sec h2 { font-size: 1.1rem; margin: 0 0 4px; }
+@media (min-width: 900px) { .fin-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; } }
+html[data-ov-motion="off"] .fin-btn, html[data-ov-motion="off"] .fin-account, html[data-ov-motion="off"] .fin-chip span, html[data-ov-motion="off"] .fin-bar > span { transition: none; }
+html[data-ov-motion="off"] .fin-btn:active, html[data-ov-motion="off"] .fin-account:active { transform: none; }
+/* The file picker: our button over a hidden native input (still reachable by keyboard and readers). */
+.fin-file { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; cursor: pointer; }
+.fin-file input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
+.fin-file input:focus-visible + .fin-btn { outline: 2px solid var(--accent, #5b8cff); outline-offset: 2px; }
+.fin-file-name { color: var(--text-secondary, #9aa4b2); font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
new file mode 100644
new file mode 100644
@@ -0,0 +1,17 @@
@@ -0,0 +1,17 @@
+// OpenVibe.Finance: a chosen CSV file goes into the paste box (the form posts the text; nothing leaves before Import).
+(function () {
+ document.addEventListener('change', function (e) {
+ var input = e.target;
+ if (!input || !input.matches || !input.matches('input[data-fin-file="csv"]') || !input.files || !input.files[0]) return;
+ var file = input.files[0];
+ input.setCustomValidity('');
+ if (file.size > 4 * 1024 * 1024) { input.setCustomValidity('That file is over 4 MB. Export fewer months at a time.'); input.reportValidity(); input.value = ''; return; }
+ var box = input.closest('form') && input.closest('form').querySelector('textarea[data-fin-csv]');
+ if (!box) return;
+ var reader = new FileReader();
+ var named = input.closest('label') && input.closest('label').querySelector('[data-fin-file-name]');
+ if (named) named.textContent = file.name;
+ reader.onload = function () { box.value = String(reader.result || ''); };
+ reader.readAsText(file);
+ });
+})();
new file mode 100644
new file mode 100644
@@ -0,0 +1,170 @@
@@ -0,0 +1,170 @@
+'use strict';
+/**
+ * OpenVibe.Finance (plan §L.2): the pages and the JSON API over one person's accounts and transactions.
+ *
+ * createApp({ db, vault, auth, baseUrl }) → an Express app
+ * auth: openvibe-sdk/sso's client (router, optionalAuth); tests pass a stand-in that sets req.user.
+ *
+ * Pages: / (signed out: what it is; signed in: your accounts and this month), /accounts/:id (?m=YYYY-MM), /month,
+ * /data (download or delete everything). API (JSON, the same person, same rules): /api/v1/accounts,
+ * /api/v1/accounts/:id/transactions, /api/v1/accounts/:id/import (text/csv), /api/v1/months/:m, /api/v1/export.
+ * Every write is same-origin (a page form) or a Bearer call; nothing is cached; every answer says noindex.
+ */
+const express = require('express');
+const path = require('node:path');
+const { createStore, FinanceError } = require('./store');
+const { readCsv, readAmount } = require('./csv');
+const v = require('./views');
+
+function createApp({ db, vault, auth, baseUrl = 'https://openvibe.finance', now = () => new Date() }) {
+ const store = createStore({ db, vault });
+ const app = express();
+ app.disable('x-powered-by');
+ app.set('trust proxy', 'loopback');
+ try {
+ const release = require('openvibe-shared/release').createRelease({ service: 'finance', root: path.join(__dirname, '..') });
+ require('openvibe-shared/metrics').instrument(app, { service: 'finance', release: release.release });
+ app.get('/release.json', release.handler);
+ } catch { /* metrics are optional in tests */ }
+ app.use((req, res, next) => {
+ res.set({ 'X-Content-Type-Options': 'nosniff', 'Referrer-Policy': 'same-origin', 'X-Frame-Options': 'DENY', 'X-Robots-Tag': 'noindex, nofollow' });
+ next();
+ });
+ app.get('/api/health', (_req, res) => res.json({ status: 'ok', service: 'finance' }));
+ app.get('/api/ready', async (_req, res) => {
+ try { await db.value('SELECT 1'); res.json({ status: 'ok', service: 'finance' }); } catch { res.status(503).json({ status: 'unavailable' }); }
+ });
+ app.get('/robots.txt', (_req, res) => res.type('text').send('User-agent: *\nAllow: /$\nDisallow: /\n'));
+ app.use(express.static(path.join(__dirname, '..', 'public'), { maxAge: '1h' }));
+ app.use('/shared', require('openvibe-shared/serve').handler());
+ if (auth) app.use('/auth', auth.router(express));
+ app.use(auth ? auth.optionalAuth() : (_req, _res, next) => next());
+ app.use((req, res, next) => { res.set('Cache-Control', 'private, no-store'); next(); });
+
+ const who = (req) => (req.user && /^usr_/.test(String(req.user.subject_id || '')) ? String(req.user.subject_id) : null);
+ const own = new URL(baseUrl).origin;
+ const sameOrigin = (req) => {
+ if (/^Bearer\s/i.test(String(req.get('authorization') || ''))) return true;
+ const site = req.get('sec-fetch-site');
+ if (site) return site === 'same-origin';
+ const origin = req.get('origin');
+ return !origin || origin === own;
+ };
+ const form = express.urlencoded({ extended: false, limit: '4mb' });
+ const handle = (fn) => async (req, res, next) => {
+ try { await fn(req, res); } catch (err) {
+ if (err instanceof FinanceError) return req.path.startsWith('/api/') ? res.status(err.status).json({ error: err.message, code: err.code }) : res.status(err.status).send(v.page({ title: 'Something is wrong', body: `<p class="fin-error" role="alert">${v.esc(err.message)}</p><p><a href="/">Back</a></p>` }));
+ next(err);
+ }
+ };
+ const signIn = (req, res) => res.redirect(303, `/auth/login?next=${encodeURIComponent(req.originalUrl)}`);
+ const thisMonth = () => now().toISOString().slice(0, 7);
+ const monthOf = (q) => (/^\d{4}-(0[1-9]|1[0-2])$/.test(String(q || '')) ? String(q) : thisMonth());
+ const said = (q) => {
+ if (q.imported) { const [a, s] = String(q.imported).split(','); return `Imported ${Number(a) || 0} new transaction${Number(a) === 1 ? '' : 's'}${Number(s) ? `; ${Number(s)} already here` : ''}.`; }
+ if (q.added) return 'Added.';
+ if (q.deleted) return 'Everything is deleted.';
+ return '';
+ };
+ /** A typed amount and its direction → signed cents, or null. */
+ const amountOf = (text, direction) => { const c = readAmount(text); return c == null ? null : (direction === 'in' ? Math.abs(c) : -Math.abs(c)); };
+
+ // ── Pages ──
+ app.get('/', handle(async (req, res) => {
+ const me = who(req);
+ if (!me) return res.send(v.welcome());
+ res.send(v.home({ accounts: await store.accounts(me), month: await store.month(me, thisMonth()), o: { said: said(req.query) } }));
+ }));
+ app.post('/accounts', form, handle(async (req, res) => {
+ const me = who(req);
+ if (!me) return signIn(req, res);
+ if (!sameOrigin(req)) return res.status(403).send('A change must come from openvibe.finance itself.');
+ const opening = String(req.body.opening || '').trim() ? readAmount(req.body.opening) : 0;
+ if (opening == null) return res.status(422).send(v.home({ accounts: await store.accounts(me), month: await store.month(me, thisMonth()), o: { error: 'The opening balance is not a number.' } }));
+ const acc = await store.addAccount(me, { name: req.body.name, kind: req.body.kind, currency: req.body.currency, opening_cents: opening });
+ res.redirect(303, `/accounts/${acc.id}?added=1`);
+ }));
+ app.get('/accounts/:id', handle(async (req, res) => {
+ const me = who(req);
+ if (!me) return signIn(req, res);
+ const account = await store.account(me, req.params.id);
+ if (!account) return res.status(404).send(v.page({ title: 'No such account', body: '<h1>No such account of yours</h1><p><a href="/">Your money</a></p>' }));
+ const month = monthOf(req.query.m);
+ const all = (await store.accounts(me)).find((a) => a.id === account.id);
+ res.send(v.accountPage({ account, balance: all ? all.balance_cents : account.opening_cents, txns: await store.transactions(me, account.id, { month }), month, o: { said: said(req.query) } }));
+ }));
+ app.post('/accounts/:id/transactions', form, handle(async (req, res) => {
+ const me = who(req);
+ if (!me) return signIn(req, res);
+ if (!sameOrigin(req)) return res.status(403).send('A change must come from openvibe.finance itself.');
+ const cents = amountOf(req.body.amount, req.body.direction);
+ if (cents == null) throw new FinanceError(422, 'finance.transaction.amount', 'The amount is not a number.');
+ const t = await store.addTransaction(me, req.params.id, { posted_on: req.body.posted_on, amount_cents: cents, payee: req.body.payee, category: req.body.category });
+ res.redirect(303, `/accounts/${encodeURIComponent(req.params.id)}?m=${t.posted_on.slice(0, 7)}&added=1`);
+ }));
+ app.post('/accounts/:id/import', form, handle(async (req, res) => {
+ const me = who(req);
+ if (!me) return signIn(req, res);
+ if (!sameOrigin(req)) return res.status(403).send('A change must come from openvibe.finance itself.');
+ const read = readCsv(req.body.csv);
+ if (read.problem) throw new FinanceError(422, 'finance.import.unreadable', read.problem);
+ const out = await store.importRows(me, req.params.id, read.rows);
+ const latest = read.rows.map((r) => r.posted_on).sort().pop();
+ res.redirect(303, `/accounts/${encodeURIComponent(req.params.id)}?m=${latest.slice(0, 7)}&imported=${out.added},${out.skipped}`);
+ }));
+ app.post('/transactions/:id/category', form, handle(async (req, res) => {
+ const me = who(req);
+ if (!me) return signIn(req, res);
+ if (!sameOrigin(req)) return res.status(403).send('A change must come from openvibe.finance itself.');
+ const t = await store.setCategory(me, req.params.id, req.body.category);
+ res.redirect(303, `/accounts/${encodeURIComponent(t.account_id)}?m=${t.posted_on.slice(0, 7)}`);
+ }));
+ app.get('/month', handle(async (req, res) => {
+ const me = who(req);
+ if (!me) return signIn(req, res);
+ res.send(v.monthPage({ m: await store.month(me, monthOf(req.query.m)) }));
+ }));
+ app.get('/data', handle(async (req, res) => {
+ if (!who(req)) return signIn(req, res);
+ res.send(v.dataPage({ o: { said: said(req.query) } }));
+ }));
+ app.get('/data/export', handle(async (req, res) => {
+ const me = who(req);
+ if (!me) return signIn(req, res);
+ res.set('Content-Disposition', `attachment; filename="openvibe-finance-${thisMonth()}.json"`);
+ res.json(await store.exportAll(me));
+ }));
+ app.post('/data/delete', form, handle(async (req, res) => {
+ const me = who(req);
+ if (!me) return signIn(req, res);
+ if (!sameOrigin(req)) return res.status(403).send('A change must come from openvibe.finance itself.');
+ if (req.body.sure !== 'yes') return res.status(422).send(v.dataPage({ o: { error: 'Tick the box to say you are sure.' } }));
+ await store.removeAll(me);
+ res.redirect(303, '/data?deleted=1');
+ }));
+
+ // ── API (JSON) ──
+ const api = express.Router();
+ api.use((req, res, next) => { if (!who(req)) return res.status(401).json({ error: 'Sign in first.', code: 'finance.person' }); if (req.method !== 'GET' && !sameOrigin(req)) return res.status(403).json({ error: 'Cross-site writes are refused.', code: 'finance.cross_site' }); next(); });
+ api.get('/accounts', handle(async (req, res) => res.json({ accounts: await store.accounts(who(req)) })));
+ api.post('/accounts', express.json({ limit: '16kb' }), handle(async (req, res) => res.status(201).json(await store.addAccount(who(req), req.body || {}))));
+ api.get('/accounts/:id/transactions', handle(async (req, res) => {
+ if (!(await store.account(who(req), req.params.id))) throw new FinanceError(404, 'finance.account.not_found', 'No such account of yours.');
+ res.json({ transactions: await store.transactions(who(req), req.params.id, { month: req.query.m ? String(req.query.m) : null }) });
+ }));
+ api.post('/accounts/:id/transactions', express.json({ limit: '16kb' }), handle(async (req, res) => res.status(201).json(await store.addTransaction(who(req), req.params.id, req.body || {}))));
+ api.post('/accounts/:id/import', express.text({ type: ['text/csv', 'text/plain'], limit: '4mb' }), handle(async (req, res) => {
+ const read = readCsv(typeof req.body === 'string' ? req.body : '');
+ if (read.problem) throw new FinanceError(422, 'finance.import.unreadable', read.problem);
+ res.status(201).json({ ...(await store.importRows(who(req), req.params.id, read.rows)), unreadable: read.skipped.slice(0, 50) });
+ }));
+ api.get('/months/:m', handle(async (req, res) => res.json(await store.month(who(req), req.params.m))));
+ api.get('/export', handle(async (req, res) => res.json(await store.exportAll(who(req)))));
+ app.use('/api/v1', api);
+
+ app.use((_req, res) => res.status(404).send(v.page({ title: 'Not here', body: '<h1>Not here</h1><p><a href="/">Your money</a></p>' })));
+ app.use((err, _req, res, _next) => { console.error('[finance]', err && err.message); res.status(500).send('Something went wrong on our side.'); });
+ return app;
+}
+
+module.exports = { createApp };
new file mode 100644
new file mode 100644
@@ -0,0 +1,60 @@
@@ -0,0 +1,60 @@
+'use strict';
+/**
+ * Per-person encryption of the words in a person's money data (plan §L.2, "hosted private: encrypted per person").
+ *
+ * const vault = createVault(process.env.FINANCE_DATA_KEY); // 32 bytes, base64
+ * const sealed = vault.seal(subject, 'Whole Foods'); // 'v1.<iv>.<tag>.<ciphertext>' (base64url)
+ * vault.open(subject, sealed) // 'Whole Foods'
+ * vault.mark(subject, 'some text') // an HMAC: equal inputs, equal marks (dedupe)
+ *
+ * Each person's key is HKDF-SHA256 of the service key with their subject as the info, so one person's rows cannot be
+ * opened with another's key, and a database copy without the service key reads as noise. This is encryption at rest:
+ * the service holds the key and opens a row only to show it to its owner.
+ */
+const crypto = require('node:crypto');
+
+const SALT = Buffer.from('openvibe-finance/v1');
+
+function createVault(keyBase64) {
+ const master = Buffer.from(String(keyBase64 || ''), 'base64');
+ if (master.length !== 32) throw new Error('FINANCE_DATA_KEY must be 32 bytes, base64');
+ const keys = new Map();
+ const keyOf = (subject, use) => {
+ const id = `${use}\u0000${subject}`;
+ let k = keys.get(id);
+ if (!k) {
+ k = Buffer.from(crypto.hkdfSync('sha256', master, SALT, Buffer.from(id), 32));
+ if (keys.size > 5000) keys.clear();
+ keys.set(id, k);
+ }
+ return k;
+ };
+ const subjectOk = (subject) => {
+ if (!/^usr_[0-9A-Za-z]{10,40}$/.test(String(subject || ''))) throw new Error('a person (usr_ subject) is required');
+ };
+ function seal(subject, text) {
+ subjectOk(subject);
+ const plain = String(text == null ? '' : text);
+ if (!plain) return '';
+ const iv = crypto.randomBytes(12);
+ const c = crypto.createCipheriv('aes-256-gcm', keyOf(subject, 'seal'), iv);
+ const body = Buffer.concat([c.update(plain, 'utf8'), c.final()]);
+ return ['v1', iv.toString('base64url'), c.getAuthTag().toString('base64url'), body.toString('base64url')].join('.');
+ }
+ function open(subject, sealed) {
+ subjectOk(subject);
+ if (!sealed) return '';
+ const [v, iv, tag, body] = String(sealed).split('.');
+ if (v !== 'v1' || !iv || !tag || body == null) throw new Error('not a sealed value');
+ const d = crypto.createDecipheriv('aes-256-gcm', keyOf(subject, 'seal'), Buffer.from(iv, 'base64url'));
+ d.setAuthTag(Buffer.from(tag, 'base64url'));
+ return Buffer.concat([d.update(Buffer.from(body, 'base64url')), d.final()]).toString('utf8');
+ }
+ function mark(subject, text) {
+ subjectOk(subject);
+ return crypto.createHmac('sha256', keyOf(subject, 'mark')).update(String(text)).digest('base64url');
+ }
+ return { seal, open, mark };
+}
+
+module.exports = { createVault };
new file mode 100644
new file mode 100644
@@ -0,0 +1,151 @@
@@ -0,0 +1,151 @@
+'use strict';
+/**
+ * A bank's CSV export → transactions (plan §L.2: "manual entry, CSV … always free").
+ *
+ * readCsv(text) → { rows: [{ posted_on, amount_cents, payee, memo, category }], columns, skipped: [{ line, why }] }
+ *
+ * What banks send differs, so this reads the file rather than a fixed layout:
+ * - the delimiter: comma, semicolon or tab, whichever splits the header into the most columns;
+ * - quoted fields with commas, doubled quotes and line breaks inside;
+ * - the columns by their header: a date, then either one signed amount or a debit and a credit, a payee or
+ * description, a memo, a category;
+ * - dates as 2026-11-18, 11/18/2026, 18/11/2026 (day first when a day over 12 says so, or when the file is
+ * day-first throughout), 18.11.2026, 2026/11/18, and "Nov 18, 2026";
+ * - amounts as -12.34, (12.34), $1,234.56, 1.234,56 (comma decimals), 12.34 CR / DR.
+ * A row that cannot be read is skipped and said, never guessed.
+ */
+
+const MAX_ROWS = 20000;
+
+function splitRows(text, delim) {
+ const rows = [];
+ let row = [], cell = '', quoted = false;
+ for (let i = 0; i < text.length; i++) {
+ const c = text[i];
+ if (quoted) {
+ if (c === '"') { if (text[i + 1] === '"') { cell += '"'; i++; } else quoted = false; }
+ else cell += c;
+ } else if (c === '"' && cell === '') quoted = true;
+ else if (c === delim) { row.push(cell); cell = ''; }
+ else if (c === '\n' || c === '\r') {
+ if (c === '\r' && text[i + 1] === '\n') i++;
+ row.push(cell); cell = '';
+ if (row.length > 1 || row[0].trim() !== '') rows.push(row);
+ row = [];
+ if (rows.length > MAX_ROWS + 1) break;
+ } else cell += c;
+ }
+ if (cell !== '' || row.length) { row.push(cell); if (row.length > 1 || row[0].trim() !== '') rows.push(row); }
+ return rows;
+}
+
+const norm = (h) => String(h || '').toLowerCase().replace(/[^a-z]/g, '');
+const HEADERS = {
+ date: ['date', 'transactiondate', 'posteddate', 'postingdate', 'bookingdate', 'valuedate', 'transdate', 'datum'],
+ amount: ['amount', 'transactionamount', 'amountusd', 'value', 'betrag', 'montant', 'sum'],
+ debit: ['debit', 'debitamount', 'withdrawal', 'withdrawals', 'moneyout', 'paidout', 'outflow', 'charge'],
+ credit: ['credit', 'creditamount', 'deposit', 'deposits', 'moneyin', 'paidin', 'inflow', 'payment'],
+ payee: ['payee', 'description', 'name', 'merchant', 'merchantname', 'details', 'transactiondescription', 'narrative', 'counterparty', 'originaldescription'],
+ memo: ['memo', 'notes', 'note', 'reference', 'comment', 'extendeddescription'],
+ category: ['category', 'categoryname'],
+};
+
+function columnsOf(header) {
+ const n = header.map(norm);
+ const pick = (names) => { for (const name of names) { const i = n.indexOf(name); if (i >= 0) return i; } return -1; };
+ const cols = {};
+ for (const [k, names] of Object.entries(HEADERS)) cols[k] = pick(names);
+ // "Description" as the payee when there is no payee column; otherwise the description is the memo.
+ if (cols.payee >= 0 && cols.memo < 0) {
+ const desc = n.indexOf('description');
+ if (desc >= 0 && desc !== cols.payee) cols.memo = desc;
+ }
+ return cols;
+}
+
+const MONTHS = { jan: 1, feb: 2, mar: 3, apr: 4, may: 5, jun: 6, jul: 7, aug: 8, sep: 9, sept: 9, oct: 10, nov: 11, dec: 12 };
+const pad = (n) => String(n).padStart(2, '0');
+const valid = (y, m, d) => {
+ if (!(y >= 1900 && y <= 2200 && m >= 1 && m <= 12 && d >= 1 && d <= 31)) return null;
+ const t = new Date(Date.UTC(y, m - 1, d));
+ return t.getUTCMonth() === m - 1 ? `${y}-${pad(m)}-${pad(d)}` : null;
+};
+/** One date → 'YYYY-MM-DD' or null. `dayFirst`: read 01/02/2026 as the 1st of February. */
+function readDate(s, dayFirst = false) {
+ const t = String(s || '').trim();
+ let m = /^(\d{4})[-/.](\d{1,2})[-/.](\d{1,2})/.exec(t);
+ if (m) return valid(+m[1], +m[2], +m[3]);
+ m = /^(\d{1,2})[/.-](\d{1,2})[/.-](\d{2,4})$/.exec(t);
+ if (m) {
+ let y = +m[3]; if (y < 100) y += 2000;
+ const a = +m[1], b = +m[2];
+ const sep = t.includes('.') ? '.' : null;
+ const df = dayFirst || sep === '.' || a > 12;
+ return df ? valid(y, b, a) : valid(y, a, b);
+ }
+ m = /^([A-Za-z]{3,4})[a-z]*\.? (\d{1,2}),? (\d{4})$/.exec(t);
+ if (m && MONTHS[m[1].toLowerCase()]) return valid(+m[3], MONTHS[m[1].toLowerCase()], +m[2]);
+ m = /^(\d{1,2}) ([A-Za-z]{3,4})[a-z]*\.? (\d{4})$/.exec(t);
+ if (m && MONTHS[m[2].toLowerCase()]) return valid(+m[3], MONTHS[m[2].toLowerCase()], +m[1]);
+ return null;
+}
+
+/** One amount → integer cents (signed) or null. */
+function readAmount(s) {
+ let t = String(s == null ? '' : s).trim();
+ if (!t) return null;
+ let sign = 1;
+ if (/^\(.*\)$/.test(t)) { sign = -1; t = t.slice(1, -1); }
+ if (/\bDR$/i.test(t)) { sign = -1; t = t.replace(/\s*DR$/i, ''); }
+ t = t.replace(/\s*CR$/i, '');
+ t = t.replace(/[^\d.,\-+]/g, '');
+ if (t.startsWith('-')) { sign = -sign; t = t.slice(1); } else if (t.startsWith('+')) t = t.slice(1);
+ if (t.endsWith('-')) { sign = -sign; t = t.slice(0, -1); }
+ if (!/\d/.test(t)) return null;
+ // 1.234,56 or 12,34: a comma decimal when the last separator is a comma followed by 1-2 digits.
+ const lastComma = t.lastIndexOf(','), lastDot = t.lastIndexOf('.');
+ if (lastComma > lastDot && /,\d{1,2}$/.test(t)) t = t.replace(/\./g, '').replace(',', '.');
+ else t = t.replace(/,/g, '');
+ if (!/^\d+(\.\d+)?$/.test(t)) return null;
+ const [whole, frac = ''] = t.split('.');
+ const cents = Number(whole) * 100 + Number((frac + '00').slice(0, 2)) + (Number(frac[2] || 0) >= 5 ? 1 : 0);
+ return Number.isSafeInteger(cents) ? sign * cents : null;
+}
+
+function readCsv(text) {
+ const src = String(text || '').replace(/^/, '');
+ const firstLine = src.split(/\r?\n/, 1)[0] || '';
+ const delim = [',', ';', '\t'].map((d) => [d, firstLine.split(d).length]).sort((a, b) => b[1] - a[1])[0][0];
+ const all = splitRows(src, delim);
+ if (all.length < 2) return { rows: [], columns: null, skipped: [], problem: 'The file has no rows under its header.' };
+ const header = all[0];
+ const cols = columnsOf(header);
+ if (cols.date < 0) return { rows: [], columns: cols, skipped: [], problem: 'No date column: the header needs a column named Date (or Posted Date, Transaction Date).' };
+ if (cols.amount < 0 && cols.debit < 0 && cols.credit < 0) return { rows: [], columns: cols, skipped: [], problem: 'No amount column: the header needs Amount, or Debit and Credit.' };
+ const body = all.slice(1, MAX_ROWS + 1);
+ // Day first when any date's first number is over 12 (and none's second is): the file is one layout throughout.
+ let dayFirst = false;
+ for (const r of body) {
+ const m = /^(\d{1,2})[/-](\d{1,2})[/-]\d{2,4}$/.exec(String(r[cols.date] || '').trim());
+ if (m && +m[1] > 12) { dayFirst = true; break; }
+ }
+ const rows = [], skipped = [];
+ body.forEach((r, i) => {
+ const line = i + 2;
+ const posted_on = readDate(r[cols.date], dayFirst);
+ if (!posted_on) { skipped.push({ line, why: `the date "${String(r[cols.date] || '').slice(0, 30)}" is not one this reads` }); return; }
+ let amount = null;
+ if (cols.amount >= 0) amount = readAmount(r[cols.amount]);
+ if (amount == null && (cols.debit >= 0 || cols.credit >= 0)) {
+ const out = cols.debit >= 0 ? readAmount(r[cols.debit]) : null;
+ const inn = cols.credit >= 0 ? readAmount(r[cols.credit]) : null;
+ if (out != null || inn != null) amount = (inn != null ? Math.abs(inn) : 0) - (out != null ? Math.abs(out) : 0);
+ }
+ if (amount == null) { skipped.push({ line, why: 'no amount' }); return; }
+ const text = (k) => (cols[k] >= 0 ? String(r[cols[k]] || '').replace(/\s+/g, ' ').trim().slice(0, 300) : '');
+ rows.push({ posted_on, amount_cents: amount, payee: text('payee'), memo: text('memo'), category: text('category').slice(0, 60) });
+ });
+ return { rows, columns: cols, skipped, problem: rows.length ? null : 'No row could be read.' };
+}
+
+module.exports = { readCsv, readDate, readAmount, splitRows, columnsOf };
new file mode 100644
new file mode 100644
@@ -0,0 +1,30 @@
@@ -0,0 +1,30 @@
+'use strict';
+/**
+ * OpenVibe.Finance's process: the database (DATABASE_URL through PgBouncer; migrations on DATABASE_DIRECT_URL), the
+ * vault (FINANCE_DATA_KEY), sign-in through OpenVibe.Network (OV_OAUTH_CLIENT_ID / OV_OAUTH_CLIENT_SECRET), and the
+ * app on 127.0.0.1:PORT (5292). SIGTERM closes the server and the pool.
+ */
+const path = require('node:path');
+const { createDb } = require('openvibe-sdk/db');
+const { createSsoClient } = require('openvibe-sdk/sso');
+const { createVault } = require('./crypto');
+const { createApp } = require('./app');
+
+async function main() {
+ const env = process.env;
+ const port = Number(env.PORT || 5292);
+ const baseUrl = env.BASE_URL || 'https://openvibe.finance';
+ const db = createDb({ service: 'finance' });
+ await db.migrate({ dir: path.join(__dirname, '..', 'migrations') });
+ const vault = createVault(env.FINANCE_DATA_KEY);
+ const auth = env.OV_OAUTH_CLIENT_ID && env.OV_OAUTH_CLIENT_SECRET ? createSsoClient({
+ site: 'finance', siteName: 'OpenVibe.Finance', baseUrl, clientId: env.OV_OAUTH_CLIENT_ID, clientSecret: env.OV_OAUTH_CLIENT_SECRET,
+ networkUrl: env.OV_NETWORK_URL || 'https://openvibe.network', networkInternalUrl: env.OV_NETWORK_INTERNAL_URL || 'http://127.0.0.1:4000',
+ secureCookies: env.NODE_ENV === 'production',
+ }) : null;
+ if (!auth) console.warn('[finance] no OAuth client: sign-in is off');
+ const server = createApp({ db, vault, auth, baseUrl }).listen(port, '127.0.0.1', () => console.log(`[finance] listening on 127.0.0.1:${port}`));
+ process.on('SIGTERM', () => server.close(async () => { try { await db.close(); } finally { process.exit(0); } }));
+}
+
+main().catch((err) => { console.error('[finance] could not start:', err && err.message); process.exit(1); });
new file mode 100644
new file mode 100644
@@ -0,0 +1,197 @@
@@ -0,0 +1,197 @@
+'use strict';
+/**
+ * A person's accounts and transactions (migrations/0001_finance.sql). Every function takes the person (owner, a usr_
+ * subject) and reads or writes only their rows; payees and memos are sealed with their key (server/crypto.js) on the
+ * way in and opened on the way out.
+ *
+ * const store = createStore({ db, vault });
+ * accounts(owner) → [{ id, name, kind, currency, balance_cents, count, last_on }]
+ * account(owner, id) → one, or null
+ * addAccount(owner, { name, kind, currency, opening_cents })
+ * transactions(owner, accountId, { month }) → [{ id, posted_on, amount_cents, payee, memo, category, category_from }]
+ * addTransaction(owner, accountId, { posted_on, amount_cents, payee, memo, category })
+ * setCategory(owner, id, category) a correction: a new revision, category_from 'you'
+ * removeTransaction(owner, id)
+ * importRows(owner, accountId, rows) → { import_id, read, added, skipped } (the same row twice is one)
+ * month(owner, 'YYYY-MM') → { month, income_cents, spent_cents, by_category: [{ category, cents, count }] }
+ * exportAll(owner) → everything, opened (the person's own copy)
+ * removeAll(owner) → everything of theirs deleted
+ */
+const crypto = require('node:crypto');
+
+const KINDS = ['checking', 'savings', 'credit', 'cash', 'loan', 'investment', 'other'];
+const CATEGORIES = ['Income', 'Housing', 'Utilities', 'Groceries', 'Eating out', 'Transport', 'Health', 'Insurance', 'Shopping',
+ 'Subscriptions', 'Entertainment', 'Travel', 'Education', 'Gifts and giving', 'Fees', 'Transfers', 'Savings', 'Debt payments', 'Taxes', 'Other', 'Uncategorized'];
+const newId = (prefix) => `${prefix}_${crypto.randomBytes(12).toString('base64url')}`;
+const MONTH = /^\d{4}-(0[1-9]|1[0-2])$/;
+const DAY = /^\d{4}-\d{2}-\d{2}$/;
+
+class FinanceError extends Error {
+ constructor(status, code, message) { super(message); this.status = status; this.code = code; }
+}
+const fail = (status, code, message) => { throw new FinanceError(status, code, message); };
+
+function cleanCategory(c) {
+ const t = String(c || '').replace(/\s+/g, ' ').trim().slice(0, 60);
+ return t || 'Uncategorized';
+}
+
+function createStore({ db, vault }) {
+ const own = (owner) => { if (!/^usr_[0-9A-Za-z]{10,40}$/.test(String(owner || ''))) fail(401, 'finance.person', 'Sign in first.'); return owner; };
+ const open = (owner, row) => ({
+ id: row.id, account_id: row.account_id, posted_on: row.posted_on, amount_cents: Number(row.amount_cents),
+ payee: vault.open(owner, row.payee_enc), memo: vault.open(owner, row.memo_enc),
+ category: row.category, category_from: row.category_from, revision: row.revision,
+ });
+
+ async function accounts(owner) {
+ own(owner);
+ const rows = await db.many(`SELECT a.id, a.name, a.kind, a.currency, a.opening_cents,
+ COALESCE(SUM(t.amount_cents), 0)::bigint AS moved, COUNT(t.id)::int AS count, MAX(t.posted_on) AS last_on
+ FROM finance_accounts a LEFT JOIN finance_transactions t ON t.account_id = a.id
+ WHERE a.owner = $1 AND a.archived_at IS NULL GROUP BY a.id ORDER BY a.created_at, a.id`, [owner]);
+ return rows.map((r) => ({ id: r.id, name: r.name, kind: r.kind, currency: r.currency, balance_cents: Number(r.opening_cents) + Number(r.moved), count: r.count, last_on: r.last_on || null }));
+ }
+
+ async function account(owner, id) {
+ own(owner);
+ const r = await db.maybe('SELECT id, name, kind, currency, opening_cents FROM finance_accounts WHERE id = $1 AND owner = $2 AND archived_at IS NULL', [String(id || ''), owner]);
+ return r ? { ...r, opening_cents: Number(r.opening_cents) } : null;
+ }
+
+ async function addAccount(owner, input = {}) {
+ own(owner);
+ const name = String(input.name || '').replace(/\s+/g, ' ').trim().slice(0, 80);
+ if (!name) fail(422, 'finance.account.name', 'Give the account a name.');
+ const kind = KINDS.includes(input.kind) ? input.kind : 'checking';
+ const currency = /^[A-Z]{3}$/.test(String(input.currency || '').toUpperCase()) ? String(input.currency).toUpperCase() : 'USD';
+ const opening = Number.isSafeInteger(input.opening_cents) ? input.opening_cents : 0;
+ const count = Number(await db.value('SELECT count(*) FROM finance_accounts WHERE owner = $1 AND archived_at IS NULL', [owner]));
+ if (count >= 100) fail(422, 'finance.account.limit', 'A hundred accounts is the most for now.');
+ const id = newId('acc');
+ await db.exec('INSERT INTO finance_accounts (id, owner, name, kind, currency, opening_cents) VALUES ($1, $2, $3, $4, $5, $6)', [id, owner, name, kind, currency, opening]);
+ return account(owner, id);
+ }
+
+ async function transactions(owner, accountId, { month = null, limit = 500 } = {}) {
+ own(owner);
+ const args = [owner, String(accountId || '')];
+ let where = 'owner = $1 AND account_id = $2';
+ if (month) {
+ if (!MONTH.test(month)) fail(422, 'finance.month', 'A month is YYYY-MM.');
+ args.push(`${month}-01`);
+ where += ` AND posted_on >= $3::date AND posted_on < ($3::date + interval '1 month')`;
+ }
+ const rows = await db.many(`SELECT * FROM finance_transactions WHERE ${where} ORDER BY posted_on DESC, created_at DESC, id LIMIT ${Math.max(1, Math.min(2000, Number(limit) || 500))}`, args);
+ return rows.map((r) => open(owner, r));
+ }
+
+ function checkRow(input) {
+ const posted_on = String(input.posted_on || '');
+ if (!DAY.test(posted_on) || Number.isNaN(Date.parse(`${posted_on}T00:00:00Z`))) fail(422, 'finance.transaction.date', 'A date is YYYY-MM-DD.');
+ if (!Number.isSafeInteger(input.amount_cents) || Math.abs(input.amount_cents) > 1e13) fail(422, 'finance.transaction.amount', 'An amount is a number of cents.');
+ return {
+ posted_on, amount_cents: input.amount_cents,
+ payee: String(input.payee || '').replace(/\s+/g, ' ').trim().slice(0, 300),
+ memo: String(input.memo || '').replace(/\s+/g, ' ').trim().slice(0, 500),
+ category: cleanCategory(input.category),
+ };
+ }
+
+ async function addTransaction(owner, accountId, input = {}) {
+ own(owner);
+ const acc = await account(owner, accountId);
+ if (!acc) fail(404, 'finance.account.not_found', 'No such account of yours.');
+ const r = checkRow(input);
+ const id = newId('txn');
+ await db.exec(`INSERT INTO finance_transactions (id, owner, account_id, posted_on, amount_cents, payee_enc, memo_enc, category, category_from)
+ VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9)`,
+ [id, owner, acc.id, r.posted_on, r.amount_cents, vault.seal(owner, r.payee), vault.seal(owner, r.memo), r.category, r.category === 'Uncategorized' ? 'none' : 'you']);
+ return open(owner, await db.one('SELECT * FROM finance_transactions WHERE id = $1', [id]));
+ }
+
+ async function setCategory(owner, id, category) {
+ own(owner);
+ const c = cleanCategory(category);
+ const n = await db.exec(`UPDATE finance_transactions SET category = $3, category_from = 'you', revision = revision + 1, updated_at = now()
+ WHERE id = $1 AND owner = $2`, [String(id || ''), owner, c]);
+ if (!n) fail(404, 'finance.transaction.not_found', 'No such transaction of yours.');
+ return open(owner, await db.one('SELECT * FROM finance_transactions WHERE id = $1', [String(id)]));
+ }
+
+ async function removeTransaction(owner, id) {
+ own(owner);
+ await db.exec('DELETE FROM finance_transactions WHERE id = $1 AND owner = $2', [String(id || ''), owner]);
+ }
+
+ async function importRows(owner, accountId, rows) {
+ own(owner);
+ const acc = await account(owner, accountId);
+ if (!acc) fail(404, 'finance.account.not_found', 'No such account of yours.');
+ const list = Array.isArray(rows) ? rows.slice(0, 20000) : [];
+ const importId = newId('imp');
+ let added = 0;
+ await db.tx(async (t) => {
+ await t.exec('INSERT INTO finance_imports (id, owner, account_id, format, rows_read) VALUES ($1, $2, $3, $4, $5)', [importId, owner, acc.id, 'csv', list.length]);
+ // The same row twice in one file is two transactions (two coffees on one day); the same file twice is not.
+ const seen = new Map();
+ for (const input of list) {
+ const r = checkRow(input);
+ const key = `${acc.id}|${r.posted_on}|${r.amount_cents}|${r.payee.toLowerCase()}`;
+ const nth = (seen.get(key) || 0) + 1;
+ seen.set(key, nth);
+ const out = await t.exec(`INSERT INTO finance_transactions (id, owner, account_id, posted_on, amount_cents, payee_enc, memo_enc, category, category_from, import_id, dedupe)
+ VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) ON CONFLICT (account_id, dedupe) WHERE dedupe IS NOT NULL DO NOTHING`,
+ [newId('txn'), owner, acc.id, r.posted_on, r.amount_cents, vault.seal(owner, r.payee), vault.seal(owner, r.memo), r.category,
+ r.category === 'Uncategorized' ? 'none' : 'file', importId, vault.mark(owner, `${key}|${nth}`)]);
+ if (out) added++;
+ }
+ await t.exec('UPDATE finance_imports SET rows_added = $2, rows_skipped = $3 WHERE id = $1', [importId, added, list.length - added]);
+ });
+ return { import_id: importId, read: list.length, added, skipped: list.length - added };
+ }
+
+ async function month(owner, m) {
+ own(owner);
+ if (!MONTH.test(String(m || ''))) fail(422, 'finance.month', 'A month is YYYY-MM.');
+ // In and out by each transaction's sign, never a category's net: a paycheck and a coffee in one category are $2,500
+ // in and $4.50 out, not $2,495.50 in.
+ const rows = await db.many(`SELECT t.category,
+ SUM(CASE WHEN t.amount_cents > 0 THEN t.amount_cents ELSE 0 END)::bigint AS in_cents,
+ SUM(CASE WHEN t.amount_cents < 0 THEN -t.amount_cents ELSE 0 END)::bigint AS out_cents, COUNT(*)::int AS count
+ FROM finance_transactions t JOIN finance_accounts a ON a.id = t.account_id AND a.archived_at IS NULL
+ WHERE t.owner = $1 AND t.posted_on >= $2::date AND t.posted_on < ($2::date + interval '1 month') AND t.category <> 'Transfers'
+ GROUP BY t.category ORDER BY 3 DESC, 2 DESC`, [owner, `${m}-01`]);
+ let income = 0, spent = 0;
+ const by = rows.map((r) => {
+ const i = Number(r.in_cents), o = Number(r.out_cents);
+ income += i; spent += o;
+ return { category: r.category, in_cents: i, out_cents: o, cents: i - o, count: r.count };
+ });
+ return { month: m, income_cents: income, spent_cents: spent, by_category: by };
+ }
+
+ async function exportAll(owner) {
+ own(owner);
+ const accs = await db.many('SELECT id, name, kind, currency, opening_cents, created_at, archived_at FROM finance_accounts WHERE owner = $1 ORDER BY created_at', [owner]);
+ const txns = await db.many('SELECT * FROM finance_transactions WHERE owner = $1 ORDER BY posted_on, created_at', [owner]);
+ return {
+ exported_at: new Date().toISOString(), format: 'openvibe.finance.export@1',
+ accounts: accs.map((a) => ({ ...a, opening_cents: Number(a.opening_cents) })),
+ transactions: txns.map((r) => open(owner, r)),
+ };
+ }
+
+ async function removeAll(owner) {
+ own(owner);
+ await db.tx(async (t) => {
+ await t.exec('DELETE FROM finance_transactions WHERE owner = $1', [owner]);
+ await t.exec('DELETE FROM finance_imports WHERE owner = $1', [owner]);
+ await t.exec('DELETE FROM finance_accounts WHERE owner = $1', [owner]);
+ });
+ }
+
+ return { accounts, account, addAccount, transactions, addTransaction, setCategory, removeTransaction, importRows, month, exportAll, removeAll };
+}
+
+module.exports = { createStore, FinanceError, KINDS, CATEGORIES };
new file mode 100644
new file mode 100644
@@ -0,0 +1,140 @@
@@ -0,0 +1,140 @@
+'use strict';
+/**
+ * Finance's pages, server-rendered in the network's shell (openvibe-shared/shell, kit.css) with this site's own
+ * finance.css. Every value that reaches markup goes through esc(). Forms post to the same origin and work without
+ * script; public/finance.js only reads a chosen CSV file into the paste box.
+ */
+const shell = require('openvibe-shared/shell');
+const serve = require('openvibe-shared/serve');
+const { CATEGORIES, KINDS } = require('./store');
+
+const SITE = 'https://openvibe.finance';
+const esc = (v) => String(v == null ? '' : v).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]));
+const money = (cents, currency = 'USD') => {
+ try { return new Intl.NumberFormat('en-US', { style: 'currency', currency }).format(cents / 100); }
+ catch { return `${(cents / 100).toFixed(2)} ${currency}`; }
+};
+const monthName = (m) => new Date(`${m}-01T00:00:00Z`).toLocaleDateString('en-US', { month: 'long', year: 'numeric', timeZone: 'UTC' });
+const shiftMonth = (m, by) => { const d = new Date(`${m}-01T00:00:00Z`); d.setUTCMonth(d.getUTCMonth() + by); return d.toISOString().slice(0, 7); };
+const KIND_WORDS = { checking: 'Checking', savings: 'Savings', credit: 'Credit card', cash: 'Cash', loan: 'Loan', investment: 'Investments', other: 'Other' };
+
+function page({ title, body, path = '/', description = 'Your money, your rules, your data: accounts, imports and a monthly picture, private to you.', robots = 'noindex, nofollow' }) {
+ return shell.page({
+ name: 'OpenVibe.Finance', siteName: 'OpenVibe.Finance', title, description, canonical: `${SITE}${path}`, robots,
+ navbar: { service: 'finance', apiBase: 'https://openvibe.network', links: [{ label: 'Money', href: '/' }, { label: 'This month', href: '/month' }] },
+ footer: { service: 'finance', variant: 'full', mount: '#ov-footer' },
+ head: `<link rel="stylesheet" href="${serve.url('kit.css')}"><link rel="stylesheet" href="/finance.css"><script src="/finance.js" defer></script>`,
+ body: `<div id="navbar-mount"></div><main id="main" class="ovk-page fin">${body}</main>`,
+ });
+}
+
+const notice = (o) => (o.error ? `<p class="fin-error" role="alert">${esc(o.error)}</p>` : '') + (o.said ? `<p class="fin-said" role="status">${esc(o.said)}</p>` : '');
+
+function welcome() {
+ return page({
+ title: 'Your money, your rules, your data', robots: 'index, follow', body: `
+<section class="fin-hero">
+<h1>Your money, your rules, your data</h1>
+<p class="fin-lede">Your accounts in one place, from a bank's CSV export or typed in, and a clear picture of each month. Free, with nothing to connect.</p>
+<p><a class="fin-btn fin-btn--primary" href="/auth/login?next=%2F">Sign in to start</a></p>
+</section>
+<ul class="fin-promises">
+<li><b>Private to you.</b> Payees and notes are stored encrypted under a key for your account alone. Nothing here enters search, analytics or AI training.</li>
+<li><b>No money moves.</b> It reads and plans. It never pays, transfers or cancels anything.</li>
+<li><b>Yours to take.</b> Download everything as one file, or delete everything, any time.</li>
+</ul>` });
+}
+
+function home({ accounts, month, o = {} }) {
+ const total = {};
+ for (const a of accounts) total[a.currency] = (total[a.currency] || 0) + a.balance_cents;
+ const totals = Object.entries(total).map(([c, v]) => money(v, c)).join(' · ');
+ const kindChips = KINDS.map((k, i) => `<label class="fin-chip"><input type="radio" name="kind" value="${k}"${i === 0 ? ' checked' : ''}><span>${esc(KIND_WORDS[k])}</span></label>`).join('');
+ return page({
+ title: 'Your money', body: `
+<header class="fin-head"><h1>Your money</h1>${accounts.length ? `<p class="fin-total">${esc(totals)}</p>` : ''}</header>
+${notice(o)}
+${accounts.length ? `<section class="fin-month-card" aria-label="${esc(monthName(month.month))}">
+<a class="fin-month-link" href="/month?m=${month.month}"><span>${esc(monthName(month.month))}</span>
+<span class="fin-in">In ${esc(money(month.income_cents))}</span><span class="fin-out">Out ${esc(money(month.spent_cents))}</span></a></section>
+<ul class="fin-accounts">${accounts.map((a) => `<li><a class="fin-account" href="/accounts/${esc(a.id)}">
+<span class="fin-account-name">${esc(a.name)}<small>${esc(KIND_WORDS[a.kind] || a.kind)} · ${a.count} transaction${a.count === 1 ? '' : 's'}</small></span>
+<span class="fin-account-balance${a.balance_cents < 0 ? ' is-neg' : ''}">${esc(money(a.balance_cents, a.currency))}</span></a></li>`).join('')}</ul>`
+ : `<p class="fin-empty">Start with an account: name it, then type in transactions or import your bank's CSV export.</p>`}
+<details class="fin-fold"${accounts.length ? '' : ' open'}><summary>Add an account</summary>
+<form class="fin-form" method="post" action="/accounts">
+<label class="fin-field"><span>Name</span><input name="name" maxlength="80" required placeholder="Everyday checking" autocomplete="off"></label>
+<fieldset class="fin-chips"><legend>Kind</legend>${kindChips}</fieldset>
+<div class="fin-row"><label class="fin-field"><span>Currency</span><input name="currency" value="USD" maxlength="3" pattern="[A-Za-z]{3}" autocomplete="off"></label>
+<label class="fin-field"><span>Balance before the first transaction</span><input name="opening" inputmode="decimal" placeholder="0.00" autocomplete="off"></label></div>
+<p><button class="fin-btn fin-btn--primary" type="submit">Add the account</button></p>
+</form></details>
+<p class="fin-foot"><a href="/data">Your data: download or delete everything</a></p>` });
+}
+
+function accountPage({ account, balance, txns, month, o = {} }) {
+ const groups = new Map();
+ for (const t of txns) { const m = t.posted_on.slice(0, 7); if (!groups.has(m)) groups.set(m, []); groups.get(m).push(t); }
+ const cats = `<datalist id="fin-cats">${CATEGORIES.map((c) => `<option value="${esc(c)}">`).join('')}</datalist>`;
+ const row = (t) => `<li class="fin-txn"><span class="fin-txn-date">${esc(t.posted_on.slice(5))}</span>
+<span class="fin-txn-what"><b>${esc(t.payee || 'No payee')}</b>${t.memo ? `<small>${esc(t.memo)}</small>` : ''}
+<form class="fin-cat" method="post" action="/transactions/${esc(t.id)}/category"><input name="category" list="fin-cats" value="${esc(t.category)}" aria-label="Category" maxlength="60"><button type="submit" class="fin-mini">Save</button></form></span>
+<span class="fin-txn-amount${t.amount_cents < 0 ? ' is-neg' : ' is-pos'}">${esc(money(t.amount_cents, account.currency))}</span></li>`;
+ const today = new Date().toISOString().slice(0, 10);
+ return page({
+ title: account.name, path: `/accounts/${account.id}`, body: `
+<header class="fin-head"><p class="fin-crumb"><a href="/">Your money</a></p><h1>${esc(account.name)}</h1>
+<p class="fin-total${balance < 0 ? ' is-neg' : ''}">${esc(money(balance, account.currency))}</p></header>
+${notice(o)}${cats}
+<div class="fin-tools">
+<details class="fin-fold"><summary>Add a transaction</summary>
+<form class="fin-form" method="post" action="/accounts/${esc(account.id)}/transactions">
+<div class="fin-row"><label class="fin-field"><span>Date</span><input type="date" name="posted_on" value="${today}" required></label>
+<label class="fin-field"><span>Amount</span><input name="amount" inputmode="decimal" required placeholder="12.34" autocomplete="off"></label></div>
+<fieldset class="fin-chips"><legend>Money</legend><label class="fin-chip"><input type="radio" name="direction" value="out" checked><span>Out</span></label><label class="fin-chip"><input type="radio" name="direction" value="in"><span>In</span></label></fieldset>
+<label class="fin-field"><span>Payee</span><input name="payee" maxlength="300" autocomplete="off"></label>
+<label class="fin-field"><span>Category</span><input name="category" list="fin-cats" maxlength="60" autocomplete="off" placeholder="Groceries"></label>
+<p><button class="fin-btn fin-btn--primary" type="submit">Add it</button></p>
+</form></details>
+<details class="fin-fold"><summary>Import a bank's CSV export</summary>
+<form class="fin-form" method="post" action="/accounts/${esc(account.id)}/import">
+<p class="fin-note">Most banks export a CSV with a date, an amount (or debit and credit) and a description. Importing the same file twice adds nothing twice.</p>
+<label class="fin-file"><input type="file" accept=".csv,text/csv,text/plain" data-fin-file="csv"><span class="fin-btn">Choose a CSV file</span><span class="fin-file-name" data-fin-file-name>No file chosen yet</span></label>
+<label class="fin-field"><span>Or paste it</span><textarea name="csv" rows="6" required data-fin-csv placeholder="Date,Description,Amount 2026-11-02,Corner Grocer,-23.18"></textarea></label>
+<p><button class="fin-btn fin-btn--primary" type="submit">Import</button></p>
+</form></details>
+</div>
+<nav class="fin-monthnav" aria-label="Month"><a href="/accounts/${esc(account.id)}?m=${shiftMonth(month, -1)}">${esc(monthName(shiftMonth(month, -1)))}</a>
+<b>${esc(monthName(month))}</b><a href="/accounts/${esc(account.id)}?m=${shiftMonth(month, 1)}">${esc(monthName(shiftMonth(month, 1)))}</a></nav>
+${txns.length ? [...groups.values()].map((list) => `<ul class="fin-txns">${list.map(row).join('')}</ul>`).join('') : `<p class="fin-empty">Nothing in ${esc(monthName(month))}. Add a transaction, or import a CSV.</p>`}` });
+}
+
+function monthPage({ m, o = {} }) {
+ const spent = m.by_category.filter((c) => c.out_cents > 0);
+ const most = Math.max(1, ...spent.map((c) => c.out_cents));
+ return page({
+ title: `${monthName(m.month)}`, path: '/month', body: `
+<header class="fin-head"><p class="fin-crumb"><a href="/">Your money</a></p><h1>${esc(monthName(m.month))}</h1></header>
+${notice(o)}
+<nav class="fin-monthnav" aria-label="Month"><a href="/month?m=${shiftMonth(m.month, -1)}">${esc(monthName(shiftMonth(m.month, -1)))}</a><b>${esc(monthName(m.month))}</b><a href="/month?m=${shiftMonth(m.month, 1)}">${esc(monthName(shiftMonth(m.month, 1)))}</a></nav>
+<div class="fin-sums"><p><span>In</span><b class="fin-in">${esc(money(m.income_cents))}</b></p><p><span>Out</span><b class="fin-out">${esc(money(m.spent_cents))}</b></p>
+<p><span>Left</span><b class="${m.income_cents - m.spent_cents < 0 ? 'is-neg' : ''}">${esc(money(m.income_cents - m.spent_cents))}</b></p></div>
+${spent.length ? `<ul class="fin-bars">${spent.map((c) => `<li><span class="fin-bar-name">${esc(c.category)}<small>${c.count}</small></span>
+<span class="fin-bar"><span style="--w:${Math.max(2, Math.round((c.out_cents / most) * 100))}%"></span></span><span class="fin-bar-sum">${esc(money(c.out_cents))}</span></li>`).join('')}</ul>`
+ : '<p class="fin-empty">No spending this month.</p>'}
+<p class="fin-note">Transfers between your own accounts are left out. Amounts in other currencies are added as they are.</p>` });
+}
+
+function dataPage({ o = {} }) {
+ return page({
+ title: 'Your data', path: '/data', body: `
+<header class="fin-head"><p class="fin-crumb"><a href="/">Your money</a></p><h1>Your data</h1></header>
+${notice(o)}
+<section class="fin-sec"><h2>Download everything</h2><p>Every account and transaction, as one JSON file, readable anywhere.</p>
+<p><a class="fin-btn" href="/data/export" download>Download</a></p></section>
+<section class="fin-sec"><h2>Delete everything</h2><p>Every account, transaction and import of yours, for good. There is no undo.</p>
+<form method="post" action="/data/delete" class="fin-form"><label class="fin-check"><input type="checkbox" name="sure" value="yes" required><span>Yes, delete all my finance data</span></label>
+<p><button class="fin-btn fin-btn--danger" type="submit">Delete everything</button></p></form></section>` });
+}
+
+module.exports = { page, welcome, home, accountPage, monthPage, dataPage, money, esc, monthName };
new file mode 100644
new file mode 100644
@@ -0,0 +1,149 @@
@@ -0,0 +1,149 @@
+'use strict';
+/**
+ * Finance end to end on a migrated PostgreSQL (PGlite, or the containers with FINANCE_TEST_STORE=pg): two people,
+ * accounts, typed and imported transactions, the same file twice, categories, the month, the API, export, deletion,
+ * and nobody reading another's rows. A stand-in signs people in with an x-test-user header.
+ */
+const assert = require('assert');
+const path = require('node:path');
+const crypto = require('node:crypto');
+const { createTestDb } = require('openvibe-sdk/testing');
+const { createVault } = require('../server/crypto');
+const { createApp } = require('../server/app');
+
+const ADA = 'usr_01JCZ3NDEKTSV4RRFFQ69G5FAW';
+const BO = 'usr_01JCZ3NDEKTSV4RRFFQ69G5FAX';
+const SAME = { 'sec-fetch-site': 'same-origin' };
+
+(async () => {
+ const { db, close } = await createTestDb({ migrations: path.join(__dirname, '..', 'migrations'), store: process.env.FINANCE_TEST_STORE || 'pglite', service: 'finance' });
+ const auth = {
+ router: (express) => express.Router(),
+ optionalAuth: () => (req, _res, next) => { const u = req.get('x-test-user'); if (u) req.user = { subject_id: u }; next(); },
+ };
+ const app = createApp({ db, vault: createVault(crypto.randomBytes(32).toString('base64')), auth, now: () => new Date('2026-11-18T12:00:00Z') });
+ const server = app.listen(0, '127.0.0.1');
+ await new Promise((r) => server.once('listening', r));
+ const base = `http://127.0.0.1:${server.address().port}`;
+ const go = async (p, { as = null, method = 'GET', form = null, json = null, text = null, headers = {} } = {}) => {
+ const h = { ...headers };
+ if (as) h['x-test-user'] = as;
+ let body;
+ if (form) { h['content-type'] = 'application/x-www-form-urlencoded'; body = new URLSearchParams(form).toString(); }
+ if (json) { h['content-type'] = 'application/json'; body = JSON.stringify(json); }
+ if (text != null) { h['content-type'] = 'text/csv'; body = text; }
+ const r = await fetch(base + p, { method, headers: h, body, redirect: 'manual' });
+ const t = await r.text();
+ return { status: r.status, location: r.headers.get('location'), text: t, json: () => JSON.parse(t), headers: r.headers };
+ };
+ let failed = 0;
+ const check = async (name, fn) => { try { await fn(); console.log(` ✓ ${name}`); } catch (e) { failed++; console.log(` ✗ ${name}\n ${e.stack}`); } };
+
+ try {
+ let acc;
+ await check('signed out: what it is and its promises, never anyone\'s data; a page that needs you signs you in', async () => {
+ const home = await go('/');
+ assert.strictEqual(home.status, 200);
+ assert.match(home.text, /Your money, your rules, your data/);
+ assert.match(home.text, /No money moves/);
+ assert.strictEqual(home.headers.get('cache-control'), 'private, no-store');
+ const month = await go('/month');
+ assert.strictEqual(month.status, 303);
+ assert.match(month.location, /^\/auth\/login\?next=/);
+ assert.strictEqual((await go('/api/v1/accounts')).status, 401);
+ });
+
+ await check('an account from the home page; its page shows the balance', async () => {
+ const r = await go('/accounts', { as: ADA, method: 'POST', headers: SAME, form: { name: 'Everyday checking', kind: 'checking', currency: 'usd', opening: '1,000.00' } });
+ assert.strictEqual(r.status, 303, r.text);
+ acc = /^\/accounts\/(acc_[A-Za-z0-9_-]+)\?added=1$/.exec(r.location)[1];
+ const page = await go(`/accounts/${acc}`, { as: ADA });
+ assert.strictEqual(page.status, 200);
+ assert.match(page.text, /Everyday checking/);
+ assert.match(page.text, /\$1,000\.00/);
+ });
+
+ await check('a typed transaction: money out by default, its payee sealed in the database', async () => {
+ const r = await go(`/accounts/${acc}/transactions`, { as: ADA, method: 'POST', headers: SAME, form: { posted_on: '2026-11-03', amount: '42.50', direction: 'out', payee: 'Corner Grocer', category: 'Groceries' } });
+ assert.strictEqual(r.status, 303, r.text);
+ const row = await db.maybe('SELECT payee_enc, amount_cents, category, category_from FROM finance_transactions WHERE account_id = $1', [acc]);
+ assert.strictEqual(Number(row.amount_cents), -4250);
+ assert.ok(row.payee_enc.startsWith('v1.') && !row.payee_enc.includes('Corner'), 'stored sealed');
+ assert.deepStrictEqual([row.category, row.category_from], ['Groceries', 'you']);
+ const page = await go(`/accounts/${acc}?m=2026-11`, { as: ADA });
+ assert.match(page.text, /Corner Grocer/);
+ assert.match(page.text, /\$957\.50/, 'the balance moved');
+ });
+
+ await check('a CSV import adds the new rows; the same file again adds nothing; two equal rows in one file stay two', async () => {
+ const csv = 'Date,Description,Amount\n2026-11-04,Coffee Bar,-4.50\n2026-11-04,Coffee Bar,-4.50\n2026-11-01,Paycheck,2500.00\n2026-10-28,Electric Co,-80.00\n';
+ let r = await go(`/accounts/${acc}/import`, { as: ADA, method: 'POST', headers: SAME, form: { csv } });
+ assert.strictEqual(r.status, 303, r.text);
+ assert.match(r.location, /imported=4,0$/);
+ r = await go(`/accounts/${acc}/import`, { as: ADA, method: 'POST', headers: SAME, form: { csv } });
+ assert.match(r.location, /imported=0,4$/);
+ const page = await go(r.location, { as: ADA });
+ assert.match(page.text, /Imported 0 new transactions; 4 already here/);
+ assert.strictEqual(Number(await db.value('SELECT count(*) FROM finance_transactions WHERE account_id = $1', [acc])), 5);
+ const bad = await go(`/accounts/${acc}/import`, { as: ADA, method: 'POST', headers: SAME, form: { csv: 'Description,Amount\nx,1\n' } });
+ assert.strictEqual(bad.status, 422);
+ assert.match(bad.text, /No date column/);
+ });
+
+ await check('a category is corrected as a new revision; the month adds up by category, transfers left out', async () => {
+ const txns = (await go(`/api/v1/accounts/${acc}/transactions?m=2026-11`, { as: ADA })).json().transactions;
+ const coffee = txns.find((t) => t.payee === 'Coffee Bar');
+ const r = await go(`/transactions/${coffee.id}/category`, { as: ADA, method: 'POST', headers: SAME, form: { category: 'Eating out' } });
+ assert.strictEqual(r.status, 303);
+ const row = await db.maybe('SELECT category, category_from, revision FROM finance_transactions WHERE id = $1', [coffee.id]);
+ assert.deepStrictEqual([row.category, row.category_from, row.revision], ['Eating out', 'you', 2]);
+ const m = (await go('/api/v1/months/2026-11', { as: ADA })).json();
+ assert.strictEqual(m.income_cents, 250000);
+ assert.strictEqual(m.spent_cents, 4250 + 450 + 450);
+ const page = await go('/month?m=2026-11', { as: ADA });
+ assert.match(page.text, /November 2026/);
+ assert.match(page.text, /Groceries/);
+ });
+
+ await check('nobody reads or writes another person\'s rows', async () => {
+ assert.strictEqual((await go(`/accounts/${acc}`, { as: BO })).status, 404);
+ assert.strictEqual((await go(`/api/v1/accounts/${acc}/transactions`, { as: BO })).status, 404);
+ const sneak = await go(`/accounts/${acc}/transactions`, { as: BO, method: 'POST', headers: SAME, form: { posted_on: '2026-11-05', amount: '1', payee: 'x' } });
+ assert.strictEqual(sneak.status, 404);
+ assert.deepStrictEqual((await go('/api/v1/accounts', { as: BO })).json().accounts, []);
+ assert.strictEqual((await go('/api/v1/months/2026-11', { as: BO })).json().spent_cents, 0);
+ });
+
+ await check('a cross-site form post is refused; the API takes a CSV body and JSON', async () => {
+ const cross = await go('/accounts', { as: ADA, method: 'POST', headers: { 'sec-fetch-site': 'cross-site' }, form: { name: 'x' } });
+ assert.strictEqual(cross.status, 403);
+ const apiCross = await go('/api/v1/accounts', { as: ADA, method: 'POST', headers: { 'sec-fetch-site': 'cross-site' }, json: { name: 'x' } });
+ assert.strictEqual(apiCross.status, 403);
+ const made = await go('/api/v1/accounts', { as: ADA, method: 'POST', headers: SAME, json: { name: 'Card', kind: 'credit' } });
+ assert.strictEqual(made.status, 201, made.text);
+ const imp = await go(`/api/v1/accounts/${made.json().id}/import`, { as: ADA, method: 'POST', headers: SAME, text: 'Date,Payee,Amount\n2026-11-10,Bookshop,-15.00\nsoon,x,1\n' });
+ assert.strictEqual(imp.status, 201, imp.text);
+ assert.strictEqual(imp.json().added, 1);
+ assert.strictEqual(imp.json().unreadable.length, 1);
+ });
+
+ await check('export is everything, readable; delete is everything, after a yes', async () => {
+ const ex = await go('/data/export', { as: ADA });
+ assert.match(ex.headers.get('content-disposition'), /attachment; filename="openvibe-finance-2026-11\.json"/);
+ const data = ex.json();
+ assert.strictEqual(data.accounts.length, 2);
+ assert.ok(data.transactions.some((t) => t.payee === 'Corner Grocer'), 'opened for its owner');
+ const no = await go('/data/delete', { as: ADA, method: 'POST', headers: SAME, form: {} });
+ assert.strictEqual(no.status, 422);
+ const yes = await go('/data/delete', { as: ADA, method: 'POST', headers: SAME, form: { sure: 'yes' } });
+ assert.strictEqual(yes.status, 303);
+ assert.strictEqual(Number(await db.value("SELECT count(*) FROM finance_transactions WHERE owner = $1", [ADA])), 0);
+ assert.strictEqual(Number(await db.value("SELECT count(*) FROM finance_accounts WHERE owner = $1", [ADA])), 0);
+ });
+ } finally {
+ server.close();
+ await close();
+ }
+ if (failed) { console.log(`${failed} failed`); process.exit(1); }
+ console.log('finance: accounts, imports, months, privacy, export and deletion');
+})().catch((err) => { console.error(err); process.exit(1); });
new file mode 100644
new file mode 100644
@@ -0,0 +1,26 @@
@@ -0,0 +1,26 @@
+'use strict';
+// The vault (server/crypto.js): a person's words sealed with their key alone, opened only with it, tamper refused.
+const assert = require('assert');
+const crypto = require('node:crypto');
+const { createVault } = require('../server/crypto');
+
+const ADA = 'usr_01JCZ3NDEKTSV4RRFFQ69G5FAW';
+const BO = 'usr_01JCZ3NDEKTSV4RRFFQ69G5FAX';
+const vault = createVault(crypto.randomBytes(32).toString('base64'));
+
+const sealed = vault.seal(ADA, 'Corner Grocer');
+assert.match(sealed, /^v1\./);
+assert.ok(!sealed.includes('Corner'), 'the words are not readable');
+assert.strictEqual(vault.open(ADA, sealed), 'Corner Grocer');
+assert.notStrictEqual(vault.seal(ADA, 'Corner Grocer'), sealed, 'a fresh IV each time');
+assert.throws(() => vault.open(BO, sealed), 'another person\'s key does not open it');
+const parts = sealed.split('.');
+parts[3] = Buffer.from('tampered').toString('base64url');
+assert.throws(() => vault.open(ADA, parts.join('.')), 'a changed value is refused');
+assert.strictEqual(vault.seal(ADA, ''), '');
+assert.strictEqual(vault.open(ADA, ''), '');
+assert.strictEqual(vault.mark(ADA, 'x'), vault.mark(ADA, 'x'), 'a mark is stable');
+assert.notStrictEqual(vault.mark(ADA, 'x'), vault.mark(BO, 'x'), 'and per person');
+assert.throws(() => vault.seal('nobody', 'x'), /usr_/);
+assert.throws(() => createVault('short'), /32 bytes/);
+console.log('vault: sealed per person, refused for others and when changed');
new file mode 100644
new file mode 100644
@@ -0,0 +1,54 @@
@@ -0,0 +1,54 @@
+'use strict';
+// Reading a bank's CSV export (server/csv.js): the delimiter, quotes, the columns by their header, dates and amounts in
+// the shapes banks send, debit/credit pairs, and rows that cannot be read said, never guessed.
+const assert = require('assert');
+const { readCsv, readDate, readAmount } = require('../server/csv');
+
+assert.strictEqual(readDate('2026-11-18'), '2026-11-18');
+assert.strictEqual(readDate('11/18/2026'), '2026-11-18');
+assert.strictEqual(readDate('18/11/2026'), '2026-11-18', 'a first number over 12 is a day');
+assert.strictEqual(readDate('01/02/2026', true), '2026-02-01', 'a day-first file');
+assert.strictEqual(readDate('18.11.2026'), '2026-11-18');
+assert.strictEqual(readDate('Nov 18, 2026'), '2026-11-18');
+assert.strictEqual(readDate('18 Nov 2026'), '2026-11-18');
+assert.strictEqual(readDate('2026-02-30'), null, 'no 30th of February');
+assert.strictEqual(readDate('soon'), null);
+
+assert.strictEqual(readAmount('-12.34'), -1234);
+assert.strictEqual(readAmount('(12.34)'), -1234);
+assert.strictEqual(readAmount('$1,234.56'), 123456);
+assert.strictEqual(readAmount('1.234,56'), 123456, 'comma decimals');
+assert.strictEqual(readAmount('12,5'), 1250);
+assert.strictEqual(readAmount('12.34 DR'), -1234);
+assert.strictEqual(readAmount('12.34 CR'), 1234);
+assert.strictEqual(readAmount('7'), 700);
+assert.strictEqual(readAmount(''), null);
+assert.strictEqual(readAmount('n/a'), null);
+
+// A typical export: quoted payees with commas, a signed amount.
+let r = readCsv('Date,Description,Amount,Category\n2026-11-02,"Corner Grocer, Main St",-23.18,Groceries\n2026-11-01,Paycheck,2500.00,\n');
+assert.strictEqual(r.problem, null);
+assert.deepStrictEqual(r.rows, [
+ { posted_on: '2026-11-02', amount_cents: -2318, payee: 'Corner Grocer, Main St', memo: '', category: 'Groceries' },
+ { posted_on: '2026-11-01', amount_cents: 250000, payee: 'Paycheck', memo: '', category: '' },
+]);
+
+// Debit and credit columns, semicolons, a day-first file, a byte order mark, a row that cannot be read.
+r = readCsv('Booking Date;Payee;Memo;Debit;Credit\r\n15/10/2026;Rent;October;1200,00;\r\n03/11/2026;Refund;;;"19,99"\r\nlater;Mystery;;5,00;\r\n');
+assert.deepStrictEqual(r.rows.map((x) => [x.posted_on, x.amount_cents, x.payee, x.memo]), [
+ ['2026-10-15', -120000, 'Rent', 'October'],
+ ['2026-11-03', 1999, 'Refund', ''],
+]);
+assert.deepStrictEqual(r.skipped.map((s) => s.line), [4]);
+assert.match(r.skipped[0].why, /date/);
+
+// Tabs, and a description beside a payee is the memo.
+r = readCsv('Posted Date\tPayee\tDescription\tAmount\n2026-11-05\tSTREAMCO\tMonthly plan\t-9.99\n');
+assert.deepStrictEqual(r.rows[0], { posted_on: '2026-11-05', amount_cents: -999, payee: 'STREAMCO', memo: 'Monthly plan', category: '' });
+
+// What a file is missing is said.
+assert.match(readCsv('Description,Amount\nx,1\n').problem, /No date column/);
+assert.match(readCsv('Date,Description\n2026-11-01,x\n').problem, /No amount column/);
+assert.match(readCsv('Date,Amount\n').problem, /no rows/);
+
+console.log('csv: dates, amounts, columns, delimiters and unreadable rows');
new file mode 100644
new file mode 100644
@@ -0,0 +1,43 @@
@@ -0,0 +1,43 @@
+'use strict';
+/**
+ * A local look at Finance's pages (not a test): the real app on PGlite, a stand-in sign-in as one person, and a month
+ * of sample data. node test/harness/serve-sample.js [port] → prints the port, serves until killed.
+ */
+const path = require('node:path');
+const crypto = require('node:crypto');
+const { createTestDb } = require('openvibe-sdk/testing');
+const { createVault } = require('../../server/crypto');
+const { createApp } = require('../../server/app');
+const { createStore } = require('../../server/store');
+const { readCsv } = require('../../server/csv');
+
+const ADA = 'usr_01JCZ3NDEKTSV4RRFFQ69G5FAW';
+(async () => {
+ const { db } = await createTestDb({ migrations: path.join(__dirname, '..', '..', 'migrations') });
+ const vault = createVault(crypto.randomBytes(32).toString('base64'));
+ const store = createStore({ db, vault });
+ const checking = await store.addAccount(ADA, { name: 'Everyday checking', kind: 'checking', opening_cents: 184250 });
+ await store.addAccount(ADA, { name: 'Rainy day', kind: 'savings', opening_cents: 520000 });
+ const card = await store.addAccount(ADA, { name: 'Travel card', kind: 'credit', opening_cents: -32075 });
+ const csv = `Date,Description,Amount,Category
+2026-11-01,Paycheck ACME Corp,3120.00,Income
+2026-11-01,Lakeview Apartments,-1450.00,Housing
+2026-11-02,Corner Grocer,-86.42,Groceries
+2026-11-03,City Power & Light,-71.30,Utilities
+2026-11-04,Bean There Coffee,-4.75,Eating out
+2026-11-05,StreamFlix,-15.99,Subscriptions
+2026-11-06,Metro Transit,-40.00,Transport
+2026-11-08,Corner Grocer,-54.10,Groceries
+2026-11-09,Pharmacy Plus,-23.80,Health
+2026-11-11,Thai Garden,-38.60,Eating out
+2026-11-12,Transfer to savings,-300.00,Transfers
+2026-11-14,Bookshop on Main,-18.99,
+2026-11-15,Paycheck ACME Corp,3120.00,Income
+2026-11-16,Gym Monthly,-29.00,Subscriptions
+`;
+ await store.importRows(ADA, checking.id, readCsv(csv).rows);
+ await store.importRows(ADA, card.id, readCsv('Date,Payee,Amount\n2026-11-07,Airline Tickets,-412.20\n2026-11-10,Hotel Downtown,-268.00\n').rows);
+ const auth = { router: (express) => express.Router(), optionalAuth: () => (req, _res, next) => { if (!req.get('x-guest')) req.user = { subject_id: ADA }; next(); } };
+ const app = createApp({ db, vault, auth, baseUrl: 'http://127.0.0.1', now: () => new Date('2026-11-18T12:00:00Z') });
+ const server = app.listen(Number(process.argv[2] || 0), '127.0.0.1', () => console.log(`port ${server.address().port} account ${checking.id}`));
+})().catch((e) => { console.error(e); process.exit(1); });
new file mode 100644
new file mode 100644
@@ -0,0 +1,5 @@
@@ -0,0 +1,5 @@
+/**
+ * Runs every *.test.js in test/ (openvibe-shared/test-runner), each in its own process with a database of its own.
+ */
+'use strict';
+require('openvibe-shared/test-runner').main({ dir: __dirname, timeoutMs: 60000, pad: 28, ...(process.env.FINANCE_TEST_STORE === 'pg' ? { parallel: 1 } : {}) });