@fluojs/validation 1.0.0-beta.4 → 1.0.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/README.ko.md +4 -0
- package/README.md +4 -0
- package/package.json +2 -2
package/README.ko.md
CHANGED
|
@@ -26,6 +26,7 @@ pnpm add @fluojs/validation
|
|
|
26
26
|
- 컨트롤러나 서비스에서 ad hoc parsing 대신 class 기반 검증 규칙을 쓰고 싶을 때
|
|
27
27
|
- `PickType`, `PartialType`, `IntersectionType` 같은 metadata-preserving mapped DTO helper가 필요할 때
|
|
28
28
|
- `@ValidateClass(...)`로 Zod나 Valibot 같은 Standard Schema validator를 붙이고 싶을 때
|
|
29
|
+
- `@fluojs/i18n/validation`으로 명시적으로 localize할 수 있는 안정적인 validation issue code와 path가 필요할 때
|
|
29
30
|
|
|
30
31
|
## 빠른 시작
|
|
31
32
|
|
|
@@ -96,6 +97,8 @@ type ValidationIssue = {
|
|
|
96
97
|
사용합니다. HTTP 바인딩에서 온 규칙은 `source`를 붙이며, standalone validation이나
|
|
97
98
|
Standard Schema 이슈에서는 값이 없을 수 있습니다.
|
|
98
99
|
|
|
100
|
+
`@fluojs/validation`은 항상 기존 human-readable `message` 값을 방출합니다. Localized message가 필요한 애플리케이션은 validation 실패 후 `@fluojs/i18n/validation`에 opt-in할 수 있습니다. 이 통합은 validator 실행을 바꾸거나 이 패키지를 HTTP locale resolution에 결합하지 않고 `source`, `field`, `code`를 translation key로 매핑합니다.
|
|
101
|
+
|
|
99
102
|
### Mapped DTO 헬퍼
|
|
100
103
|
|
|
101
104
|
```ts
|
|
@@ -154,6 +157,7 @@ class RestrictedUserDto {
|
|
|
154
157
|
## 관련 패키지
|
|
155
158
|
|
|
156
159
|
- `@fluojs/http`: request data를 bind한 뒤 이 패키지로 검증합니다.
|
|
160
|
+
- `@fluojs/i18n`: opt-in localized validation issue message를 위한 `@fluojs/i18n/validation`을 제공합니다.
|
|
157
161
|
- `@fluojs/serialization`: response side에서 output DTO를 가공합니다.
|
|
158
162
|
- `@fluojs/core`: validation decorator가 사용하는 metadata primitive를 제공합니다.
|
|
159
163
|
|
package/README.md
CHANGED
|
@@ -26,6 +26,7 @@ pnpm add @fluojs/validation
|
|
|
26
26
|
- when you want class-based validation rules instead of ad hoc parsing in controllers and services
|
|
27
27
|
- when you need metadata-preserving mapped DTO helpers such as `PickType`, `PartialType`, and `IntersectionType`
|
|
28
28
|
- when you want to attach Standard Schema validators such as Zod or Valibot through `@ValidateClass(...)`
|
|
29
|
+
- when you want stable validation issue codes and paths that can be localized explicitly through `@fluojs/i18n/validation`
|
|
29
30
|
|
|
30
31
|
## Quick Start
|
|
31
32
|
|
|
@@ -100,6 +101,8 @@ Nested DTOs use dot paths and collection indexes, such as `address.city` or
|
|
|
100
101
|
`items[0].name`. HTTP bindings attach `source` when the rule came from request
|
|
101
102
|
metadata; standalone validation and Standard Schema issues may leave it unset.
|
|
102
103
|
|
|
104
|
+
`@fluojs/validation` always emits its normal human-readable `message` values. Applications that need localized messages can opt into `@fluojs/i18n/validation` after validation fails. That integration maps `source`, `field`, and `code` to translation keys without changing validator execution or coupling this package to HTTP locale resolution.
|
|
105
|
+
|
|
103
106
|
### Mapped DTO helpers
|
|
104
107
|
|
|
105
108
|
```ts
|
|
@@ -158,6 +161,7 @@ Numeric validators, including `@IsLatitude()` and `@IsLongitude()`, validate num
|
|
|
158
161
|
## Related Packages
|
|
159
162
|
|
|
160
163
|
- `@fluojs/http`: binds request data, then uses this package to validate it
|
|
164
|
+
- `@fluojs/i18n`: exposes `@fluojs/i18n/validation` for opt-in localized validation issue messages
|
|
161
165
|
- `@fluojs/serialization`: shapes output DTOs on the response side
|
|
162
166
|
- `@fluojs/core`: provides the metadata primitives used by validation decorators
|
|
163
167
|
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"decorators",
|
|
10
10
|
"schema"
|
|
11
11
|
],
|
|
12
|
-
"version": "1.0.0
|
|
12
|
+
"version": "1.0.0",
|
|
13
13
|
"private": false,
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"repository": {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@standard-schema/spec": "^1.1.0",
|
|
44
44
|
"validator": "^13.15.26",
|
|
45
|
-
"@fluojs/core": "^1.0.0
|
|
45
|
+
"@fluojs/core": "^1.0.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/validator": "^13.15.10",
|