UNPKG

@accounter/server

Version:
748 lines (673 loc) 372 kB
# @accounter/server ## 0.0.12-alpha-20260411164103-0d3f9f4aa1fdef3dd9e48fa9f85b399cc3f6bf3f ### Patch Changes - [#3276](https://github.com/Urigo/accounter-fullstack/pull/3276) [`6edc9b2`](https://github.com/Urigo/accounter-fullstack/commit/6edc9b27187a9b891b58ae08abdbddff9dcb1fde) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`@graphql-yoga/plugin-defer-stream@3.21.0` ↗︎](https://www.npmjs.com/package/@graphql-yoga/plugin-defer-stream/v/3.21.0) (from `3.18.1`, in `dependencies`) - Updated dependency [`graphql-yoga@5.21.0` ↗︎](https://www.npmjs.com/package/graphql-yoga/v/5.21.0) (from `5.18.1`, in `dependencies`) - [#3277](https://github.com/Urigo/accounter-fullstack/pull/3277) [`a584921`](https://github.com/Urigo/accounter-fullstack/commit/a58492135ab1cac146b0a04885bc968b5c5579e8) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`dotenv@17.4.1` ↗︎](https://www.npmjs.com/package/dotenv/v/17.4.1) (from `17.3.1`, in `dependencies`) - [#3281](https://github.com/Urigo/accounter-fullstack/pull/3281) [`917f31e`](https://github.com/Urigo/accounter-fullstack/commit/917f31e956d267704f6d74fb7f3a22d366062135) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`@ai-sdk/anthropic@3.0.66` ↗︎](https://www.npmjs.com/package/@ai-sdk/anthropic/v/3.0.66) (from `3.0.64`, in `dependencies`) - Updated dependency [`ai@6.0.146` ↗︎](https://www.npmjs.com/package/ai/v/6.0.146) (from `6.0.141`, in `dependencies`) - Updated dependency [`playwright@1.59.1` ↗︎](https://www.npmjs.com/package/playwright/v/1.59.1) (from `1.59.0`, in `dependencies`) - [#3297](https://github.com/Urigo/accounter-fullstack/pull/3297) [`82f07c2`](https://github.com/Urigo/accounter-fullstack/commit/82f07c25cd88fbcef8d29ef3d32230cfce168caa) Thanks [@gilgardosh](https://github.com/gilgardosh)! - dependencies updates: - Updated dependency [`@graphql-yoga/plugin-defer-stream@3.21.0` ↗︎](https://www.npmjs.com/package/@graphql-yoga/plugin-defer-stream/v/3.21.0) (from `3.18.1`, in `dependencies`) - Updated dependency [`graphql-yoga@5.21.0` ↗︎](https://www.npmjs.com/package/graphql-yoga/v/5.21.0) (from `5.18.1`, in `dependencies`) - [#3301](https://github.com/Urigo/accounter-fullstack/pull/3301) [`49651b7`](https://github.com/Urigo/accounter-fullstack/commit/49651b79e6b2cd8b1c01d4c10d12f3be43859d99) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`auth0@5.6.0` ↗︎](https://www.npmjs.com/package/auth0/v/5.6.0) (from `5.5.0`, in `dependencies`) - [#3297](https://github.com/Urigo/accounter-fullstack/pull/3297) [`82f07c2`](https://github.com/Urigo/accounter-fullstack/commit/82f07c25cd88fbcef8d29ef3d32230cfce168caa) Thanks [@gilgardosh](https://github.com/gilgardosh)! - - **Developer Authentication Bypass**: Introduced a new development-only authentication mechanism that allows bypassing Auth0. This enables developers to impersonate seeded demo users by setting specific environment variables and passing an `X-Dev-Auth` header. - **Client-Side Integration**: Modified the client application to conditionally use the new dev authentication flow, affecting how authentication tokens are provided to URQL and how user context and protected routes are handled. New environment variables (`VITE_DEV_AUTH`, `VITE_DEV_AUTH_USER_ID`) were added for client-side configuration. - **Server-Side Authentication Plugin**: Updated the server's authentication plugin to detect and prioritize the `X-Dev-Auth` header when the `ALLOW_DEV_AUTH` environment variable is enabled. A new `handleDevBypassAuth` function was implemented to resolve user context based on the provided user ID from the dev auth header. - **Enhanced Demo Data Seeding**: The demo data seeding script (`seed-demo-data.ts`) was updated to automatically seed deterministic demo users (admin and accountant) and print their IDs. This facilitates easy setup for local development using the new dev authentication bypass. - **Documentation Update**: The `demo-staging-guide.md` documentation was updated with clear instructions on how to set up and use the local development authentication bypass, including environment variable configuration and role switching. - Updated dependencies [[`917f31e`](https://github.com/Urigo/accounter-fullstack/commit/917f31e956d267704f6d74fb7f3a22d366062135), [`161c8f9`](https://github.com/Urigo/accounter-fullstack/commit/161c8f9a5bc755a488b1a14125c2c14425765e59)]: - @accounter/green-invoice-graphql@0.8.6-alpha-20260411164103-0d3f9f4aa1fdef3dd9e48fa9f85b399cc3f6bf3f ## 0.0.11 ### Patch Changes - [#3034](https://github.com/Urigo/accounter-fullstack/pull/3034) [`88e8bb9`](https://github.com/Urigo/accounter-fullstack/commit/88e8bb914be1965333e0b899537562c8877782a1) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`@ai-sdk/anthropic@1.2.12` ↗︎](https://www.npmjs.com/package/@ai-sdk/anthropic/v/1.2.12) (from `1.2.11`, in `dependencies`) - Updated dependency [`@graphql-hive/yoga@0.42.1` ↗︎](https://www.npmjs.com/package/@graphql-hive/yoga/v/0.42.1) (from `0.42.0`, in `dependencies`) - Updated dependency [`zod@3.25.28` ↗︎](https://www.npmjs.com/package/zod/v/3.25.28) (from `3.25.14`, in `dependencies`) - [#2954](https://github.com/Urigo/accounter-fullstack/pull/2954) [`79fef66`](https://github.com/Urigo/accounter-fullstack/commit/79fef668ca7a7f2b2411ae5f5d4d0bdc5bb2fa2b) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`@ai-sdk/anthropic@3.0.23` ↗︎](https://www.npmjs.com/package/@ai-sdk/anthropic/v/3.0.23) (from `3.0.17`, in `dependencies`) - Updated dependency [`@graphql-hive/yoga@0.47.1` ↗︎](https://www.npmjs.com/package/@graphql-hive/yoga/v/0.47.1) (from `0.47.0`, in `dependencies`) - Updated dependency [`ai@6.0.49` ↗︎](https://www.npmjs.com/package/ai/v/6.0.49) (from `6.0.42`, in `dependencies`) - Updated dependency [`zod@4.3.6` ↗︎](https://www.npmjs.com/package/zod/v/4.3.6) (from `4.3.5`, in `dependencies`) - [#2962](https://github.com/Urigo/accounter-fullstack/pull/2962) [`8dca87f`](https://github.com/Urigo/accounter-fullstack/commit/8dca87f957b5cbb1ee3c4683a8e785fa442d44bb) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`playwright@1.58.0` ↗︎](https://www.npmjs.com/package/playwright/v/1.58.0) (from `1.57.0`, in `dependencies`) - [#2978](https://github.com/Urigo/accounter-fullstack/pull/2978) [`8f6d661`](https://github.com/Urigo/accounter-fullstack/commit/8f6d66108bd088388673e7cd53d1c1016d03c762) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`ai@6.0.50` ↗︎](https://www.npmjs.com/package/ai/v/6.0.50) (from `6.0.49`, in `dependencies`) - [#2982](https://github.com/Urigo/accounter-fullstack/pull/2982) [`859a42a`](https://github.com/Urigo/accounter-fullstack/commit/859a42a4fd67574f9c45d5f721f83e2df93b921e) Thanks [@gilgardosh](https://github.com/gilgardosh)! - dependencies updates: - Updated dependency [`@ai-sdk/anthropic@3.0.39` ↗︎](https://www.npmjs.com/package/@ai-sdk/anthropic/v/3.0.39) (from `3.0.36`, in `dependencies`) - Updated dependency [`ai@6.0.77` ↗︎](https://www.npmjs.com/package/ai/v/6.0.77) (from `6.0.70`, in `dependencies`) - Updated dependency [`dotenv@17.2.4` ↗︎](https://www.npmjs.com/package/dotenv/v/17.2.4) (from `17.2.3`, in `dependencies`) - Updated dependency [`googleapis@171.4.0` ↗︎](https://www.npmjs.com/package/googleapis/v/171.4.0) (from `171.3.0`, in `dependencies`) - Updated dependency [`playwright@1.58.2` ↗︎](https://www.npmjs.com/package/playwright/v/1.58.2) (from `1.58.1`, in `dependencies`) - Added dependency [`jose@6.1.3` ↗︎](https://www.npmjs.com/package/jose/v/6.1.3) (to `dependencies`) - [#2982](https://github.com/Urigo/accounter-fullstack/pull/2982) [`859a42a`](https://github.com/Urigo/accounter-fullstack/commit/859a42a4fd67574f9c45d5f721f83e2df93b921e) Thanks [@gilgardosh](https://github.com/gilgardosh)! - dependencies updates: - Added dependency [`jose@6.1.3` ↗︎](https://www.npmjs.com/package/jose/v/6.1.3) (to `dependencies`) - [#2988](https://github.com/Urigo/accounter-fullstack/pull/2988) [`3c2df4f`](https://github.com/Urigo/accounter-fullstack/commit/3c2df4f4cb79ec90fc5cfe372f7cede5e56f27e7) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`@ai-sdk/anthropic@3.0.36` ↗︎](https://www.npmjs.com/package/@ai-sdk/anthropic/v/3.0.36) (from `3.0.23`, in `dependencies`) - Updated dependency [`@graphql-hive/yoga@0.47.2` ↗︎](https://www.npmjs.com/package/@graphql-hive/yoga/v/0.47.2) (from `0.47.1`, in `dependencies`) - Updated dependency [`ai@6.0.69` ↗︎](https://www.npmjs.com/package/ai/v/6.0.69) (from `6.0.50`, in `dependencies`) - Updated dependency [`playwright@1.58.1` ↗︎](https://www.npmjs.com/package/playwright/v/1.58.1) (from `1.58.0`, in `dependencies`) - [#2989](https://github.com/Urigo/accounter-fullstack/pull/2989) [`bb647ea`](https://github.com/Urigo/accounter-fullstack/commit/bb647eaa753e23431bc21994f4c4887002530b72) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`googleapis@171.0.0` ↗︎](https://www.npmjs.com/package/googleapis/v/171.0.0) (from `170.1.0`, in `dependencies`) - [#2990](https://github.com/Urigo/accounter-fullstack/pull/2990) [`357ab5a`](https://github.com/Urigo/accounter-fullstack/commit/357ab5ac83c0735c7a8dd1f6963b77cbba84ee29) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`pg@8.18.0` ↗︎](https://www.npmjs.com/package/pg/v/8.18.0) (from `8.17.2`, in `dependencies`) - [#2998](https://github.com/Urigo/accounter-fullstack/pull/2998) [`11736c9`](https://github.com/Urigo/accounter-fullstack/commit/11736c9dd2b065f4a78da3a31fa5bf3d37f2ad54) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`googleapis@171.2.0` ↗︎](https://www.npmjs.com/package/googleapis/v/171.2.0) (from `171.0.0`, in `dependencies`) - [#2999](https://github.com/Urigo/accounter-fullstack/pull/2999) [`1f9675e`](https://github.com/Urigo/accounter-fullstack/commit/1f9675e5ae7e516770b7a052a79bbcfcd758b748) Thanks [@gilgardosh](https://github.com/gilgardosh)! - dependencies updates: - Updated dependency [`@ai-sdk/anthropic@3.0.36` ↗︎](https://www.npmjs.com/package/@ai-sdk/anthropic/v/3.0.36) (from `3.0.23`, in `dependencies`) - Updated dependency [`@graphql-hive/yoga@0.47.2` ↗︎](https://www.npmjs.com/package/@graphql-hive/yoga/v/0.47.2) (from `0.47.1`, in `dependencies`) - Updated dependency [`ai@6.0.69` ↗︎](https://www.npmjs.com/package/ai/v/6.0.69) (from `6.0.50`, in `dependencies`) - Updated dependency [`googleapis@171.2.0` ↗︎](https://www.npmjs.com/package/googleapis/v/171.2.0) (from `171.0.0`, in `dependencies`) - Updated dependency [`playwright@1.58.1` ↗︎](https://www.npmjs.com/package/playwright/v/1.58.1) (from `1.58.0`, in `dependencies`) - [#3004](https://github.com/Urigo/accounter-fullstack/pull/3004) [`253c49d`](https://github.com/Urigo/accounter-fullstack/commit/253c49d03828a90426386cea5e1a58e080f759f9) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`ai@6.0.70` ↗︎](https://www.npmjs.com/package/ai/v/6.0.70) (from `6.0.69`, in `dependencies`) - [#3007](https://github.com/Urigo/accounter-fullstack/pull/3007) [`0a8cfcb`](https://github.com/Urigo/accounter-fullstack/commit/0a8cfcb862c24bd0c4c450b8adbbaa0d0ca3582b) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`googleapis@171.3.0` ↗︎](https://www.npmjs.com/package/googleapis/v/171.3.0) (from `171.2.0`, in `dependencies`) - [#3025](https://github.com/Urigo/accounter-fullstack/pull/3025) [`0b5b2ea`](https://github.com/Urigo/accounter-fullstack/commit/0b5b2ea65abe31286a97615a46cad149da72f235) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`@ai-sdk/anthropic@3.0.39` ↗︎](https://www.npmjs.com/package/@ai-sdk/anthropic/v/3.0.39) (from `3.0.36`, in `dependencies`) - Updated dependency [`ai@6.0.77` ↗︎](https://www.npmjs.com/package/ai/v/6.0.77) (from `6.0.70`, in `dependencies`) - Updated dependency [`dotenv@17.2.4` ↗︎](https://www.npmjs.com/package/dotenv/v/17.2.4) (from `17.2.3`, in `dependencies`) - Updated dependency [`playwright@1.58.2` ↗︎](https://www.npmjs.com/package/playwright/v/1.58.2) (from `1.58.1`, in `dependencies`) - [#3026](https://github.com/Urigo/accounter-fullstack/pull/3026) [`b07a629`](https://github.com/Urigo/accounter-fullstack/commit/b07a62943ed2a73355b62d740fe27deede7d0099) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`googleapis@171.4.0` ↗︎](https://www.npmjs.com/package/googleapis/v/171.4.0) (from `171.3.0`, in `dependencies`) - [#3029](https://github.com/Urigo/accounter-fullstack/pull/3029) [`80ecd47`](https://github.com/Urigo/accounter-fullstack/commit/80ecd47f6f2d7bceaa87c2e6fd33a5ca00a8c976) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`ai@6.0.78` ↗︎](https://www.npmjs.com/package/ai/v/6.0.78) (from `6.0.77`, in `dependencies`) - [#3031](https://github.com/Urigo/accounter-fullstack/pull/3031) [`211446a`](https://github.com/Urigo/accounter-fullstack/commit/211446a6757b501d71131f2b4689bcefcf46d580) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`@ai-sdk/anthropic@3.0.40` ↗︎](https://www.npmjs.com/package/@ai-sdk/anthropic/v/3.0.40) (from `3.0.39`, in `dependencies`) - [#3034](https://github.com/Urigo/accounter-fullstack/pull/3034) [`88e8bb9`](https://github.com/Urigo/accounter-fullstack/commit/88e8bb914be1965333e0b899537562c8877782a1) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`@ai-sdk/anthropic@3.0.44` ↗︎](https://www.npmjs.com/package/@ai-sdk/anthropic/v/3.0.44) (from `3.0.40`, in `dependencies`) - Updated dependency [`@google-cloud/pubsub@5.2.3` ↗︎](https://www.npmjs.com/package/@google-cloud/pubsub/v/5.2.3) (from `5.2.2`, in `dependencies`) - Updated dependency [`@graphql-hive/yoga@0.47.3` ↗︎](https://www.npmjs.com/package/@graphql-hive/yoga/v/0.47.3) (from `0.47.2`, in `dependencies`) - Updated dependency [`ai@6.0.86` ↗︎](https://www.npmjs.com/package/ai/v/6.0.86) (from `6.0.78`, in `dependencies`) - [#3039](https://github.com/Urigo/accounter-fullstack/pull/3039) [`6c5f52c`](https://github.com/Urigo/accounter-fullstack/commit/6c5f52ca44eefe53e301482f0781d0d2a3540357) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`@envelop/generic-auth@11.1.1` ↗︎](https://www.npmjs.com/package/@envelop/generic-auth/v/11.1.1) (from `11.1.0`, in `dependencies`) - Updated dependency [`@envelop/graphql-modules@9.1.1` ↗︎](https://www.npmjs.com/package/@envelop/graphql-modules/v/9.1.1) (from `9.1.0`, in `dependencies`) - [#3057](https://github.com/Urigo/accounter-fullstack/pull/3057) [`cac79a9`](https://github.com/Urigo/accounter-fullstack/commit/cac79a983189c61e40d9e66a6a7a0da133aff31a) Thanks [@gilgardosh](https://github.com/gilgardosh)! - dependencies updates: - Added dependency [`async-mutex@0.5.0` ↗︎](https://www.npmjs.com/package/async-mutex/v/0.5.0) (to `dependencies`) - [#3041](https://github.com/Urigo/accounter-fullstack/pull/3041) [`352ee1b`](https://github.com/Urigo/accounter-fullstack/commit/352ee1b16018745057219979280d49a86e645d4c) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`dotenv@17.3.1` ↗︎](https://www.npmjs.com/package/dotenv/v/17.3.1) (from `17.2.4`, in `dependencies`) - [#3057](https://github.com/Urigo/accounter-fullstack/pull/3057) [`cac79a9`](https://github.com/Urigo/accounter-fullstack/commit/cac79a983189c61e40d9e66a6a7a0da133aff31a) Thanks [@gilgardosh](https://github.com/gilgardosh)! - dependencies updates: - Added dependency [`async-mutex@0.5.0` ↗︎](https://www.npmjs.com/package/async-mutex/v/0.5.0) (to `dependencies`) - [#3066](https://github.com/Urigo/accounter-fullstack/pull/3066) [`560aaa4`](https://github.com/Urigo/accounter-fullstack/commit/560aaa4e320f71cc9a721945d3ead070c4b5cfed) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`@ai-sdk/anthropic@3.0.46` ↗︎](https://www.npmjs.com/package/@ai-sdk/anthropic/v/3.0.46) (from `3.0.44`, in `dependencies`) - Updated dependency [`ai@6.0.97` ↗︎](https://www.npmjs.com/package/ai/v/6.0.97) (from `6.0.86`, in `dependencies`) - [#3093](https://github.com/Urigo/accounter-fullstack/pull/3093) [`db0d20c`](https://github.com/Urigo/accounter-fullstack/commit/db0d20c8859d5a625598d4a52da8960712b53bbd) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`@google-cloud/pubsub@5.3.0` ↗︎](https://www.npmjs.com/package/@google-cloud/pubsub/v/5.3.0) (from `5.2.3`, in `dependencies`) - [#3170](https://github.com/Urigo/accounter-fullstack/pull/3170) [`376a3a5`](https://github.com/Urigo/accounter-fullstack/commit/376a3a5a9fc8b3ff6b7ca28f3de04365109a9bb6) Thanks [@gilgardosh](https://github.com/gilgardosh)! - dependencies updates: - Added dependency [`auth0@5.3.1` ↗︎](https://www.npmjs.com/package/auth0/v/5.3.1) (to `dependencies`) - [#3116](https://github.com/Urigo/accounter-fullstack/pull/3116) [`74e4338`](https://github.com/Urigo/accounter-fullstack/commit/74e4338e79ced57d492f2b677c73ffe23682bda6) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`ai@6.0.98` ↗︎](https://www.npmjs.com/package/ai/v/6.0.98) (from `6.0.97`, in `dependencies`) - [#3121](https://github.com/Urigo/accounter-fullstack/pull/3121) [`992e2ed`](https://github.com/Urigo/accounter-fullstack/commit/992e2edb1507dcb64ccf07b24b7b850fe6fe815b) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`graphql@16.13.0` ↗︎](https://www.npmjs.com/package/graphql/v/16.13.0) (from `16.12.0`, in `dependencies`) - [#3133](https://github.com/Urigo/accounter-fullstack/pull/3133) [`9dcc165`](https://github.com/Urigo/accounter-fullstack/commit/9dcc16590189d77113748dec7305b65e3466a372) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`@ai-sdk/anthropic@3.0.47` ↗︎](https://www.npmjs.com/package/@ai-sdk/anthropic/v/3.0.47) (from `3.0.46`, in `dependencies`) - Updated dependency [`ai@6.0.99` ↗︎](https://www.npmjs.com/package/ai/v/6.0.99) (from `6.0.98`, in `dependencies`) - [#3136](https://github.com/Urigo/accounter-fullstack/pull/3136) [`d4875ca`](https://github.com/Urigo/accounter-fullstack/commit/d4875cafe26e8311e0c12a189f5275f017ce5add) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`pg@8.19.0` ↗︎](https://www.npmjs.com/package/pg/v/8.19.0) (from `8.18.0`, in `dependencies`) - [#3148](https://github.com/Urigo/accounter-fullstack/pull/3148) [`2265bd3`](https://github.com/Urigo/accounter-fullstack/commit/2265bd35a651989d47f1e791c8638b82f4bdeaf0) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`@ai-sdk/anthropic@3.0.50` ↗︎](https://www.npmjs.com/package/@ai-sdk/anthropic/v/3.0.50) (from `3.0.47`, in `dependencies`) - Updated dependency [`ai@6.0.105` ↗︎](https://www.npmjs.com/package/ai/v/6.0.105) (from `6.0.99`, in `dependencies`) - [#3149](https://github.com/Urigo/accounter-fullstack/pull/3149) [`e3f6af1`](https://github.com/Urigo/accounter-fullstack/commit/e3f6af1516a22eae8f9edb07f716c6dc9765654a) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`@ai-sdk/anthropic@3.0.51` ↗︎](https://www.npmjs.com/package/@ai-sdk/anthropic/v/3.0.51) (from `3.0.50`, in `dependencies`) - Updated dependency [`ai@6.0.106` ↗︎](https://www.npmjs.com/package/ai/v/6.0.106) (from `6.0.105`, in `dependencies`) - [#3159](https://github.com/Urigo/accounter-fullstack/pull/3159) [`e47b428`](https://github.com/Urigo/accounter-fullstack/commit/e47b4287ec3060ed93f12281bcfc711322244cb7) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`pg@8.20.0` ↗︎](https://www.npmjs.com/package/pg/v/8.20.0) (from `8.19.0`, in `dependencies`) - [#3161](https://github.com/Urigo/accounter-fullstack/pull/3161) [`c33e0a4`](https://github.com/Urigo/accounter-fullstack/commit/c33e0a4c859d6051c0f27c716e304d898e2388b2) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`jose@6.2.0` ↗︎](https://www.npmjs.com/package/jose/v/6.2.0) (from `6.1.3`, in `dependencies`) - [#3162](https://github.com/Urigo/accounter-fullstack/pull/3162) [`87ed17f`](https://github.com/Urigo/accounter-fullstack/commit/87ed17f5269aee029165f0ca5b84690024d5d8ba) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`@graphql-hive/yoga@0.48.0` ↗︎](https://www.npmjs.com/package/@graphql-hive/yoga/v/0.48.0) (from `0.47.3`, in `dependencies`) - [#3165](https://github.com/Urigo/accounter-fullstack/pull/3165) [`8c2de24`](https://github.com/Urigo/accounter-fullstack/commit/8c2de240a2bc926a33200cba756f6ca5ceb5e875) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`@graphql-yoga/plugin-defer-stream@3.18.1` ↗︎](https://www.npmjs.com/package/@graphql-yoga/plugin-defer-stream/v/3.18.1) (from `3.18.0`, in `dependencies`) - Updated dependency [`graphql-yoga@5.18.1` ↗︎](https://www.npmjs.com/package/graphql-yoga/v/5.18.1) (from `5.18.0`, in `dependencies`) - [#3166](https://github.com/Urigo/accounter-fullstack/pull/3166) [`26474f3`](https://github.com/Urigo/accounter-fullstack/commit/26474f32495cc9fe028476840bd3d15fee8b5143) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`@ai-sdk/anthropic@3.0.58` ↗︎](https://www.npmjs.com/package/@ai-sdk/anthropic/v/3.0.58) (from `3.0.51`, in `dependencies`) - Updated dependency [`ai@6.0.116` ↗︎](https://www.npmjs.com/package/ai/v/6.0.116) (from `6.0.106`, in `dependencies`) - Updated dependency [`graphql@16.13.1` ↗︎](https://www.npmjs.com/package/graphql/v/16.13.1) (from `16.13.0`, in `dependencies`) - Updated dependency [`jose@6.2.1` ↗︎](https://www.npmjs.com/package/jose/v/6.2.1) (from `6.2.0`, in `dependencies`) - [#3170](https://github.com/Urigo/accounter-fullstack/pull/3170) [`376a3a5`](https://github.com/Urigo/accounter-fullstack/commit/376a3a5a9fc8b3ff6b7ca28f3de04365109a9bb6) Thanks [@gilgardosh](https://github.com/gilgardosh)! - dependencies updates: - Added dependency [`auth0@5.3.1` ↗︎](https://www.npmjs.com/package/auth0/v/5.3.1) (to `dependencies`) - [#3171](https://github.com/Urigo/accounter-fullstack/pull/3171) [`c0dc497`](https://github.com/Urigo/accounter-fullstack/commit/c0dc4978cf26b745c3a35fad6035ed42c254ec85) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`auth0@5.4.0` ↗︎](https://www.npmjs.com/package/auth0/v/5.4.0) (from `5.3.1`, in `dependencies`) - [#3179](https://github.com/Urigo/accounter-fullstack/pull/3179) [`d67c113`](https://github.com/Urigo/accounter-fullstack/commit/d67c113936e3b936509ae461b88306337f107b43) Thanks [@gilgardosh](https://github.com/gilgardosh)! - dependencies updates: - Added dependency [`@envelop/core@5.5.1` ↗︎](https://www.npmjs.com/package/@envelop/core/v/5.5.1) (to `dependencies`) - Added dependency [`@graphql-tools/utils@11.0.0` ↗︎](https://www.npmjs.com/package/@graphql-tools/utils/v/11.0.0) (to `dependencies`) - [#3179](https://github.com/Urigo/accounter-fullstack/pull/3179) [`d67c113`](https://github.com/Urigo/accounter-fullstack/commit/d67c113936e3b936509ae461b88306337f107b43) Thanks [@gilgardosh](https://github.com/gilgardosh)! - dependencies updates: - Added dependency [`@envelop/core@5.5.1` ↗︎](https://www.npmjs.com/package/@envelop/core/v/5.5.1) (to `dependencies`) - Added dependency [`@graphql-tools/utils@11.0.0` ↗︎](https://www.npmjs.com/package/@graphql-tools/utils/v/11.0.0) (to `dependencies`) - [#3206](https://github.com/Urigo/accounter-fullstack/pull/3206) [`443e2f1`](https://github.com/Urigo/accounter-fullstack/commit/443e2f1e812547b5d80be05f003e4fe579e88e6b) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`auth0@5.5.0` ↗︎](https://www.npmjs.com/package/auth0/v/5.5.0) (from `5.4.0`, in `dependencies`) - [#3214](https://github.com/Urigo/accounter-fullstack/pull/3214) [`69a150b`](https://github.com/Urigo/accounter-fullstack/commit/69a150bcb25903593316b4c9d3f344b428585a72) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`@ai-sdk/anthropic@3.0.63` ↗︎](https://www.npmjs.com/package/@ai-sdk/anthropic/v/3.0.63) (from `3.0.58`, in `dependencies`) - Updated dependency [`ai@6.0.134` ↗︎](https://www.npmjs.com/package/ai/v/6.0.134) (from `6.0.116`, in `dependencies`) - Updated dependency [`jose@6.2.2` ↗︎](https://www.npmjs.com/package/jose/v/6.2.2) (from `6.2.1`, in `dependencies`) - [#3246](https://github.com/Urigo/accounter-fullstack/pull/3246) [`cb0dbc5`](https://github.com/Urigo/accounter-fullstack/commit/cb0dbc518e8f31a0e69180d83c444658a6ca019e) Thanks [@gilgardosh](https://github.com/gilgardosh)! - dependencies updates: - Updated dependency [`@ai-sdk/anthropic@3.0.63` ↗︎](https://www.npmjs.com/package/@ai-sdk/anthropic/v/3.0.63) (from `3.0.58`, in `dependencies`) - Updated dependency [`ai@6.0.134` ↗︎](https://www.npmjs.com/package/ai/v/6.0.134) (from `6.0.116`, in `dependencies`) - Updated dependency [`jose@6.2.2` ↗︎](https://www.npmjs.com/package/jose/v/6.2.2) (from `6.2.1`, in `dependencies`) - [#3247](https://github.com/Urigo/accounter-fullstack/pull/3247) [`43dab70`](https://github.com/Urigo/accounter-fullstack/commit/43dab70e682bd96b4e7c252a2bbda94df8f0e0ba) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`@ai-sdk/anthropic@3.0.64` ↗︎](https://www.npmjs.com/package/@ai-sdk/anthropic/v/3.0.64) (from `3.0.63`, in `dependencies`) - Updated dependency [`ai@6.0.141` ↗︎](https://www.npmjs.com/package/ai/v/6.0.141) (from `6.0.134`, in `dependencies`) - Updated dependency [`graphql@16.13.2` ↗︎](https://www.npmjs.com/package/graphql/v/16.13.2) (from `16.13.1`, in `dependencies`) - [#3262](https://github.com/Urigo/accounter-fullstack/pull/3262) [`41417f2`](https://github.com/Urigo/accounter-fullstack/commit/41417f251c65a517a6312c1b393f96518a0c1179) Thanks [@gilgardosh](https://github.com/gilgardosh)! - dependencies updates: - Added dependency [`@opentelemetry/api@1.9.1` ↗︎](https://www.npmjs.com/package/@opentelemetry/api/v/1.9.1) (to `dependencies`) - Added dependency [`@opentelemetry/auto-instrumentations-node@0.72.0` ↗︎](https://www.npmjs.com/package/@opentelemetry/auto-instrumentations-node/v/0.72.0) (to `dependencies`) - Added dependency [`@opentelemetry/exporter-trace-otlp-http@0.214.0` ↗︎](https://www.npmjs.com/package/@opentelemetry/exporter-trace-otlp-http/v/0.214.0) (to `dependencies`) - Added dependency [`@opentelemetry/resources@2.6.1` ↗︎](https://www.npmjs.com/package/@opentelemetry/resources/v/2.6.1) (to `dependencies`) - Added dependency [`@opentelemetry/sdk-node@0.214.0` ↗︎](https://www.npmjs.com/package/@opentelemetry/sdk-node/v/0.214.0) (to `dependencies`) - Added dependency [`@opentelemetry/semantic-conventions@1.40.0` ↗︎](https://www.npmjs.com/package/@opentelemetry/semantic-conventions/v/1.40.0) (to `dependencies`) - [#3262](https://github.com/Urigo/accounter-fullstack/pull/3262) [`41417f2`](https://github.com/Urigo/accounter-fullstack/commit/41417f251c65a517a6312c1b393f96518a0c1179) Thanks [@gilgardosh](https://github.com/gilgardosh)! - dependencies updates: - Added dependency [`@opentelemetry/api@1.9.1` ↗︎](https://www.npmjs.com/package/@opentelemetry/api/v/1.9.1) (to `dependencies`) - Added dependency [`@opentelemetry/auto-instrumentations-node@0.72.0` ↗︎](https://www.npmjs.com/package/@opentelemetry/auto-instrumentations-node/v/0.72.0) (to `dependencies`) - Added dependency [`@opentelemetry/exporter-trace-otlp-http@0.214.0` ↗︎](https://www.npmjs.com/package/@opentelemetry/exporter-trace-otlp-http/v/0.214.0) (to `dependencies`) - Added dependency [`@opentelemetry/resources@2.6.1` ↗︎](https://www.npmjs.com/package/@opentelemetry/resources/v/2.6.1) (to `dependencies`) - Added dependency [`@opentelemetry/sdk-node@0.214.0` ↗︎](https://www.npmjs.com/package/@opentelemetry/sdk-node/v/0.214.0) (to `dependencies`) - Added dependency [`@opentelemetry/semantic-conventions@1.40.0` ↗︎](https://www.npmjs.com/package/@opentelemetry/semantic-conventions/v/1.40.0) (to `dependencies`) - [#3275](https://github.com/Urigo/accounter-fullstack/pull/3275) [`422938d`](https://github.com/Urigo/accounter-fullstack/commit/422938d80ef44a11e45b55c639e3238bf5d19160) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`playwright@1.59.0` ↗︎](https://www.npmjs.com/package/playwright/v/1.59.0) (from `1.58.2`, in `dependencies`) - [#3072](https://github.com/Urigo/accounter-fullstack/pull/3072) [`1b54fbd`](https://github.com/Urigo/accounter-fullstack/commit/1b54fbd83e0c2c9ed829b8fca2da2b879da0138d) Thanks [@gilgardosh](https://github.com/gilgardosh)! - - A new provider, `FinancialAccountsTaxCategoriesProvider`, has been added to handle database operations for financial account tax categories. This provider includes SQL queries for fetching, updating, inserting, and deleting tax categories, and utilizes a `DataLoader` for efficient data retrieval. - The `financial-accounts.resolver.ts` now includes comprehensive logic to manage tax categories during financial account creation and updates. This involves identifying new categories to insert, existing ones to update, and old ones to delete, ensuring data consistency. - [#3273](https://github.com/Urigo/accounter-fullstack/pull/3273) [`d27d6b2`](https://github.com/Urigo/accounter-fullstack/commit/d27d6b2e26f8db119589476615c0d0e1e2147315) Thanks [@gilgardosh](https://github.com/gilgardosh)! - - fix charge amount where credit invoices exist - validate document amount is positive (sign determined according to debtor and creditor sides) - enhance error messaging levaraging Green Invoice's error messages - [#2982](https://github.com/Urigo/accounter-fullstack/pull/2982) [`859a42a`](https://github.com/Urigo/accounter-fullstack/commit/859a42a4fd67574f9c45d5f721f83e2df93b921e) Thanks [@gilgardosh](https://github.com/gilgardosh)! - - **Provider Cache Patterns Documentation**: Added a new document outlining provider cache patterns and isolation strategies to prevent data leakage in multi-tenant architectures. - **AdminContext Provider Refactoring**: Refactored the existing `AdminContextProvider` to use `Scope.Operation` for request-scoped caching and proper DI integration, addressing tenant leakage risks. The original plugin remains active. - **TenantAwareDBClient and AUTH_CONTEXT**: The PR prepares for a future phase (4.8) where `DBProvider` will be switched to `TenantAwareDBClient` and `AUTH_CONTEXT` will be integrated. The current refactoring keeps the existing `DBProvider` to avoid breaking changes. - **Cache Isolation Integration Tests**: Added new integration tests to verify cache isolation between concurrent requests for various providers. - **Provider Scope Changes**: Many providers are changed to `Scope.Operation` to ensure tenant-specific data is handled with request-level isolation. - [#3179](https://github.com/Urigo/accounter-fullstack/pull/3179) [`d67c113`](https://github.com/Urigo/accounter-fullstack/commit/d67c113936e3b936509ae461b88306337f107b43) Thanks [@gilgardosh](https://github.com/gilgardosh)! - - **Authorization Provider**: Created provider-layer authorization for complex checks. - [#3101](https://github.com/Urigo/accounter-fullstack/pull/3101) [`7dd3537`](https://github.com/Urigo/accounter-fullstack/commit/7dd35375be2648dfbfbfeee8cffa254536ea835a) Thanks [@gilgardosh](https://github.com/gilgardosh)! - - **Owner ID Enforcement**: Implemented a system-wide enforcement of `owner_id` for all new record insertions into various protected database tables, ensuring data ownership and multi-tenancy. - **New Helper Function**: Introduced a new helper function, `reassureOwnerIdExists`, to standardize the injection of `owner_id` into database insert parameters, falling back to the default admin business ID if not explicitly provided. - **SQL Query Modifications**: Modified numerous SQL `INSERT` statements across multiple modules to include the `owner_id` column and its corresponding value, and updated `ON CONFLICT` clauses where applicable. - **Provider Integration**: Injected the GraphQL `CONTEXT` into the constructors of various data providers to enable access to the `owner_id` and integrated the `reassureOwnerIdExists` helper into their `insert` methods. - [#3000](https://github.com/Urigo/accounter-fullstack/pull/3000) [`653f97c`](https://github.com/Urigo/accounter-fullstack/commit/653f97cb5ed3a4d420023d22494452ac3e80b1ec) Thanks [@gilgardosh](https://github.com/gilgardosh)! - - **Account Filtering for Balance Report**: The 'Transactions Balance' report now supports filtering by financial accounts, allowing users to include or exclude specific accounts from the report. - **Frontend UI Enhancements**: The balance report filter form has been updated with new account selection fields, improved form validation using Zod, and UI component adjustments for better responsiveness. - **Backend GraphQL Integration**: The GraphQL schema and resolvers have been extended to include financial account data for transactions and to support the new account-based filtering logic. - **Reusable Account Fetching Logic**: A new helper function and a client-side hook were introduced to centralize and streamline the fetching and management of financial account data. - [#3003](https://github.com/Urigo/accounter-fullstack/pull/3003) [`7809f6d`](https://github.com/Urigo/accounter-fullstack/commit/7809f6dc1a16373a205d76bdc2458d6132785e2c) Thanks [@gilgardosh](https://github.com/gilgardosh)! - - **Swift Code Integration**: This PR introduces the 'swiftCode' field to financial bank accounts, enhancing the system's ability to manage international banking details. - **Schema and UI Updates**: The changes include updates to the financial account schema, UI components, and database migrations to accommodate the new 'swiftCode' field. - **Database Migration**: A new migration script is added to update the 'financial_bank_accounts' table with a 'swift_code' column. - [#2982](https://github.com/Urigo/accounter-fullstack/pull/2982) [`859a42a`](https://github.com/Urigo/accounter-fullstack/commit/859a42a4fd67574f9c45d5f721f83e2df93b921e) Thanks [@gilgardosh](https://github.com/gilgardosh)! - - **New Authentication Plugin (Auth Plugin V2)**: Introduced a new GraphQL Yoga plugin, `authPluginV2`, responsible for extracting raw authentication credentials (JWT or API Key) from request headers. This plugin is designed to be part of the v2 authentication system, specifically for Auth0 integration, and focuses solely on credential extraction without verification. - **Environment Variable for Auth0 Control**: Added a new environment variable, `USE_AUTH0`, to the server's configuration. This variable allows for toggling the use of Auth0, indicating a phased rollout or conditional activation of the new authentication system. - **Support for JWT and API Key Extraction**: The new plugin can extract JWTs from the `Authorization: Bearer` header and API keys from the `X-API-Key` header, with JWT taking precedence when both are present. It also handles cases of missing or malformed headers gracefully. - **Comprehensive Unit Tests**: A dedicated test file (`auth-plugin-v2.test.ts`) has been added to thoroughly test the functionality of the `authPluginV2`, covering various scenarios including token extraction, header precedence, and error handling for malformed inputs. - [#3170](https://github.com/Urigo/accounter-fullstack/pull/3170) [`376a3a5`](https://github.com/Urigo/accounter-fullstack/commit/376a3a5a9fc8b3ff6b7ca28f3de04365109a9bb6) Thanks [@gilgardosh](https://github.com/gilgardosh)! - - **Auth0 Management Service Enhancements**: The Auth0ManagementService now includes new functionalities for user management, such as unblocking users and initiating password reset emails. - **User Creation Flow Adjustment**: The `createUser` method has been renamed to `createBlockedUser` to explicitly reflect that newly created users are initially blocked, aligning with an invitation-based registration process. - **Dependency Injection for Environment**: The service now uses dependency injection for environment variables, improving testability and modularity. - [#3088](https://github.com/Urigo/accounter-fullstack/pull/3088) [`392b25f`](https://github.com/Urigo/accounter-fullstack/commit/392b25fabd0154488569b14c6ebda805e1e0f9e3) Thanks [@gilgardosh](https://github.com/gilgardosh)! - - **Database Schema Enforcement**: A new migration was introduced to enforce the `owner_id` column as `NOT NULL` across numerous tables in the `accounter_schema`, a critical step for strengthening tenant isolation. - **Migration Refinements**: An existing migration for `ledger_records` was updated to temporarily disable and re-enable Row Level Security (RLS) on the `charges` table during the `owner_id` backfill process, ensuring proper data manipulation without RLS interference. - **Data Seeding and Testing Alignment**: All relevant test factories, fixture definitions, and data seeding scripts were updated to explicitly include and correctly handle the `owner_id` field, ensuring consistency with the new non-nullable constraint. - **Query Optimization**: Several database queries in various providers (contracts, corn-jobs, documents, reports, transactions) were refactored to directly access the `owner_id` from the primary table (e.g., `transactions.owner_id`, `documents.owner_id`) instead of relying on joins to the `charges` table, simplifying query logic and improving efficiency. - **Migration Cleanup**: Initial data insertion statements were removed from older migration files (`refactor-tags.ts`, `add-to-context-salary-excess-expenses.ts`), indicating a cleanup or relocation of initial data seeding logic. - [#3114](https://github.com/Urigo/accounter-fullstack/pull/3114) [`84f9e20`](https://github.com/Urigo/accounter-fullstack/commit/84f9e203c696c8b76a7cef2128547e8cde7559f0) Thanks [@gilgardosh](https://github.com/gilgardosh)! - - **Database Provider Migration**: Replaced the generic `DBProvider` with `TenantAwareDBClient` across numerous modules, including business trips, corn jobs, and Deel invoices, to facilitate tenant-aware database operations. - **Tax Category Lookup Simplification**: Refactored tax category lookups to remove the explicit `ownerId` parameter, now relying on the `TenantAwareDBClient` to handle tenant context implicitly. This involved updates to GraphQL schemas, resolvers, and DataLoader implementations. - **SQL Query and Schema Adjustments**: Modified SQL `UPDATE` queries in charges and financial entities to no longer explicitly update `owner_id`. GraphQL input types and queries were also updated to remove `ownerId` parameters where appropriate. - **VAT Report Logic Update**: Adjusted the logic for determining `isExpense` and `counterpartyId` in VAT reporting to correctly use `doc.owner_id` instead of `charge.owner_id`, aligning with the new tenant-aware data model. - **Service Scope Change**: Changed the scope of `CornJobsProvider` from `Singleton` to `Operation` to ensure proper tenant context isolation for background tasks. - [#3037](https://github.com/Urigo/accounter-fullstack/pull/3037) [`854112e`](https://github.com/Urigo/accounter-fullstack/commit/854112e6a5ac27c85cfe46a5661f2e1658c8f995) Thanks [@gilgardosh](https://github.com/gilgardosh)! - - **Depreciation Category Deletion**: Corrected the table name used in the `deleteDepreciationCategory` SQL query from `depreciation` to `depreciation_categories` to ensure accurate data deletion. - **Document Filtering Logic**: Updated the `getDocumentsByExtendedFilters` query to join with the `charges` table instead of `extended_charges` and refined the logic for identifying 'unmatched' documents by using a `NOT EXISTS` subquery against the `transactions` table. - **Tax Category Query Removal**: Removed the `getTaxCategoryByChargeIDs` SQL query, its associated DataLoader, and related type definitions and invalidation calls, indicating the deprecation or removal of this specific lookup mechanism. - [#3054](https://github.com/Urigo/accounter-fullstack/pull/3054) [`20ef6fd`](https://github.com/Urigo/accounter-fullstack/commit/20ef6fd9099f5646e85f28a31130bb149ab8da81) Thanks [@gilgardosh](https://github.com/gilgardosh)! - - **Database Schema Extension**: A new database migration was added to introduce a `recipient_legal_entity_id` column to the `accounter_schema.deel_invoices` table, enhancing data capture for legal entities. - **API Schema Updates for Deel Integration**: The Deel invoice schema was extended to include `recipient_legal_entity_id` and `deel_reference`, and the `timezone` field for payment receipts was made nullable. Additionally, pagination fields (`next_cursor`, `has_more`, `total_count`) were integrated into the API response schema for retrieving payment receipts. - **Workaround for Contractor-Related Fee Invoices**: A temporary fix was implemented in the Deel helper to address an issue where fee invoices with empty contractor unique identifiers were causing processing problems, ensuring these specific invoices are now handled correctly. - [#3190](https://github.com/Urigo/accounter-fullstack/pull/3190) [`75c1c91`](https://github.com/Urigo/accounter-fullstack/commit/75c1c9156109bf3386d93394c3070f7ec24f631b) Thanks [@gilgardosh](https://github.com/gilgardosh)! - - **API Key Management Mutations**: New GraphQL mutations `generateApiKey` and `revokeApiKey` have been introduced to allow business owners to manage API keys, including creating new keys with specific roles and revoking existing ones. - **API Key Listing Query**: A new GraphQL query `listApiKeys` is now available, enabling business owners to view all active API keys associated with their business. - [#3245](https://github.com/Urigo/accounter-fullstack/pull/3245) [`ca5d912`](https://github.com/Urigo/accounter-fullstack/commit/ca5d912e70f58230f832666f25482abcc725077e) Thanks [@gilgardosh](https://github.com/gilgardosh)! - - **Enhanced Search Performance**: Introduced the `pg_trgm` PostgreSQL extension and created GIN indexes on relevant text columns (`user_description`, `source_description`, `source_reference`, `description`, `remarks`, `serial_number`) across `charges`, `transactions`, and `documents` tables to significantly improve the performance of free-text search queries. - **SQL Query Refactoring for `getChargesByFilters`**: The `getChargesByFilters` SQL query was extensively refactored using Common Table Expressions (CTEs) to optimize its structure and execution. This includes a new `search_matches` CTE that leverages the new GIN indexes for efficient initial filtering based on free text, and a `filtered_charges` CTE to serve as the primary data source for subsequent joins and aggregations. - **SQL Query Refactoring for `getSimilarCharges`**: The `getSimilarCharges` SQL query was also refactored to utilize CTEs, improving its readability and maintainability by breaking down complex logic into smaller, more manageable parts. - [#2968](https://github.com/Urigo/accounter-fullstack/pull/2968) [`1ad4fa1`](https://github.com/Urigo/accounter-fullstack/commit/1ad4fa10d74628abade8ce175ad4b35c8f63eb70) Thanks [@gilgardosh](https://github.com/gilgardosh)! - - **Database Table Duplication**: A new migration duplicate the `accounter_schema.users` table to `accounter_schema.legacy_business_users`, as a step of renaming the users table. This change is crucial for distinguishing between business entities and future personal user accounts. - **Authentication Query Update**: The `auth-plugin.ts` file is updated to reflect the new table, modifying the `getUserByName` SQL query to target the `legacy_business_users` table. - **Core User Authentication Tables**: Introduced foundational database tables for user authentication and authorization, including `roles`, `permissions`, `role_permissions`, `business_users`, and `user_permission_overrides`. - **Auth0 Integration Readiness**: The `business_users` table is designed to link external Auth0 user IDs with internal business and role assignments, preparing the system for Auth0 integration. - **Role-Based Access Control (RBAC)**: Implemented a role-based access control system with predefined roles (e.g., business owner, accountant) and permissions, with provisions for future granular permission management. - **Initial Seed Data**: The migration script includes seed data for initial roles, permissions, and their mappings, providing a ready-to-use access control setup. - [#2980](https://github.com/Urigo/accounter-fullstack/pull/2980) [`1930e65`](https://github.com/Urigo/accounter-fullstack/commit/1930e653c898afa7d41676d40e0be60e8f9f0611) Thanks [@gilgardosh](https://github.com/gilgardosh)! - - **Enhanced Reliability with Auto-Restart**: Implemented an automatic restart mechanism for the Gmail Pub/Sub listener. Upon encountering subscription errors or health check failures, the listener will now attempt to stop and restart itself, improving resilience and ensuring continuous operation. - **Comprehensive Health Monitoring**: Introduced a periodic health check system that runs every 10 minutes. This system verifies the listener's active state, tracks message reception, and confirms Gmail API connectivity. If any check fails, an auto-restart is triggered to restore service. - **Extensive and Structured Logging**: Significantly improved logging across the Pub/Sub service. Log messages now include clear prefixes (e.g., "[PubSub]", "[Gmail]", "[PubSub Health]") and provide more detailed information on topic/subscription creation, message processing, error handling, and Gmail watch renewals, aiding in debugging and operational visibility. - **Improved Error Handling for Message Processing**: Modified the message processing logic to acknowledge messages even if an error occurs during their handling. This prevents messages from being infinitely redelivered and allows for better error recovery strategies. - **Robust Topic and Subscription Management**: Updated the logic for validating and creating Pub/Sub topics and subscriptions to explicitly check for their existence using the `exists()` method and provide more informative logging during creation or error scenarios. - [#2982](https://github.com/Urigo/accounter-fullstack/pull/2982) [`859a42a`](https://github.com/Urigo/accounter-fullstack/commit/859a42a4fd67574f9c45d5f721f83e2df93b921e) Thanks [@gilgardosh](https://github.com/gilgardosh)! - - **Robust Initialization**: Implemented a constructor check in `DBProvider` to ensure a PostgreSQL pool instance is always provided, improving initialization robustness. - **Database Health Check**: Introduced a `healthCheck` method to `DBProvider` for verifying database connectivity, crucial for monitoring and readiness probes. - **Graceful Shutdown**: Added a `shutdown` method to `DBProvider` to enable graceful termination of the database connection pool during application shutdown. - **Clear Usage Documentation**: Enhanced `DBProvider` with detailed JSDoc comments, clearly distinguishing between system-level database access (bypassing RLS) and future request-level access (enforcing RLS via `TenantAwareDBClient`). - **Comprehensive Test Coverage**: Created a comprehensive test suite for `DBProvider`, covering its constructor, `query`, `healthCheck`, and `shutdown` methods, ensuri