@zipbul/baker 0.1.2 → 1.1.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 +368 -280
- package/README.md +407 -280
- package/dist/index-70ggmxsa.js +6 -0
- package/dist/index-gcptd79v.js +6 -0
- package/dist/index-xdn55cz3.js +4 -0
- package/dist/index.d.ts +6 -5
- package/dist/index.js +211 -155
- package/dist/src/collect.d.ts +3 -3
- package/dist/src/configure.d.ts +33 -0
- package/dist/src/create-rule.d.ts +10 -19
- package/dist/src/decorators/field.d.ts +86 -0
- package/dist/src/decorators/index.d.ts +2 -14
- package/dist/src/decorators/index.js +2 -2
- package/dist/src/errors.d.ts +17 -17
- package/dist/src/functions/deserialize.d.ts +6 -4
- package/dist/src/functions/serialize.d.ts +5 -4
- package/dist/src/functions/to-json-schema.d.ts +11 -5
- package/dist/src/interfaces.d.ts +9 -30
- package/dist/src/registry.d.ts +4 -12
- package/dist/src/rules/index.d.ts +2 -0
- package/dist/src/rules/index.js +11 -2
- package/dist/src/rules/object.d.ts +1 -1
- package/dist/src/seal/circular-analyzer.d.ts +5 -9
- package/dist/src/seal/expose-validator.d.ts +6 -6
- package/dist/src/seal/index.d.ts +1 -1
- package/dist/src/seal/seal.d.ts +30 -15
- package/dist/src/seal/serialize-builder.d.ts +2 -2
- package/dist/src/symbols.d.ts +5 -5
- package/dist/src/symbols.js +2 -2
- package/dist/src/types.d.ts +38 -32
- package/dist/src/utils.d.ts +2 -0
- package/package.json +1 -1
- package/dist/index-3gcf6hkv.js +0 -5
- package/dist/index-mx6gnk4h.js +0 -6
- package/dist/index-wy5sh2nx.js +0 -15
- package/dist/src/decorators/array.d.ts +0 -13
- package/dist/src/decorators/common.d.ts +0 -39
- package/dist/src/decorators/date.d.ts +0 -5
- package/dist/src/decorators/locales.d.ts +0 -9
- package/dist/src/decorators/nested.d.ts +0 -17
- package/dist/src/decorators/number.d.ts +0 -15
- package/dist/src/decorators/object.d.ts +0 -9
- package/dist/src/decorators/schema.d.ts +0 -13
- package/dist/src/decorators/string.d.ts +0 -72
- package/dist/src/decorators/transform.d.ts +0 -68
- package/dist/src/decorators/typechecker.d.ts +0 -18
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import type { IsEmailOptions, IsURLOptions, IsBase32Options, IsBase64Options, IsDateStringOptions, IsCurrencyOptions, IsMACAddressOptions, IsIBANOptions, IsISSNOptions, IsFQDNOptions, IsLatLongOptions, IsISO8601Options, IsNumberStringOptions, IsDecimalOptions, IsStrongPasswordOptions } from '../rules/string';
|
|
2
|
-
import type { ValidationOptions } from '../interfaces';
|
|
3
|
-
export type { IsEmailOptions, IsURLOptions, IsBase32Options, IsBase64Options, IsDateStringOptions, IsCurrencyOptions, IsMACAddressOptions, IsIBANOptions, IsISSNOptions, IsFQDNOptions, IsLatLongOptions, IsISO8601Options, IsNumberStringOptions, IsDecimalOptions, IsStrongPasswordOptions, };
|
|
4
|
-
export declare function MinLength(min: number, options?: ValidationOptions): PropertyDecorator;
|
|
5
|
-
export declare function MaxLength(max: number, options?: ValidationOptions): PropertyDecorator;
|
|
6
|
-
export declare function Length(min: number, max: number, options?: ValidationOptions): PropertyDecorator;
|
|
7
|
-
export declare function Contains(seed: string, options?: ValidationOptions): PropertyDecorator;
|
|
8
|
-
export declare function NotContains(seed: string, options?: ValidationOptions): PropertyDecorator;
|
|
9
|
-
export declare function Matches(pattern: string | RegExp, modifiers?: string, options?: ValidationOptions): PropertyDecorator;
|
|
10
|
-
export declare function IsLowercase(options?: ValidationOptions): PropertyDecorator;
|
|
11
|
-
export declare function IsUppercase(options?: ValidationOptions): PropertyDecorator;
|
|
12
|
-
export declare function IsAscii(options?: ValidationOptions): PropertyDecorator;
|
|
13
|
-
export declare function IsAlpha(options?: ValidationOptions): PropertyDecorator;
|
|
14
|
-
export declare function IsAlphanumeric(options?: ValidationOptions): PropertyDecorator;
|
|
15
|
-
export declare function IsBooleanString(options?: ValidationOptions): PropertyDecorator;
|
|
16
|
-
export declare function IsNumberString(numberOptions?: IsNumberStringOptions, options?: ValidationOptions): PropertyDecorator;
|
|
17
|
-
export declare function IsDecimal(decimalOptions?: IsDecimalOptions, options?: ValidationOptions): PropertyDecorator;
|
|
18
|
-
export declare function IsFullWidth(options?: ValidationOptions): PropertyDecorator;
|
|
19
|
-
export declare function IsHalfWidth(options?: ValidationOptions): PropertyDecorator;
|
|
20
|
-
export declare function IsVariableWidth(options?: ValidationOptions): PropertyDecorator;
|
|
21
|
-
export declare function IsMultibyte(options?: ValidationOptions): PropertyDecorator;
|
|
22
|
-
export declare function IsSurrogatePair(options?: ValidationOptions): PropertyDecorator;
|
|
23
|
-
export declare function IsHexadecimal(options?: ValidationOptions): PropertyDecorator;
|
|
24
|
-
export declare function IsOctal(options?: ValidationOptions): PropertyDecorator;
|
|
25
|
-
export declare function IsEmail(emailOptions?: IsEmailOptions, options?: ValidationOptions): PropertyDecorator;
|
|
26
|
-
export declare function IsURL(urlOptions?: IsURLOptions, options?: ValidationOptions): PropertyDecorator;
|
|
27
|
-
export declare function IsUUID(version?: 1 | 2 | 3 | 4 | 5 | 'all', options?: ValidationOptions): PropertyDecorator;
|
|
28
|
-
export declare function IsIP(version?: 4 | 6, options?: ValidationOptions): PropertyDecorator;
|
|
29
|
-
export declare function IsHexColor(options?: ValidationOptions): PropertyDecorator;
|
|
30
|
-
export declare function IsRgbColor(includePercentValues?: boolean, options?: ValidationOptions): PropertyDecorator;
|
|
31
|
-
export declare function IsHSL(options?: ValidationOptions): PropertyDecorator;
|
|
32
|
-
export declare function IsMACAddress(macOptions?: IsMACAddressOptions, options?: ValidationOptions): PropertyDecorator;
|
|
33
|
-
export declare function IsISBN(version?: 10 | 13, options?: ValidationOptions): PropertyDecorator;
|
|
34
|
-
export declare function IsISIN(options?: ValidationOptions): PropertyDecorator;
|
|
35
|
-
export declare function IsISO8601(isoOptions?: IsISO8601Options, options?: ValidationOptions): PropertyDecorator;
|
|
36
|
-
export declare function IsISRC(options?: ValidationOptions): PropertyDecorator;
|
|
37
|
-
export declare function IsISSN(issnOptions?: IsISSNOptions, options?: ValidationOptions): PropertyDecorator;
|
|
38
|
-
export declare function IsJWT(options?: ValidationOptions): PropertyDecorator;
|
|
39
|
-
export declare function IsLatLong(latLongOptions?: IsLatLongOptions, options?: ValidationOptions): PropertyDecorator;
|
|
40
|
-
export declare function IsLocale(options?: ValidationOptions): PropertyDecorator;
|
|
41
|
-
export declare function IsDataURI(options?: ValidationOptions): PropertyDecorator;
|
|
42
|
-
export declare function IsFQDN(fqdnOptions?: IsFQDNOptions, options?: ValidationOptions): PropertyDecorator;
|
|
43
|
-
export declare function IsPort(options?: ValidationOptions): PropertyDecorator;
|
|
44
|
-
export declare function IsEAN(options?: ValidationOptions): PropertyDecorator;
|
|
45
|
-
export declare function IsISO31661Alpha2(options?: ValidationOptions): PropertyDecorator;
|
|
46
|
-
export declare function IsISO31661Alpha3(options?: ValidationOptions): PropertyDecorator;
|
|
47
|
-
export declare function IsBIC(options?: ValidationOptions): PropertyDecorator;
|
|
48
|
-
export declare function IsFirebasePushId(options?: ValidationOptions): PropertyDecorator;
|
|
49
|
-
export declare function IsSemVer(options?: ValidationOptions): PropertyDecorator;
|
|
50
|
-
export declare function IsMongoId(options?: ValidationOptions): PropertyDecorator;
|
|
51
|
-
export declare function IsJSON(options?: ValidationOptions): PropertyDecorator;
|
|
52
|
-
export declare function IsBase32(base32Options?: IsBase32Options, options?: ValidationOptions): PropertyDecorator;
|
|
53
|
-
export declare function IsBase58(options?: ValidationOptions): PropertyDecorator;
|
|
54
|
-
export declare function IsBase64(base64Options?: IsBase64Options, options?: ValidationOptions): PropertyDecorator;
|
|
55
|
-
export declare function IsDateString(dateOptions?: IsDateStringOptions, options?: ValidationOptions): PropertyDecorator;
|
|
56
|
-
export declare function IsMimeType(options?: ValidationOptions): PropertyDecorator;
|
|
57
|
-
export declare function IsCurrency(currencyOptions?: IsCurrencyOptions, options?: ValidationOptions): PropertyDecorator;
|
|
58
|
-
export declare function IsMagnetURI(options?: ValidationOptions): PropertyDecorator;
|
|
59
|
-
export declare function IsCreditCard(options?: ValidationOptions): PropertyDecorator;
|
|
60
|
-
export declare function IsIBAN(ibanOptions?: IsIBANOptions, options?: ValidationOptions): PropertyDecorator;
|
|
61
|
-
export declare function IsByteLength(min: number, max?: number, options?: ValidationOptions): PropertyDecorator;
|
|
62
|
-
export declare function IsHash(algorithm: string, options?: ValidationOptions): PropertyDecorator;
|
|
63
|
-
export declare function IsRFC3339(options?: ValidationOptions): PropertyDecorator;
|
|
64
|
-
export declare function IsMilitaryTime(options?: ValidationOptions): PropertyDecorator;
|
|
65
|
-
export declare function IsLatitude(options?: ValidationOptions): PropertyDecorator;
|
|
66
|
-
export declare function IsLongitude(options?: ValidationOptions): PropertyDecorator;
|
|
67
|
-
export declare function IsEthereumAddress(options?: ValidationOptions): PropertyDecorator;
|
|
68
|
-
export declare function IsBtcAddress(options?: ValidationOptions): PropertyDecorator;
|
|
69
|
-
export declare function IsISO4217CurrencyCode(options?: ValidationOptions): PropertyDecorator;
|
|
70
|
-
export declare function IsPhoneNumber(options?: ValidationOptions): PropertyDecorator;
|
|
71
|
-
export declare function IsStrongPassword(pwOptions?: IsStrongPasswordOptions, options?: ValidationOptions): PropertyDecorator;
|
|
72
|
-
export declare function IsTaxId(locale: string, options?: ValidationOptions): PropertyDecorator;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import type { TransformFunction } from '../types';
|
|
2
|
-
export interface ExposeOptions {
|
|
3
|
-
/** 출력 측 키 매핑 이름. deserialize/serialize 방향에 따라 다르게 설정 가능. */
|
|
4
|
-
name?: string;
|
|
5
|
-
/** 이 @Expose가 적용되는 groups. */
|
|
6
|
-
groups?: string[];
|
|
7
|
-
/** true: deserialize 방향에만 적용 (class-transformer toClassOnly 대응) */
|
|
8
|
-
deserializeOnly?: boolean;
|
|
9
|
-
/** true: serialize 방향에만 적용 (class-transformer toPlainOnly 대응) */
|
|
10
|
-
serializeOnly?: boolean;
|
|
11
|
-
}
|
|
12
|
-
export interface ExcludeOptions {
|
|
13
|
-
/** true: deserialize 방향에만 제외 */
|
|
14
|
-
deserializeOnly?: boolean;
|
|
15
|
-
/** true: serialize 방향에만 제외 */
|
|
16
|
-
serializeOnly?: boolean;
|
|
17
|
-
}
|
|
18
|
-
export interface TransformOptions {
|
|
19
|
-
/** 이 @Transform이 적용되는 groups */
|
|
20
|
-
groups?: string[];
|
|
21
|
-
/** true: deserialize 방향에만 적용 */
|
|
22
|
-
deserializeOnly?: boolean;
|
|
23
|
-
/** true: serialize 방향에만 적용 */
|
|
24
|
-
serializeOnly?: boolean;
|
|
25
|
-
}
|
|
26
|
-
export interface TypeOptions {
|
|
27
|
-
/** discriminator 설정 — 다형성 지원 (§8) */
|
|
28
|
-
discriminator?: {
|
|
29
|
-
property: string;
|
|
30
|
-
subTypes: {
|
|
31
|
-
value: Function;
|
|
32
|
-
name: string;
|
|
33
|
-
}[];
|
|
34
|
-
};
|
|
35
|
-
/** discriminator 프로퍼티를 결과 객체에 유지할지 여부 */
|
|
36
|
-
keepDiscriminatorProperty?: boolean;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* 필드를 baker에 등록하고 선택적으로 name 매핑/groups/방향 제어를 수행.
|
|
40
|
-
*
|
|
41
|
-
* 복수 @Expose 스택 지원 — 방향별 다른 name 매핑에 활용:
|
|
42
|
-
* @Expose({ name: 'user_name', deserializeOnly: true })
|
|
43
|
-
* @Expose({ name: 'userName', serializeOnly: true })
|
|
44
|
-
*
|
|
45
|
-
* @Expose와 @Exclude 동시 적용 시 @Exclude 우선 (§1.2).
|
|
46
|
-
*/
|
|
47
|
-
export declare function Expose(options?: ExposeOptions): PropertyDecorator;
|
|
48
|
-
/**
|
|
49
|
-
* 필드를 serialize/deserialize 결과에서 제외.
|
|
50
|
-
* @Exclude({ deserializeOnly: true }) — deserialize 방향만 제외
|
|
51
|
-
* @Exclude({ serializeOnly: true }) — serialize 방향만 제외
|
|
52
|
-
* @Exclude() — 양방향 제외
|
|
53
|
-
*
|
|
54
|
-
* @Expose와 동시 적용 시 @Exclude 우선 (§1.2).
|
|
55
|
-
*/
|
|
56
|
-
export declare function Exclude(options?: ExcludeOptions): PropertyDecorator;
|
|
57
|
-
/**
|
|
58
|
-
* 커스텀 변환 함수 적용.
|
|
59
|
-
* - TransformParams.type === 'deserialize' | 'serialize'로 방향 구분 가능
|
|
60
|
-
* - 명시적 @Transform이 있으면 enableImplicitConversion 건너뜀 (§4.3 ⑤)
|
|
61
|
-
*/
|
|
62
|
-
export declare function Transform(fn: TransformFunction, options?: TransformOptions): PropertyDecorator;
|
|
63
|
-
/**
|
|
64
|
-
* 중첩 객체의 타입을 지정. discriminator 다형성 지원.
|
|
65
|
-
* @ValidateNested와 함께 사용 시 중첩 DTO 재귀 검증 활성화.
|
|
66
|
-
* builder 트리거 조건: meta.type !== null && meta.flags.validateNested === true
|
|
67
|
-
*/
|
|
68
|
-
export declare function Type(fn: () => Function, options?: TypeOptions): PropertyDecorator;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { IsNumberOptions } from '../rules/typechecker';
|
|
2
|
-
import type { ValidationOptions } from '../interfaces';
|
|
3
|
-
/** typeof value === 'string' */
|
|
4
|
-
export declare function IsString(options?: ValidationOptions): PropertyDecorator;
|
|
5
|
-
/** typeof value === 'number' + NaN/Infinity/maxDecimalPlaces 옵션 */
|
|
6
|
-
export declare function IsNumber(numberOptions?: IsNumberOptions, options?: ValidationOptions): PropertyDecorator;
|
|
7
|
-
/** typeof value === 'boolean' */
|
|
8
|
-
export declare function IsBoolean(options?: ValidationOptions): PropertyDecorator;
|
|
9
|
-
/** value instanceof Date && !isNaN(getTime()) */
|
|
10
|
-
export declare function IsDate(options?: ValidationOptions): PropertyDecorator;
|
|
11
|
-
/** Object.values(entity).indexOf(value) !== -1 */
|
|
12
|
-
export declare function IsEnum(entity: object, options?: ValidationOptions): PropertyDecorator;
|
|
13
|
-
/** typeof value === 'number' && Number.isInteger(value) */
|
|
14
|
-
export declare function IsInt(options?: ValidationOptions): PropertyDecorator;
|
|
15
|
-
/** Array.isArray(value) */
|
|
16
|
-
export declare function IsArray(options?: ValidationOptions): PropertyDecorator;
|
|
17
|
-
/** typeof value === 'object' && value !== null && !Array.isArray(value) */
|
|
18
|
-
export declare function IsObject(options?: ValidationOptions): PropertyDecorator;
|