@quadrokit/ui 0.3.11 → 0.3.13

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.
@@ -1,4 +1,5 @@
1
- import type { CollectionHandle, CollectionOptions } from '@quadrokit/client/runtime';
1
+ import type { CollectionHandle, CollectionOptions, QuadroErrorEvent, QuadroSuccessEvent } from '@quadrokit/client/runtime';
2
+ import { QuadroHttpErrorKind } from '../lib/quadro-http-error-kind.js';
2
3
  export type QuadroPagedCollectionFactory<T> = (options: CollectionOptions) => CollectionHandle<T>;
3
4
  export type UseQuadroPagedCollectionOptions<T> = {
4
5
  page: number;
@@ -11,6 +12,10 @@ export type UseQuadroPagedCollectionOptions<T> = {
11
12
  entitySetResetKey?: unknown;
12
13
  /** Pass `quadro.SomeClass.all` (or wrap it); use a cast at the call site if `select` is path-typed. */
13
14
  all: QuadroPagedCollectionFactory<T>;
15
+ /** Fires when the page of rows finished loading; `event.body` is the row slice. */
16
+ onSuccess?: (event: QuadroSuccessEvent) => void;
17
+ /** Fires when iteration fails; same shape as the client {@link QuadroErrorEvent}. */
18
+ onError?: (event: QuadroErrorEvent) => void;
14
19
  } & Omit<CollectionOptions, 'page' | 'pageSize' | 'maxItems' | 'signal' | 'reuseEntitySet' | 'onEntitySetReady'>;
15
20
  /**
16
21
  * Loads one page from a QuadroKit collection with 4D entity-set reuse (`$top=0` once, then
@@ -28,6 +33,14 @@ export declare function useQuadroPagedCollection<T>(options: UseQuadroPagedColle
28
33
  hasNext: boolean;
29
34
  loading: boolean;
30
35
  error: string | null;
36
+ /**
37
+ * When the failure is tied to an HTTP status (including list/collection errors), a stable
38
+ * semantic bucket (e.g. {@link QuadroHttpErrorKind.UNAUTHENTICATED} for 401).
39
+ * {@link QuadroHttpErrorKind.UNKNOWN} when there is no error or status could not be mapped.
40
+ */
41
+ errorKind: QuadroHttpErrorKind;
42
+ /** HTTP status code when known; `null` for non-HTTP errors. */
43
+ httpStatus: number | null;
31
44
  collection: CollectionHandle<T> | null;
32
45
  };
33
46
  //# sourceMappingURL=use-quadro-paged-collection.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-quadro-paged-collection.d.ts","sourceRoot":"","sources":["../../src/hooks/use-quadro-paged-collection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAGpF,MAAM,MAAM,4BAA4B,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,iBAAiB,KAAK,gBAAgB,CAAC,CAAC,CAAC,CAAA;AAEjG,MAAM,MAAM,+BAA+B,CAAC,CAAC,IAAI;IAC/C,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,uGAAuG;IACvG,GAAG,EAAE,4BAA4B,CAAC,CAAC,CAAC,CAAA;CACrC,GAAG,IAAI,CACN,iBAAiB,EACjB,MAAM,GAAG,UAAU,GAAG,UAAU,GAAG,QAAQ,GAAG,gBAAgB,GAAG,kBAAkB,CACpF,CAAA;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,CAAC,CAAC,EAAE,OAAO,EAAE,+BAA+B,CAAC,CAAC,CAAC,GAAG;IACxF,IAAI,EAAE,CAAC,EAAE,CAAA;IACT,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,UAAU,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG,IAAI,CAAA;CACvC,CAqFA"}
1
+ {"version":3,"file":"use-quadro-paged-collection.d.ts","sourceRoot":"","sources":["../../src/hooks/use-quadro-paged-collection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,2BAA2B,CAAA;AAElC,OAAO,EACL,mBAAmB,EAEpB,MAAM,kCAAkC,CAAA;AAMzC,MAAM,MAAM,4BAA4B,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,iBAAiB,KAAK,gBAAgB,CAAC,CAAC,CAAC,CAAA;AAEjG,MAAM,MAAM,+BAA+B,CAAC,CAAC,IAAI;IAC/C,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,uGAAuG;IACvG,GAAG,EAAE,4BAA4B,CAAC,CAAC,CAAC,CAAA;IACpC,mFAAmF;IACnF,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAA;IAC/C,qFAAqF;IACrF,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAA;CAC5C,GAAG,IAAI,CACN,iBAAiB,EACjB,MAAM,GAAG,UAAU,GAAG,UAAU,GAAG,QAAQ,GAAG,gBAAgB,GAAG,kBAAkB,CACpF,CAAA;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,CAAC,CAAC,EAAE,OAAO,EAAE,+BAA+B,CAAC,CAAC,CAAC,GAAG;IACxF,IAAI,EAAE,CAAC,EAAE,CAAA;IACT,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB;;;;OAIG;IACH,SAAS,EAAE,mBAAmB,CAAA;IAC9B,+DAA+D;IAC/D,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,UAAU,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG,IAAI,CAAA;CACvC,CA4HA"}
@@ -1,4 +1,8 @@
1
1
  import { useEffect, useRef, useState } from 'react';
2
+ import { QuadroHttpErrorKind, quadroErrorKindFromUnknown, } from '../lib/quadro-http-error-kind.mjs';
3
+ function newPagedLoadOperationId() {
4
+ return `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 11)}`;
5
+ }
2
6
  /**
3
7
  * Loads one page from a QuadroKit collection with 4D entity-set reuse (`$top=0` once, then
4
8
  * `__ENTITYSET` paging). Calls `release()` on unmount only.
@@ -11,12 +15,18 @@ import { useEffect, useRef, useState } from 'react';
11
15
  * effect cleans up (page / deps change or unmount).
12
16
  */
13
17
  export function useQuadroPagedCollection(options) {
14
- const { page, pageSize, entitySetResetKey, all, ...listOptions } = options;
18
+ const { page, pageSize, entitySetResetKey, all, onSuccess, onError, ...listOptions } = options;
15
19
  const resetKey = entitySetResetKey ?? pageSize;
20
+ const onSuccessRef = useRef(onSuccess);
21
+ const onErrorRef = useRef(onError);
22
+ onSuccessRef.current = onSuccess;
23
+ onErrorRef.current = onError;
16
24
  const [rows, setRows] = useState([]);
17
25
  const [hasNext, setHasNext] = useState(false);
18
26
  const [loading, setLoading] = useState(true);
19
27
  const [error, setError] = useState(null);
28
+ const [errorKind, setErrorKind] = useState(QuadroHttpErrorKind.UNKNOWN);
29
+ const [httpStatus, setHttpStatus] = useState(null);
20
30
  const [collection, setCollection] = useState(null);
21
31
  const entitySetPathRef = useRef(null);
22
32
  const releaseRef = useRef(null);
@@ -44,7 +54,11 @@ export function useQuadroPagedCollection(options) {
44
54
  const ac = new AbortController();
45
55
  setLoading(true);
46
56
  setError(null);
57
+ setErrorKind(QuadroHttpErrorKind.UNKNOWN);
58
+ setHttpStatus(null);
47
59
  void (async () => {
60
+ const loadStarted = Date.now();
61
+ const operationId = newPagedLoadOperationId();
48
62
  const { all: create, listOptions: lo } = optsRef.current;
49
63
  const col = create({
50
64
  ...lo,
@@ -71,13 +85,41 @@ export function useQuadroPagedCollection(options) {
71
85
  const slice = buffer.slice(0, pageSize);
72
86
  setRows(slice);
73
87
  setHasNext(slice.length === pageSize);
88
+ onSuccessRef.current?.({
89
+ type: 'success',
90
+ operationId,
91
+ context: {
92
+ operation: 'collection.list',
93
+ attributes: { page, pageSize },
94
+ },
95
+ path: '',
96
+ durationMs: Date.now() - loadStarted,
97
+ body: slice,
98
+ });
74
99
  }
75
100
  catch (e) {
76
101
  if (ac.signal.aborted)
77
102
  return;
78
- setError(e instanceof Error ? e.message : String(e));
103
+ const { kind, httpStatus: st } = quadroErrorKindFromUnknown(e);
104
+ setErrorKind(kind);
105
+ setHttpStatus(st);
106
+ const message = e instanceof Error ? e.message : String(e);
107
+ setError(message);
79
108
  setRows([]);
80
109
  setHasNext(false);
110
+ onErrorRef.current?.({
111
+ type: 'error',
112
+ operationId,
113
+ context: {
114
+ operation: 'collection.list',
115
+ attributes: { page, pageSize },
116
+ },
117
+ path: '',
118
+ durationMs: Date.now() - loadStarted,
119
+ message,
120
+ error: e,
121
+ status: st ?? undefined,
122
+ });
81
123
  }
82
124
  finally {
83
125
  if (!ac.signal.aborted)
@@ -89,5 +131,5 @@ export function useQuadroPagedCollection(options) {
89
131
  setCollection(null);
90
132
  };
91
133
  }, [page, pageSize, resetKey]);
92
- return { rows, hasNext, loading, error, collection };
134
+ return { rows, hasNext, loading, error, errorKind, httpStatus, collection };
93
135
  }
package/dist/index.d.ts CHANGED
@@ -6,7 +6,9 @@ export { ThemeToolbar } from './components/theme-toolbar.js';
6
6
  export type { UseDismissOnInteractOutsideOptions } from './hooks/use-dismiss-on-interact-outside.js';
7
7
  export { useDismissOnInteractOutside } from './hooks/use-dismiss-on-interact-outside.js';
8
8
  export type { QuadroPagedCollectionFactory, UseQuadroPagedCollectionOptions, } from './hooks/use-quadro-paged-collection.js';
9
+ export type { QuadroErrorEvent, QuadroSuccessEvent } from '@quadrokit/client/runtime';
9
10
  export { useQuadroPagedCollection } from './hooks/use-quadro-paged-collection.js';
11
+ export { QuadroHttpErrorKind, quadroErrorKindFromUnknown, quadroHttpStatusToErrorKind, } from './lib/quadro-http-error-kind.js';
10
12
  export { cn } from './lib/utils.js';
11
13
  export { type ColorMode, ThemeProvider, useTheme, } from './theme/theme-provider.js';
12
14
  export { type QuadroThemePreset, quadroThemes, themeLabels, } from './theme/themes.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACjE,OAAO,EACL,IAAI,EACJ,WAAW,EACX,eAAe,EACf,UAAU,EACV,SAAS,GACV,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,KAAK,EAAE,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAC9D,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAC5D,YAAY,EAAE,kCAAkC,EAAE,MAAM,4CAA4C,CAAA;AACpG,OAAO,EAAE,2BAA2B,EAAE,MAAM,4CAA4C,CAAA;AACxF,YAAY,EACV,4BAA4B,EAC5B,+BAA+B,GAChC,MAAM,wCAAwC,CAAA;AAC/C,OAAO,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAA;AACjF,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAA;AACnC,OAAO,EACL,KAAK,SAAS,EACd,aAAa,EACb,QAAQ,GACT,MAAM,2BAA2B,CAAA;AAClC,OAAO,EACL,KAAK,iBAAiB,EACtB,YAAY,EACZ,WAAW,GACZ,MAAM,mBAAmB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACjE,OAAO,EACL,IAAI,EACJ,WAAW,EACX,eAAe,EACf,UAAU,EACV,SAAS,GACV,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,KAAK,EAAE,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAC9D,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAC5D,YAAY,EAAE,kCAAkC,EAAE,MAAM,4CAA4C,CAAA;AACpG,OAAO,EAAE,2BAA2B,EAAE,MAAM,4CAA4C,CAAA;AACxF,YAAY,EACV,4BAA4B,EAC5B,+BAA+B,GAChC,MAAM,wCAAwC,CAAA;AAC/C,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AACrF,OAAO,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAA;AACjF,OAAO,EACL,mBAAmB,EACnB,0BAA0B,EAC1B,2BAA2B,GAC5B,MAAM,iCAAiC,CAAA;AACxC,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAA;AACnC,OAAO,EACL,KAAK,SAAS,EACd,aAAa,EACb,QAAQ,GACT,MAAM,2BAA2B,CAAA;AAClC,OAAO,EACL,KAAK,iBAAiB,EACtB,YAAY,EACZ,WAAW,GACZ,MAAM,mBAAmB,CAAA"}
package/dist/index.mjs CHANGED
@@ -5,6 +5,7 @@ export { Label } from './components/label.mjs';
5
5
  export { ThemeToolbar } from './components/theme-toolbar.mjs';
6
6
  export { useDismissOnInteractOutside } from './hooks/use-dismiss-on-interact-outside.mjs';
7
7
  export { useQuadroPagedCollection } from './hooks/use-quadro-paged-collection.mjs';
8
+ export { QuadroHttpErrorKind, quadroErrorKindFromUnknown, quadroHttpStatusToErrorKind, } from './lib/quadro-http-error-kind.mjs';
8
9
  export { cn } from './lib/utils.mjs';
9
10
  export { ThemeProvider, useTheme, } from './theme/theme-provider.mjs';
10
11
  export { quadroThemes, themeLabels, } from './theme/themes.mjs';
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Semantic category for HTTP failures from the Quadro REST client and collection layer.
3
+ * Use with {@link quadroHttpStatusToErrorKind} or {@link quadroErrorKindFromUnknown}.
4
+ */
5
+ export declare enum QuadroHttpErrorKind {
6
+ /** Status could not be determined, or error is not HTTP-related (e.g. network). */
7
+ UNKNOWN = "UNKNOWN",
8
+ BAD_REQUEST = "BAD_REQUEST",
9
+ /** 401 — missing or invalid authentication. */
10
+ UNAUTHENTICATED = "UNAUTHENTICATED",
11
+ /** 403 — authenticated but not permitted for this resource. */
12
+ FORBIDDEN = "FORBIDDEN",
13
+ NOT_FOUND = "NOT_FOUND",
14
+ METHOD_NOT_ALLOWED = "METHOD_NOT_ALLOWED",
15
+ CONFLICT = "CONFLICT",
16
+ UNPROCESSABLE_ENTITY = "UNPROCESSABLE_ENTITY",
17
+ TOO_MANY_REQUESTS = "TOO_MANY_REQUESTS",
18
+ INTERNAL_SERVER_ERROR = "INTERNAL_SERVER_ERROR",
19
+ BAD_GATEWAY = "BAD_GATEWAY",
20
+ SERVICE_UNAVAILABLE = "SERVICE_UNAVAILABLE",
21
+ GATEWAY_TIMEOUT = "GATEWAY_TIMEOUT"
22
+ }
23
+ export declare function quadroHttpStatusToErrorKind(status: number): QuadroHttpErrorKind;
24
+ /**
25
+ * Derive HTTP status and {@link QuadroHttpErrorKind} from a thrown value.
26
+ * Handles {@link QuadroHttpError} and plain `Error` messages from the collection runtime.
27
+ */
28
+ export declare function quadroErrorKindFromUnknown(error: unknown): {
29
+ kind: QuadroHttpErrorKind;
30
+ httpStatus: number | null;
31
+ };
32
+ //# sourceMappingURL=quadro-http-error-kind.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quadro-http-error-kind.d.ts","sourceRoot":"","sources":["../../src/lib/quadro-http-error-kind.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,oBAAY,mBAAmB;IAC7B,mFAAmF;IACnF,OAAO,YAAY;IACnB,WAAW,gBAAgB;IAC3B,+CAA+C;IAC/C,eAAe,oBAAoB;IACnC,+DAA+D;IAC/D,SAAS,cAAc;IACvB,SAAS,cAAc;IACvB,kBAAkB,uBAAuB;IACzC,QAAQ,aAAa;IACrB,oBAAoB,yBAAyB;IAC7C,iBAAiB,sBAAsB;IACvC,qBAAqB,0BAA0B;IAC/C,WAAW,gBAAgB;IAC3B,mBAAmB,wBAAwB;IAC3C,eAAe,oBAAoB;CACpC;AAED,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,MAAM,GAAG,mBAAmB,CAc/E;AAKD;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,OAAO,GAAG;IAC1D,IAAI,EAAE,mBAAmB,CAAA;IACzB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;CAC1B,CAoBA"}
@@ -0,0 +1,78 @@
1
+ import { QuadroHttpError } from '@quadrokit/client/runtime';
2
+ /**
3
+ * Semantic category for HTTP failures from the Quadro REST client and collection layer.
4
+ * Use with {@link quadroHttpStatusToErrorKind} or {@link quadroErrorKindFromUnknown}.
5
+ */
6
+ export var QuadroHttpErrorKind;
7
+ (function (QuadroHttpErrorKind) {
8
+ /** Status could not be determined, or error is not HTTP-related (e.g. network). */
9
+ QuadroHttpErrorKind["UNKNOWN"] = "UNKNOWN";
10
+ QuadroHttpErrorKind["BAD_REQUEST"] = "BAD_REQUEST";
11
+ /** 401 — missing or invalid authentication. */
12
+ QuadroHttpErrorKind["UNAUTHENTICATED"] = "UNAUTHENTICATED";
13
+ /** 403 — authenticated but not permitted for this resource. */
14
+ QuadroHttpErrorKind["FORBIDDEN"] = "FORBIDDEN";
15
+ QuadroHttpErrorKind["NOT_FOUND"] = "NOT_FOUND";
16
+ QuadroHttpErrorKind["METHOD_NOT_ALLOWED"] = "METHOD_NOT_ALLOWED";
17
+ QuadroHttpErrorKind["CONFLICT"] = "CONFLICT";
18
+ QuadroHttpErrorKind["UNPROCESSABLE_ENTITY"] = "UNPROCESSABLE_ENTITY";
19
+ QuadroHttpErrorKind["TOO_MANY_REQUESTS"] = "TOO_MANY_REQUESTS";
20
+ QuadroHttpErrorKind["INTERNAL_SERVER_ERROR"] = "INTERNAL_SERVER_ERROR";
21
+ QuadroHttpErrorKind["BAD_GATEWAY"] = "BAD_GATEWAY";
22
+ QuadroHttpErrorKind["SERVICE_UNAVAILABLE"] = "SERVICE_UNAVAILABLE";
23
+ QuadroHttpErrorKind["GATEWAY_TIMEOUT"] = "GATEWAY_TIMEOUT";
24
+ })(QuadroHttpErrorKind || (QuadroHttpErrorKind = {}));
25
+ export function quadroHttpStatusToErrorKind(status) {
26
+ if (status === 400)
27
+ return QuadroHttpErrorKind.BAD_REQUEST;
28
+ if (status === 401)
29
+ return QuadroHttpErrorKind.UNAUTHENTICATED;
30
+ if (status === 403)
31
+ return QuadroHttpErrorKind.FORBIDDEN;
32
+ if (status === 404)
33
+ return QuadroHttpErrorKind.NOT_FOUND;
34
+ if (status === 405)
35
+ return QuadroHttpErrorKind.METHOD_NOT_ALLOWED;
36
+ if (status === 409)
37
+ return QuadroHttpErrorKind.CONFLICT;
38
+ if (status === 422)
39
+ return QuadroHttpErrorKind.UNPROCESSABLE_ENTITY;
40
+ if (status === 429)
41
+ return QuadroHttpErrorKind.TOO_MANY_REQUESTS;
42
+ if (status === 500)
43
+ return QuadroHttpErrorKind.INTERNAL_SERVER_ERROR;
44
+ if (status === 502)
45
+ return QuadroHttpErrorKind.BAD_GATEWAY;
46
+ if (status === 503)
47
+ return QuadroHttpErrorKind.SERVICE_UNAVAILABLE;
48
+ if (status === 504)
49
+ return QuadroHttpErrorKind.GATEWAY_TIMEOUT;
50
+ return QuadroHttpErrorKind.UNKNOWN;
51
+ }
52
+ const ENTITY_SET_FAILED = /Entity set creation failed (\d+):/;
53
+ const LIST_FAILED = /List failed (\d+):/;
54
+ /**
55
+ * Derive HTTP status and {@link QuadroHttpErrorKind} from a thrown value.
56
+ * Handles {@link QuadroHttpError} and plain `Error` messages from the collection runtime.
57
+ */
58
+ export function quadroErrorKindFromUnknown(error) {
59
+ if (error instanceof QuadroHttpError) {
60
+ return {
61
+ httpStatus: error.status,
62
+ kind: quadroHttpStatusToErrorKind(error.status),
63
+ };
64
+ }
65
+ if (error instanceof Error) {
66
+ const m1 = ENTITY_SET_FAILED.exec(error.message);
67
+ if (m1) {
68
+ const status = Number(m1[1]);
69
+ return { httpStatus: status, kind: quadroHttpStatusToErrorKind(status) };
70
+ }
71
+ const m2 = LIST_FAILED.exec(error.message);
72
+ if (m2) {
73
+ const status = Number(m2[1]);
74
+ return { httpStatus: status, kind: quadroHttpStatusToErrorKind(status) };
75
+ }
76
+ }
77
+ return { kind: QuadroHttpErrorKind.UNKNOWN, httpStatus: null };
78
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quadrokit/ui",
3
- "version": "0.3.11",
3
+ "version": "0.3.13",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.mjs",
@@ -34,7 +34,7 @@
34
34
  "tailwind-merge": "^3.5.0"
35
35
  },
36
36
  "peerDependencies": {
37
- "@quadrokit/client": "^0.3.11",
37
+ "@quadrokit/client": "^0.3.13",
38
38
  "react": "^18 || ^19",
39
39
  "react-dom": "^18 || ^19"
40
40
  },