@accounter/client 0.0.8-alpha-20251023071611-4357687c6963ad74c80f62140eb0de9252d7bca7 → 0.0.8-alpha-20251023122652-765c7f951395441461726b3b4345eebd020632d7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/dist/assets/{Checkbox-iZ--iyJF.js → Checkbox-CpANMiXr.js} +1 -1
  3. package/dist/assets/{Progress-CSjfE5bV.js → Progress-BEKiyNRK.js} +1 -1
  4. package/dist/assets/{Typography-D14P1nN1.js → Typography-C0c5augK.js} +1 -1
  5. package/dist/assets/{accordion-CcwG2M8I.js → accordion-ZFVTCyDy.js} +1 -1
  6. package/dist/assets/{accountant-approvals-3mWk2IJb.js → accountant-approvals-CpzuSBgK.js} +1 -1
  7. package/dist/assets/{all-charges-kAC8rw9C.js → all-charges-BTyaAlp7.js} +1 -1
  8. package/dist/assets/{arrow-up-down-BS_znu7y.js → arrow-up-down-PQdrJdei.js} +1 -1
  9. package/dist/assets/{business-Cv0e_Q3p.js → business-DiQFqEHI.js} +1 -1
  10. package/dist/assets/{business-transactions-single-B23INPyA.js → business-transactions-single-DJqvqlMO.js} +1 -1
  11. package/dist/assets/{business-trip-c4pY18e_.js → business-trip-BXAjI1mO.js} +1 -1
  12. package/dist/assets/{charges-filters-DaVBQ_jS.js → charges-filters-r7FjeZLc.js} +1 -1
  13. package/dist/assets/{charges-ledger-validation-DZtDlOTx.js → charges-ledger-validation-CFc_zJFO.js} +1 -1
  14. package/dist/assets/{chart-BgPuhGqj.js → chart-C5LuxRSv.js} +1 -1
  15. package/dist/assets/{data-table-pagination-P75qqcV4.js → data-table-pagination-g2cF8_uB.js} +1 -1
  16. package/dist/assets/{editable-business-trip-80Bf0nf4.js → editable-business-trip-DyQsUJjl.js} +1 -1
  17. package/dist/assets/{index-ASrM5c3z.js → index-2g0J28D2.js} +1 -1
  18. package/dist/assets/{index-BIiK-vW-.js → index-6-J73JPC.js} +1 -1
  19. package/dist/assets/{index-CmRugx3-.js → index-B5j8Fmt8.js} +1 -1
  20. package/dist/assets/{index-D-K_l8g8.js → index-BSBV6pv2.js} +1 -1
  21. package/dist/assets/{index-1yUzw9-e.js → index-BSg8ocop.js} +1 -1
  22. package/dist/assets/{index-BopVOgtm.js → index-Bpef3vuz.js} +1 -1
  23. package/dist/assets/{index-CNBPVFd1.js → index-BziuNiXZ.js} +1 -1
  24. package/dist/assets/{index-DfYVR_1G.js → index-C0OGGVXE.js} +1 -1
  25. package/dist/assets/{index-Cca4zCek.js → index-C7KKktQ5.js} +1 -1
  26. package/dist/assets/{index-Ucx6U5YY.js → index-C99l-a0m.js} +1 -1
  27. package/dist/assets/{index-DmBjrSud.js → index-CE3kLG2a.js} +1 -1
  28. package/dist/assets/{index-D3y74IdY.js → index-CJdrnxxy.js} +1 -1
  29. package/dist/assets/{index-iLt1WIM9.js → index-CN2818Wt.js} +167 -167
  30. package/dist/assets/{index-Bt1Iynf-.js → index-CjDRKTTf.js} +1 -1
  31. package/dist/assets/{index-Buu6jU2e.js → index-D2xdQJAx.js} +1 -1
  32. package/dist/assets/{index-BtF8NkXw.js → index-DGvh10a7.js} +1 -1
  33. package/dist/assets/{index-BUJZ6CG6.js → index-DLI6Z9VU.js} +1 -1
  34. package/dist/assets/{index-DWdQvLZN.js → index-DXL1qPt9.js} +1 -1
  35. package/dist/assets/{index-DUDlwA28.js → index-Is4LJW4y.js} +1 -1
  36. package/dist/assets/{index-D7rFUnXc.js → index-S6eSocQH.js} +1 -1
  37. package/dist/assets/{index-CgVLV78R.js → index-T-JiUNDA.js} +1 -1
  38. package/dist/assets/{index-D0eVaZI5.js → index-gBZ-7Z07.js} +1 -1
  39. package/dist/assets/{index-BwJkbwi9.js → index-o_W5PWRq.js} +1 -1
  40. package/dist/assets/{index.es-VMf2fRct.js → index.es-DZgQ4YcV.js} +1 -1
  41. package/dist/assets/{issue-document-BustWthK.js → issue-document-D-JoFiMZ.js} +1 -1
  42. package/dist/assets/{login-page-DbBOFdaj.js → login-page-DsHy5amR.js} +1 -1
  43. package/dist/assets/{missing-info-charges-sf4ZGQoC.js → missing-info-charges-CPnjfjfW.js} +1 -1
  44. package/dist/assets/page-not-found-CYmXF0n2.js +1 -0
  45. package/dist/assets/{pencil-1-tPx_Bq.js → pencil-BUwX_eHK.js} +1 -1
  46. package/dist/assets/{report-commentary-row-BqTwvfOv.js → report-commentary-row-Bpvvtwpd.js} +1 -1
  47. package/dist/assets/{save-CMGkGXCM.js → save-Ck68rh6u.js} +1 -1
  48. package/dist/assets/{similar-charges-by-business-modal-Dj7iCQhJ.js → similar-charges-by-business-modal-bUtiFfAw.js} +1 -1
  49. package/dist/assets/{sub-3l-gAINS.js → sub-C2zifPY5.js} +1 -1
  50. package/dist/assets/subMonths-uUfFviD2.js +1 -0
  51. package/dist/index.html +1 -1
  52. package/package.json +1 -1
  53. package/src/providers/urql-client.ts +2 -29
  54. package/src/providers/urql-error-handler.ts +27 -0
  55. package/src/providers/urql.tsx +2 -29
  56. package/dist/assets/page-not-found-CzE13z4R.js +0 -1
  57. package/dist/assets/subMonths-LVothVpu.js +0 -1
@@ -1 +1 @@
1
- import{fu as d,fv as y}from"./index-iLt1WIM9.js";import{s as S}from"./subMonths-LVothVpu.js";function T(s,t,o){return d(s,-t,o)}function M(s,t,o){const{years:n=0,months:u=0,weeks:c=0,days:r=0,hours:e=0,minutes:a=0,seconds:m=0}=t,b=S(s,u+n*12,o),i=T(b,r+c*7,o),f=a+e*60,h=(m+f*60)*1e3;return y(s,+i-h)}export{M as s};
1
+ import{fu as d,fv as y}from"./index-CN2818Wt.js";import{s as S}from"./subMonths-uUfFviD2.js";function T(s,t,o){return d(s,-t,o)}function M(s,t,o){const{years:n=0,months:u=0,weeks:c=0,days:r=0,hours:e=0,minutes:a=0,seconds:m=0}=t,b=S(s,u+n*12,o),i=T(b,r+c*7,o),f=a+e*60,h=(m+f*60)*1e3;return y(s,+i-h)}export{M as s};
@@ -0,0 +1 @@
1
+ import{fw as n}from"./index-CN2818Wt.js";function a(o,s,t){return n(o,-s,t)}export{a as s};
package/dist/index.html CHANGED
@@ -5,7 +5,7 @@
5
5
  <link rel="icon" href="/icons/accounter-logo.svg" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>Accounter</title>
8
- <script type="module" crossorigin src="/assets/index-iLt1WIM9.js"></script>
8
+ <script type="module" crossorigin src="/assets/index-CN2818Wt.js"></script>
9
9
  <link rel="stylesheet" crossorigin href="/assets/index-CzzfC-dD.css">
10
10
  </head>
11
11
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@accounter/client",
3
- "version": "0.0.8-alpha-20251023071611-4357687c6963ad74c80f62140eb0de9252d7bca7",
3
+ "version": "0.0.8-alpha-20251023122652-765c7f951395441461726b3b4345eebd020632d7",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "scripts": {
@@ -1,4 +1,3 @@
1
- import { toast } from 'sonner';
2
1
  import {
3
2
  createClient,
4
3
  fetchExchange,
@@ -9,6 +8,7 @@ import {
9
8
  } from 'urql';
10
9
  import { authExchange } from '@urql/exchange-auth';
11
10
  import { UserService } from '../services/user-service.js';
11
+ import { handleUrqlError } from './urql-error-handler.js';
12
12
 
13
13
  /**
14
14
  * Singleton URQL client for use in loaders and server-side operations
@@ -44,34 +44,7 @@ export function getUrqlClient(): Client {
44
44
  exchanges: [
45
45
  mapExchange({
46
46
  onResult(result) {
47
- // Handle network errors
48
- if (result.error?.networkError) {
49
- console.error('Network Error:', result.error.networkError);
50
- toast.error('Network Error', {
51
- description: 'Failed to connect to the server. Please check your connection.',
52
- duration: 5000,
53
- });
54
- return;
55
- }
56
-
57
- // Handle common GraphQL errors with toast notifications
58
- if (result.error?.graphQLErrors?.length) {
59
- const graphqlError = result.error.graphQLErrors[0];
60
- const { message } = graphqlError;
61
- const code = graphqlError.extensions?.code as string | undefined;
62
-
63
- // Skip auth errors (handled by authExchange)
64
- if (code === 'FORBIDDEN') {
65
- return;
66
- }
67
-
68
- // Show toast for common GraphQL errors
69
- console.error('GraphQL Error:', graphqlError);
70
- toast.error('Operation Error', {
71
- description: message || 'An error occurred while processing your request.',
72
- duration: 5000,
73
- });
74
- }
47
+ handleUrqlError(result);
75
48
  },
76
49
  }),
77
50
  authExchange(async utils => {
@@ -0,0 +1,27 @@
1
+ import { toast } from 'sonner';
2
+ import type { OperationResult } from 'urql';
3
+
4
+ export function handleUrqlError(result: OperationResult) {
5
+ // Handle network errors
6
+ if (result.error?.networkError) {
7
+ console.error('Network Error:', result.error.networkError);
8
+ toast.error('Network Error', {
9
+ description: 'Failed to connect to the server. Please check your connection.',
10
+ duration: 5000,
11
+ });
12
+ return;
13
+ }
14
+
15
+ // Handle common GraphQL errors with toast notifications
16
+ if (result.error?.graphQLErrors?.length) {
17
+ const graphqlError = result.error.graphQLErrors[0];
18
+ const { message } = graphqlError;
19
+
20
+ // Show toast for common GraphQL errors
21
+ console.error('GraphQL Error:', graphqlError);
22
+ toast.error('Operation Error', {
23
+ description: message || 'An error occurred while processing your request.',
24
+ duration: 5000,
25
+ });
26
+ }
27
+ }
@@ -1,6 +1,5 @@
1
1
  import { useContext, useEffect, useMemo, type ReactNode } from 'react';
2
2
  import { Navigate, useNavigate } from 'react-router-dom';
3
- import { toast } from 'sonner';
4
3
  import {
5
4
  createClient,
6
5
  fetchExchange,
@@ -12,6 +11,7 @@ import {
12
11
  import { authExchange } from '@urql/exchange-auth';
13
12
  import { ROUTES } from '../router/routes.js';
14
13
  import { AuthContext } from './auth-guard.js';
14
+ import { handleUrqlError } from './urql-error-handler.js';
15
15
 
16
16
  export function UrqlProvider({ children }: { children?: ReactNode }): ReactNode {
17
17
  const { authService } = useContext(AuthContext);
@@ -59,34 +59,7 @@ export function UrqlProvider({ children }: { children?: ReactNode }): ReactNode
59
59
  return;
60
60
  }
61
61
 
62
- // Handle network errors
63
- if (result.error?.networkError) {
64
- console.error('Network Error:', result.error.networkError);
65
- toast.error('Network Error', {
66
- description: 'Failed to connect to the server. Please check your connection.',
67
- duration: 5000,
68
- });
69
- return;
70
- }
71
-
72
- // Handle common GraphQL errors with toast notifications
73
- if (result.error?.graphQLErrors?.length) {
74
- const graphqlError = result.error.graphQLErrors[0];
75
- const { message } = graphqlError;
76
- const code = graphqlError.extensions?.code as string | undefined;
77
-
78
- // Skip auth errors (already handled above)
79
- if (code === 'FORBIDDEN') {
80
- return;
81
- }
82
-
83
- // Show toast for common GraphQL errors
84
- console.error('GraphQL Error:', graphqlError);
85
- toast.error('Operation Error', {
86
- description: message || 'An error occurred while processing your request.',
87
- duration: 5000,
88
- });
89
- }
62
+ handleUrqlError(result);
90
63
  },
91
64
  }),
92
65
  authExchange(async utils => {
@@ -1 +0,0 @@
1
- import{j as a,$ as s,a0 as e,a1 as r,a3 as d}from"./index-iLt1WIM9.js";const o=()=>a.jsxs(s,{className:"m-5",children:[a.jsx(e,{children:a.jsx(r,{children:"404"})}),a.jsx(d,{children:a.jsx("p",{children:"Page not found"})})]});export{o as PageNotFound};
@@ -1 +0,0 @@
1
- import{fw as n}from"./index-iLt1WIM9.js";function a(o,s,t){return n(o,-s,t)}export{a as s};