@iyulab/enterprise 0.14.0 โ 0.16.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 +64 -0
- package/README.md +40 -0
- package/dist/index.d.ts +660 -11
- package/dist/index.js +45 -42
- package/dist/styles/preset.css +21 -4
- package/package.json +3 -2
- package/dist/ApiConfig.d.ts +0 -71
- package/dist/FormRow.d.ts +0 -33
- package/dist/FormSection.d.ts +0 -26
- package/dist/auth/AuthClient.d.ts +0 -46
- package/dist/auth/permissions.d.ts +0 -43
- package/dist/data/ODataService.d.ts +0 -136
- package/dist/helpers/CurrencyHelper.d.ts +0 -33
- package/dist/helpers/DateHelper.d.ts +0 -61
- package/dist/helpers/ProgressHelper.d.ts +0 -48
- package/dist/helpers/UrgencyHelper.d.ts +0 -62
- package/dist/helpers/constants.d.ts +0 -6
- package/dist/helpers/index.d.ts +0 -10
- package/dist/helpers/messages.d.ts +0 -26
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,69 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.16.0] - 2026-09-22
|
|
4
|
+
|
|
5
|
+
### Documentation
|
|
6
|
+
|
|
7
|
+
- ๐ด **`styles/preset.css` now says why its documented usage used to do nothing.** The header's
|
|
8
|
+
third clause said layer order is decided by load order and is therefore already under the
|
|
9
|
+
consumer's control. It was not: the defaults layer is injected at runtime by
|
|
10
|
+
`@iyulab/components`' `Theme.init()`, so until that package's **1.44.0** it landed *after* a
|
|
11
|
+
statically imported sheet and won. The one-line `import` this file documents had **no effect at
|
|
12
|
+
all**, silently โ and because the two sheets agree on `body`/`label`/`caption`/`overline` and
|
|
13
|
+
differ only on the upper type steps and the radii, it still looked applied. The clause now
|
|
14
|
+
states that, names the version where the documented usage starts working, and says what to do
|
|
15
|
+
on an older one.
|
|
16
|
+
- **`docs/lob-layers.md` carried the same third clause, and the same false statement with it.**
|
|
17
|
+
A rule that lives in two published documents goes stale in two places; that one now names the
|
|
18
|
+
premise this package cannot hold on its own -- load order is decided by whoever injects the
|
|
19
|
+
defaults layer -- and says which version makes the documented arrangement true.
|
|
20
|
+
- **The header also called the `@iyulab/components` peer optional. It is not** โ this package's
|
|
21
|
+
runtime code imports `Locale`, `format` and `icons` from it, so it is required whether or not
|
|
22
|
+
you load the preset. The prose was the wrong half of that mismatch and has been corrected.
|
|
23
|
+
|
|
24
|
+
### Changed
|
|
25
|
+
|
|
26
|
+
- ๐ด **The `@iyulab/components` peer range is now `>=1.44.0`** (was `>=1.27.0`). Every version
|
|
27
|
+
below that places the defaults layer last, which is exactly the arrangement in which this
|
|
28
|
+
package's documented preset usage is silently void. A range that admits those versions lets a
|
|
29
|
+
consumer install a combination where the preset does nothing and nothing says so โ declaring
|
|
30
|
+
the floor is what turns that from a silent failure into an install-time answer.
|
|
31
|
+
|
|
32
|
+
โ **This is the only reason for the minor.** No API changed.
|
|
33
|
+
|
|
34
|
+
## [0.15.0] - 2026-09-22
|
|
35
|
+
|
|
36
|
+
### Fixed
|
|
37
|
+
|
|
38
|
+
- **`fetchRaw` now matches its own declaration.** It was documented as returning the raw
|
|
39
|
+
response, but the implementation ran every response through `throwIfError` and threw on any
|
|
40
|
+
non-2xx โ and it invoked the session hook while doing so. A connection probe that only asks
|
|
41
|
+
"did a response arrive at all" therefore counted a `401` as *unreachable*, when the server was
|
|
42
|
+
in fact alive and refusing, so every signed-out user saw a permanent "cannot reach the server".
|
|
43
|
+
The declaration was the right one, so the implementation changed to match it: `fetchRaw` returns
|
|
44
|
+
the response as-is and calls no session hook.
|
|
45
|
+
โ **If you relied on the throw**, check `res.ok` yourself, or call `apiGet` when you want the
|
|
46
|
+
error policy applied. Nothing else in the service changed its throwing behavior.
|
|
47
|
+
|
|
48
|
+
### Added
|
|
49
|
+
|
|
50
|
+
- **Per-call control over the `401` hook.** `onUnauthorized` was all-or-nothing for the whole
|
|
51
|
+
service, but a sign-in call is the one place where `401` means "wrong credentials" rather than
|
|
52
|
+
"your session expired" โ so a failed sign-in fired the global hook and threw a message about an
|
|
53
|
+
expired session, leaving the screen to invent a reason for a failure it had been told the wrong
|
|
54
|
+
cause of. Every request method now takes an optional trailing `ODataRequestOptions`; passing
|
|
55
|
+
`{ onUnauthorized: false }` keeps that call out of the global hook and throws with the message
|
|
56
|
+
the server actually sent. Omitting it changes nothing.
|
|
57
|
+
- The option is accepted by **all** request methods, not only the ones with a use for it today.
|
|
58
|
+
The failure being fixed is precisely that a single method had no way to express this, and drawing
|
|
59
|
+
the line again one method further along would reproduce it.
|
|
60
|
+
|
|
61
|
+
### Notes
|
|
62
|
+
|
|
63
|
+
- **No `authenticate()` primitive was added**, though one was proposed. That name would have to
|
|
64
|
+
assume an endpoint path, a request body shape and a token convention โ none of which this
|
|
65
|
+
library owns โ so it would encode one caller's server into a general client.
|
|
66
|
+
|
|
3
67
|
## [0.14.0] - 2026-09-20
|
|
4
68
|
|
|
5
69
|
### Fixed
|
package/README.md
CHANGED
|
@@ -107,6 +107,14 @@ await svc.apiPut<Order>('orders/7', { name: 'A (revised)' }) // ๋ฆฌ์์ค ์
|
|
|
107
107
|
await svc.apiPatch<Order>('orders/7', { note: 'urgent' })
|
|
108
108
|
await svc.apiDelete('orders/7') // 204 ์์
|
|
109
109
|
|
|
110
|
+
// ๋ก๊ทธ์ธ โ 401 ์ด ใ์ธ์
๋ง๋ฃใ๊ฐ ์๋๋ผ ใ์๊ฒฉ ์ฆ๋ช
ํ๋ฆผใ์ธ ์ ์ผํ ํธ์ถ์ด๋ค.
|
|
111
|
+
// ์ ์ญ onUnauthorized ๋ฅผ ์ด ํธ์ถ์์๋ง ๋๋ฉด, ์๋ฒ๊ฐ ์ค ์ฌ์ ๊ฐ ๊ทธ๋๋ก ApiError.message ๋ก ์จ๋ค.
|
|
112
|
+
await svc.apiPost('auth/login', creds, { onUnauthorized: false })
|
|
113
|
+
|
|
114
|
+
// ์ฐ๊ฒฐ ํ๋ก๋ธ โ ใ์๋ต์ด ์๋๊ฐใ๋ง ๋ฌป๋๋ค. fetchRaw ๋ ๋์ง์ง๋, 401 ํ
์ ๋ถ๋ฅด์ง๋ ์๋๋ค.
|
|
115
|
+
const probe = await svc.fetchRaw(svc.apiUrl('ping'))
|
|
116
|
+
const reachable = true // ์ฌ๊ธฐ ๋ฟ์๋ค๋ ๊ฒ ์์ฒด๊ฐ ๋ต์ด๋ค(probe.status ๋ ๋ณผ ํ์ ์๋ค)
|
|
117
|
+
|
|
110
118
|
// body๊ฐ FormData ์ธ์คํด์ค๋ฉด ๊ทธ๋๋ก(์ง๋ ฌํ ์์ด) ๋ฉํฐํํธ๋ก ์ ์ก๋๋ค โ
|
|
111
119
|
// Content-Type์ ๋ธ๋ผ์ฐ์ ๊ฐ boundary์ ํจ๊ป ์๋ ์ค์ ํ๋ค. apiPost/apiPut/apiPatch ์ ๋ถ ๋์ผ.
|
|
112
120
|
const form = new FormData()
|
|
@@ -144,6 +152,38 @@ await svc.apiPost<Order>('orders/7/attachments', form)
|
|
|
144
152
|
- **์ด๋ฏธ ์๊ธฐ ๋ํผ๋ก ํต์งํ๊ณ ์๋ค๋ฉด `*Quiet` ๋ก ๋ฐ๊พผ๋ค.** ์ด์ค ํ ์คํธ๋ฅผ ๋ง๋ ํ์ถ๊ตฌ์ด๊ณ ,
|
|
145
153
|
`odata*Quiet` ์ ๊ฐ์ ๊ด์ฉ๊ตฌ๋ค(ํ ์ฌ์ฉ์ ์ก์
์ด ์ฌ๋ฌ ์์ฒญ์ ๋ผ ๋๋ ๊ฐ์ ๊ฒ์ ์ด๋ค).
|
|
146
154
|
|
|
155
|
+
#### 401 ์ถ โ ์ ์ญ ์ ์ฑ
๊ณผ ๊ทธ ํธ์ถ ๋จ์ ์์ธ
|
|
156
|
+
|
|
157
|
+
`onUnauthorized` ๋ **์๋น์ค ์ ์ญ ์ ์ฑ
**์ด๋ค: 401 ์ด ์ค๋ฉด ํ
์ ๋ถ๋ฅด๊ณ `messages.sessionExpired`
|
|
158
|
+
๋ก ๋จ๋ฝํ๋ค. ์ด ๊ธฐ๋ณธ๊ฐ์ ๊ฑฐ์ ํญ์ ์ณ์ง๋ง **๋ ์๋ฆฌ์์ ํ๋ฆฐ๋ค.**
|
|
159
|
+
|
|
160
|
+
| ์๋ฆฌ | ์ ํ๋ฆฌ๋๊ฐ | ํด๋ฒ |
|
|
161
|
+
|---|---|---|
|
|
162
|
+
| **๋ก๊ทธ์ธ ์์ฒด** | 401 ์ด ใ์ธ์
์ด ๋๊ฒผ๋คใ๊ฐ ์๋๋ผ ใ์๊ฒฉ ์ฆ๋ช
์ด ํ๋ ธ๋คใ๋ฅผ ๋ปํ๋ค. ์ ์ญ ํ
์ด ๋ฐํํ๋ฉด ๋ก๊ทธ์ธ ํ๋ฉด์์ ๋ก๊ทธ์ธ ํ๋ฉด์ผ๋ก ๋ฆฌ๋ค์ด๋ ํธ๋๊ณ , ๋์ ธ์ง๋ ๋ฉ์์ง๊ฐ `sessionExpired` ๋ผ ํ๋ฉด์ด ์คํจ ์ฌ์ ๋ฅผ **์ง์ด๋ด์ผ** ํ๋ค | `{ onUnauthorized: false }` |
|
|
163
|
+
| **์ฐ๊ฒฐ ํ๋ก๋ธ** | *ใ์๋ต์ด ์๋๊ฐใ* ๋ง ๋ฌป๋ ํธ์ถ์ด๋ผ, 401 ์ **์๋ฒ๊ฐ ์ด์์ ๊ฑฐ์ ํ ๊ฒ** = ใ๋ฟ์๋คใ๋ค. ํ
+์์ธ๋ฅผ ํ๋ฉด ๋ก๊ทธ์ธํ์ง ์์ ์ฌ์ฉ์์๊ฒ ๋ ใ์๋ฒ์ ์ฐ๊ฒฐํ ์ ์์ต๋๋คใ๊ฐ ๋ฌ๋ค | `fetchRaw` |
|
|
164
|
+
|
|
165
|
+
```ts
|
|
166
|
+
// 401 ์ ยซ๊ทธ ํธ์ถ์ ๊ฒฐ๊ณผยป ๋ก ๋ฐ๋๋ค โ ํ
์์, ๋ฉ์์ง ๋ฎ์ด์ฐ๊ธฐ ์์.
|
|
167
|
+
await svc.apiPost('auth/login', creds, { onUnauthorized: false })
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
- **๋ชจ๋ ์์ฒญ ๋ฉ์๋๊ฐ ์ด ์ต์
์ ๋ฐ๋๋ค**(๋ง์ง๋ง ์ ํ ์ธ์). ๋ถ๋ถ์งํฉ์ผ๋ก ๋๋ฉด ๋ค์ ์๋น์๊ฐ
|
|
171
|
+
๋ค๋ฅธ ๋ฉ์๋์์ ๊ฐ์ ๋ฒฝ์ ๋ง๋๋ค.
|
|
172
|
+
- **๋๋ ์ถ๋ง ์๋ค.** ์ ๋์์ ์ผ๋ ์ค์์น๊ฐ ์๋๋ผ ์ ์ญ ์ ์ฑ
์ ํ์ถ๊ตฌ์ด๋ฏ๋ก, ์ต์
์ ์๋ตํ
|
|
173
|
+
ํธ์ถ์ ์ด ์ต์
์ด ์๊ธฐ๊ธฐ ์ ๊ณผ **ํ ๊ธ์๋ ๋ค๋ฅด๊ฒ ๋์ํ์ง ์๋๋ค.**
|
|
174
|
+
- **`authenticate()` ๊ฐ์ ์ด๋ฆ ์๋ ํ๋ฆฌ๋ฏธํฐ๋ธ๋ ๋์ง ์๋๋ค** โ ๊ทธ๊ฒ์ ์๋ํฌ์ธํธ ๊ฒฝ๋กยท๋ฐ๋
|
|
175
|
+
๋ชจ์ยทํ ํฐ ์ฒ๋ฆฌ ๊ท์ฝ์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๊ฐ ์๋ค๊ณ ๊ฐ์ ํ๋ **๋๋ฉ์ธ ์ด๋ฆ**์ด๋ค. ๊ทธ ๊ท์ฝ์ ์ฑ๋ง๋ค
|
|
176
|
+
๋ค๋ฅด๋ฏ๋ก adapter ์ ๋จ๊ธฐ๊ณ , ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ ๋ฒ์ฉ ์ถ๋ง ์ฐ๋ค.
|
|
177
|
+
|
|
178
|
+
#### `fetchRaw` โ ใrawใ ๋ ์ ์ฑ
์ ํ์ฐ์ง ์๋๋ค๋ ๋ป์ด๋ค
|
|
179
|
+
|
|
180
|
+
์๋ต์ **๊ทธ๋๋ก** ๋๋ ค์ค๋ค. **๋น-2xx ์๋ ๋์ง์ง ์๊ณ `onUnauthorized` ๋ ๋ถ๋ฅด์ง ์๋๋ค** โ
|
|
181
|
+
์ํ ํ๋จ์ ํธ์ถ๋ถ์ ๋ชซ์ด๋ค. ์ํ์ ๋ฐ๋ผ ์์ธยทํ ์คํธยท์ธ์
์ฒ๋ฆฌ๋ฅผ ์ํ๋ฉด `apiGet` ์ ์ด๋ค.
|
|
182
|
+
|
|
183
|
+
> โ **0.15.0 ์ด์ ์๋ ์ด ๋ฌธ์ฅ์ด ์ ์ธ์ ์ ํ ์์ผ๋ฉด์ ์ค์ ๋ก๋ ๋น-2xx ์ ๋์ก๋ค.** ์ ์ธ์ด ์ณ๊ณ
|
|
184
|
+
> ๊ตฌํ์ด ํ๋ ธ๋ ์๋ฆฌ๋ผ ๊ตฌํ์ ๊ณ ์ณค๋ค. `fetchRaw` ์ throw ์ ๊ธฐ๋๊ณ ์์๋ค๋ฉด ํธ์ถ๋ถ์์
|
|
185
|
+
> `if (!res.ok) throw โฆ` ๋ก ๋ฐ๊พธ๊ฑฐ๋ `apiGet` ์ผ๋ก ์ฎ๊ธด๋ค.
|
|
186
|
+
|
|
147
187
|
> ๋๋ฉ์ธ ์ก์
(์ํ ์ ์ด ๋ฑ)ยท์ํฐํฐ ๋ชฉ๋กยท๊ถํ ์ฝ๋๋ ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ ๋ฃ์ง ๋ง๊ณ ์ฑ adapter ์ ๋๋ค.
|
|
148
188
|
|
|
149
189
|
#### ์คํจ ์๋ต โ `ApiError`
|