@iyulab/flex-table 0.42.0 → 0.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/README.md +1 -1
- package/dist/odata/types.d.ts +4 -1
- package/dist/react.js +1 -1
- package/package.json +1 -1
- package/skills/iyulab-flex-table/references/react.md +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.43.0] - 2026-10-04
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- **Breaking: `useODataSource`'s `onUnauthorized` is called on `401` only.** It was also called on
|
|
8
|
+
`403`, so an app that sends the user to sign in from this hook (its documented use) bounced a
|
|
9
|
+
signed-in user without permission back to the sign-in page — and, after signing in, to the same
|
|
10
|
+
list and the same `403`. A `403` now surfaces only as `error`, like any other failed request.
|
|
11
|
+
Migration: if you handled `403` in `onUnauthorized`, read it from `error` instead.
|
|
12
|
+
|
|
3
13
|
## [0.42.0] - 2026-10-04
|
|
4
14
|
|
|
5
15
|
### Added
|
package/README.md
CHANGED
|
@@ -725,7 +725,7 @@ const source = useODataSource('/api/orders', {
|
|
|
725
725
|
| `fixedFilter` | — | Filter always applied in addition to search. Changing it resets the page to 0 — see below |
|
|
726
726
|
| `baseUrl` | `window.location.origin` | Override the request origin (proxy/BFF setups) |
|
|
727
727
|
| `fetcher` | global `fetch` | Custom transport — pass a wrapper that injects auth headers |
|
|
728
|
-
| `onUnauthorized` | — | Called on `401
|
|
728
|
+
| `onUnauthorized` | — | Called on `401` responses, before the generic error is set. A `403` (signed in, not permitted) does not call it — it surfaces as `error` |
|
|
729
729
|
| `enabled` | `true` | While `false`, no request is made and `loading` stays `true` — see below |
|
|
730
730
|
|
|
731
731
|
`fetcher`/`onUnauthorized` should be stable references (e.g. wrap in `useCallback`) — they are intentionally excluded from the hook's internal effect dependencies to avoid refetch loops on every render.
|
package/dist/odata/types.d.ts
CHANGED
|
@@ -23,7 +23,10 @@ export interface UseODataSourceOptions {
|
|
|
23
23
|
baseUrl?: string;
|
|
24
24
|
/** 커스텀 fetch transport(예: 인증 헤더를 주입하는 `HttpClient` 래퍼). 기본값: 전역 `fetch`. */
|
|
25
25
|
fetcher?: (input: string, init: RequestInit) => Promise<Response>;
|
|
26
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* 응답이 401 일 때 호출(세션 만료 리다이렉트 등). 호출 후에도 기존 에러 처리는 계속 진행된다.
|
|
28
|
+
* 403(인증됐지만 권한 없음)에는 부르지 않는다 — 그 실패는 `error` 로 드러난다.
|
|
29
|
+
*/
|
|
27
30
|
onUnauthorized?: (response: Response) => void;
|
|
28
31
|
/**
|
|
29
32
|
* `false` 인 동안 요청하지 않는다. 기본값 `true`.
|
package/dist/react.js
CHANGED
|
@@ -34,7 +34,7 @@ function d(e, r = {}) {
|
|
|
34
34
|
}), a = `${m ?? window.location.origin}${e}${r}`, o = async (e) => {
|
|
35
35
|
let n = await h(e, { signal: t.signal });
|
|
36
36
|
if (!n.ok) {
|
|
37
|
-
|
|
37
|
+
n.status === 401 && g && g(n);
|
|
38
38
|
let e = await n.text().catch(() => ""), t = `Request failed (${n.status})`;
|
|
39
39
|
try {
|
|
40
40
|
let n = JSON.parse(e);
|
package/package.json
CHANGED
|
@@ -102,7 +102,7 @@ function Orders() {
|
|
|
102
102
|
| `fixedFilter` | — | odata-query filter object, always applied; value change resets to page 0 (compared by value) |
|
|
103
103
|
| `baseUrl` | `window.location.origin` | For proxy/BFF setups |
|
|
104
104
|
| `fetcher` | global `fetch` | `(input, init) => Promise<Response>`; keep stable |
|
|
105
|
-
| `onUnauthorized` | — | `(response) => void` on 401
|
|
105
|
+
| `onUnauthorized` | — | `(response) => void` on 401 only (403 surfaces as `error`); keep stable |
|
|
106
106
|
| `enabled` | `true` | While `false`: no request, `loading` stays `true`, `refresh()` is a no-op, in-flight request is cancelled |
|
|
107
107
|
|
|
108
108
|
### Result
|