byzip-v2-sdk 1.0.2 → 1.0.3
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.md +67 -40
- package/dist/auth.const.d.ts +1 -0
- package/dist/auth.const.js +4 -0
- package/dist/auth.dto.d.ts +57 -0
- package/dist/index.d.ts +7 -8
- package/dist/index.js +7 -11
- package/dist/jwt.types.d.ts +10 -0
- package/dist/{users/login.dto.js → jwt.types.js} +1 -3
- package/dist/response.dto.d.ts +8 -0
- package/dist/{users/me.dto.js → response.dto.js} +1 -1
- package/dist/response.helpers.d.ts +12 -0
- package/dist/{dto/common/response.dto.js → response.helpers.js} +10 -6
- package/dist/{dto/user/user.dto.d.ts → user.dto.d.ts} +29 -71
- package/dist/{dto/user/user.dto.js → user.dto.js} +0 -3
- package/package.json +1 -1
- package/dist/dto/auth/auth.dto.d.ts +0 -68
- package/dist/dto/common/response.dto.d.ts +0 -16
- package/dist/dto/index.d.ts +0 -7
- package/dist/dto/index.js +0 -26
- package/dist/users/index.d.ts +0 -5
- package/dist/users/index.js +0 -23
- package/dist/users/login.dto.d.ts +0 -55
- package/dist/users/me.dto.d.ts +0 -135
- /package/dist/{dto/auth/auth.dto.js → auth.dto.js} +0 -0
package/README.md
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
- 📦 **가벼운 번들** - 추가 패키지 설치 불필요
|
|
9
9
|
- 🔒 **타입 안전성** - 완전한 TypeScript 타입 체크 지원
|
|
10
10
|
- 🌐 **범용 호환성** - 모든 JavaScript/TypeScript 환경에서 사용 가능
|
|
11
|
+
- 🤖 **자동 업데이트** - 백엔드 타입 변경 시 자동으로 배포
|
|
11
12
|
|
|
12
13
|
## 📦 설치
|
|
13
14
|
|
|
@@ -37,7 +38,7 @@ import {
|
|
|
37
38
|
BaseResponseDto,
|
|
38
39
|
createSuccessResponse,
|
|
39
40
|
createErrorResponse,
|
|
40
|
-
} from
|
|
41
|
+
} from 'byzip-v2-sdk';
|
|
41
42
|
```
|
|
42
43
|
|
|
43
44
|
### 사용 예제
|
|
@@ -49,29 +50,29 @@ import {
|
|
|
49
50
|
LoginRequestDto,
|
|
50
51
|
LoginResponseDto,
|
|
51
52
|
RegisterRequestDto,
|
|
52
|
-
} from
|
|
53
|
+
} from 'byzip-v2-sdk';
|
|
53
54
|
|
|
54
55
|
// 로그인 요청
|
|
55
56
|
const loginRequest: LoginRequestDto = {
|
|
56
|
-
userId:
|
|
57
|
-
password:
|
|
57
|
+
userId: 'user123',
|
|
58
|
+
password: 'password123!',
|
|
58
59
|
};
|
|
59
60
|
|
|
60
61
|
// 회원가입 요청
|
|
61
62
|
const registerRequest: RegisterRequestDto = {
|
|
62
|
-
userId:
|
|
63
|
-
name:
|
|
64
|
-
email:
|
|
65
|
-
password:
|
|
66
|
-
confirmPassword:
|
|
67
|
-
phoneNumber:
|
|
63
|
+
userId: 'newuser',
|
|
64
|
+
name: '홍길동',
|
|
65
|
+
email: 'user@example.com',
|
|
66
|
+
password: 'password123!',
|
|
67
|
+
confirmPassword: 'password123!',
|
|
68
|
+
phoneNumber: '010-1234-5678', // 선택사항
|
|
68
69
|
};
|
|
69
70
|
|
|
70
71
|
// 로그인 응답 처리
|
|
71
72
|
const handleLoginResponse = (response: LoginResponseDto) => {
|
|
72
73
|
if (response.success) {
|
|
73
|
-
console.log(
|
|
74
|
-
console.log(
|
|
74
|
+
console.log('로그인 성공:', response.data.accessToken);
|
|
75
|
+
console.log('메시지:', response.message);
|
|
75
76
|
}
|
|
76
77
|
};
|
|
77
78
|
```
|
|
@@ -84,23 +85,24 @@ import {
|
|
|
84
85
|
UpdateUserRequestDto,
|
|
85
86
|
UsersGenderEnum,
|
|
86
87
|
UsersRolesEnum,
|
|
87
|
-
} from
|
|
88
|
+
} from 'byzip-v2-sdk';
|
|
88
89
|
|
|
89
90
|
// 프로필 조회 응답 처리
|
|
90
91
|
const handleProfileResponse = (response: GetMeResponseDto) => {
|
|
91
|
-
|
|
92
|
-
console.log(
|
|
93
|
-
console.log(
|
|
94
|
-
console.log(
|
|
95
|
-
console.log(
|
|
92
|
+
const { data } = response;
|
|
93
|
+
console.log('사용자 ID:', data.userId);
|
|
94
|
+
console.log('이름:', data.name);
|
|
95
|
+
console.log('역할:', data.role);
|
|
96
|
+
console.log('상태:', data.status);
|
|
97
|
+
console.log('이메일 인증:', data.emailVerified);
|
|
96
98
|
};
|
|
97
99
|
|
|
98
100
|
// 프로필 업데이트 요청
|
|
99
101
|
const updateRequest: UpdateUserRequestDto = {
|
|
100
|
-
name:
|
|
101
|
-
email:
|
|
102
|
-
phoneNumber:
|
|
103
|
-
birthDate:
|
|
102
|
+
name: '홍길동',
|
|
103
|
+
email: 'newemail@example.com',
|
|
104
|
+
phoneNumber: '010-9876-5432',
|
|
105
|
+
birthDate: '1990-01-01',
|
|
104
106
|
gender: UsersGenderEnum.MALE,
|
|
105
107
|
role: UsersRolesEnum.USER,
|
|
106
108
|
};
|
|
@@ -113,23 +115,23 @@ import {
|
|
|
113
115
|
BaseResponseDto,
|
|
114
116
|
createSuccessResponse,
|
|
115
117
|
createErrorResponse,
|
|
116
|
-
} from
|
|
118
|
+
} from 'byzip-v2-sdk';
|
|
117
119
|
|
|
118
120
|
// 성공 응답 생성
|
|
119
121
|
const successResponse = createSuccessResponse(
|
|
120
|
-
{ message:
|
|
121
|
-
|
|
122
|
+
{ message: '처리 완료' },
|
|
123
|
+
'요청이 성공적으로 처리되었습니다.',
|
|
122
124
|
);
|
|
123
125
|
|
|
124
126
|
// 에러 응답 생성
|
|
125
|
-
const errorResponse = createErrorResponse(
|
|
127
|
+
const errorResponse = createErrorResponse('처리 중 오류가 발생했습니다.');
|
|
126
128
|
|
|
127
129
|
// 응답 타입 처리
|
|
128
130
|
const handleResponse = <T>(response: BaseResponseDto<T>) => {
|
|
129
131
|
if (response.success) {
|
|
130
|
-
console.log(
|
|
132
|
+
console.log('성공:', response.data);
|
|
131
133
|
} else {
|
|
132
|
-
console.error(
|
|
134
|
+
console.error('실패:', response.message);
|
|
133
135
|
}
|
|
134
136
|
};
|
|
135
137
|
```
|
|
@@ -138,15 +140,18 @@ const handleResponse = <T>(response: BaseResponseDto<T>) => {
|
|
|
138
140
|
|
|
139
141
|
### 🔐 인증 관련 (Auth)
|
|
140
142
|
|
|
141
|
-
| 타입
|
|
142
|
-
|
|
|
143
|
-
| `LoginRequestDto`
|
|
144
|
-
| `LoginResponseDto`
|
|
145
|
-
| `RegisterRequestDto`
|
|
146
|
-
| `RegisterResponseDto`
|
|
147
|
-
| `TokenDataDto`
|
|
148
|
-
| `
|
|
149
|
-
| `
|
|
143
|
+
| 타입 | 설명 |
|
|
144
|
+
| ------------------------- | ---------------- |
|
|
145
|
+
| `LoginRequestDto` | 로그인 요청 |
|
|
146
|
+
| `LoginResponseDto` | 로그인 응답 |
|
|
147
|
+
| `RegisterRequestDto` | 회원가입 요청 |
|
|
148
|
+
| `RegisterResponseDto` | 회원가입 응답 |
|
|
149
|
+
| `TokenDataDto` | 토큰 데이터 |
|
|
150
|
+
| `RefreshTokenRequestDto` | 토큰 갱신 요청 |
|
|
151
|
+
| `RefreshTokenResponseDto` | 토큰 갱신 응답 |
|
|
152
|
+
| `LogoutResponseDto` | 로그아웃 응답 |
|
|
153
|
+
| `DeleteUserRequestDto` | 사용자 삭제 요청 |
|
|
154
|
+
| `DeleteUserResponseDto` | 사용자 삭제 응답 |
|
|
150
155
|
|
|
151
156
|
### 👤 사용자 관련 (User)
|
|
152
157
|
|
|
@@ -154,9 +159,11 @@ const handleResponse = <T>(response: BaseResponseDto<T>) => {
|
|
|
154
159
|
| --------------------------- | --------------------- |
|
|
155
160
|
| `UsersModelDto` | 사용자 모델 |
|
|
156
161
|
| `GetMeResponseDto` | 내 정보 조회 응답 |
|
|
162
|
+
| `GetMeDataDto` | 내 정보 데이터 |
|
|
157
163
|
| `UpdateUserRequestDto` | 사용자 정보 수정 요청 |
|
|
158
164
|
| `UpdateUserResponseDto` | 사용자 정보 수정 응답 |
|
|
159
165
|
| `GetAllUsersResponseDto` | 모든 사용자 조회 응답 |
|
|
166
|
+
| `UserSummaryDto` | 사용자 요약 정보 |
|
|
160
167
|
| `ChangePasswordRequestDto` | 비밀번호 변경 요청 |
|
|
161
168
|
| `ChangePasswordResponseDto` | 비밀번호 변경 응답 |
|
|
162
169
|
| `DeleteAccountRequestDto` | 계정 삭제 요청 |
|
|
@@ -178,18 +185,37 @@ const handleResponse = <T>(response: BaseResponseDto<T>) => {
|
|
|
178
185
|
| `createSuccessResponse<T>()` | 성공 응답 생성 함수 |
|
|
179
186
|
| `createErrorResponse<T>()` | 에러 응답 생성 함수 |
|
|
180
187
|
|
|
188
|
+
## 🤖 자동 배포
|
|
189
|
+
|
|
190
|
+
이 패키지는 백엔드 저장소의 타입 파일(`src/types/`)이 변경될 때마다 GitHub Actions를 통해 자동으로 업데이트되어 NPM에 배포됩니다.
|
|
191
|
+
|
|
192
|
+
### 배포 프로세스
|
|
193
|
+
|
|
194
|
+
1. 백엔드 코드의 DTO 타입 변경
|
|
195
|
+
2. `main` 또는 `dev` 브랜치에 푸시
|
|
196
|
+
3. GitHub Actions 자동 실행
|
|
197
|
+
4. 타입 추출 및 변환 (클래스 → 인터페이스)
|
|
198
|
+
5. 버전 자동 증가
|
|
199
|
+
6. NPM에 자동 배포
|
|
200
|
+
|
|
181
201
|
## 🛠️ 개발
|
|
182
202
|
|
|
203
|
+
### 로컬에서 타입 추출
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
npm run sdk:extract
|
|
207
|
+
```
|
|
208
|
+
|
|
183
209
|
### 빌드
|
|
184
210
|
|
|
185
211
|
```bash
|
|
186
|
-
npm run build
|
|
212
|
+
npm run sdk:build
|
|
187
213
|
```
|
|
188
214
|
|
|
189
|
-
### 배포
|
|
215
|
+
### 수동 배포
|
|
190
216
|
|
|
191
217
|
```bash
|
|
192
|
-
npm publish
|
|
218
|
+
npm run sdk:publish
|
|
193
219
|
```
|
|
194
220
|
|
|
195
221
|
## 📄 라이선스
|
|
@@ -206,3 +232,4 @@ ISC
|
|
|
206
232
|
- ✅ 런타임 의존성 제거 (`@nestjs/swagger` 제거)
|
|
207
233
|
- ✅ 타입 안전성 향상
|
|
208
234
|
- ✅ 번들 크기 최적화
|
|
235
|
+
- ✅ GitHub Actions 자동 배포 시스템 구축
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SAMPLE = "sample";
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 인증 관련 DTO 정의
|
|
3
|
+
*/
|
|
4
|
+
export interface LoginRequestDto {
|
|
5
|
+
userId: string;
|
|
6
|
+
password: string;
|
|
7
|
+
}
|
|
8
|
+
export interface TokenDataDto {
|
|
9
|
+
accessToken: string;
|
|
10
|
+
refreshToken: string;
|
|
11
|
+
}
|
|
12
|
+
export interface LoginResponseDto {
|
|
13
|
+
success: boolean;
|
|
14
|
+
message: string;
|
|
15
|
+
data: TokenDataDto;
|
|
16
|
+
}
|
|
17
|
+
export interface RegisterRequestDto {
|
|
18
|
+
userId: string;
|
|
19
|
+
name: string;
|
|
20
|
+
email: string;
|
|
21
|
+
password: string;
|
|
22
|
+
confirmPassword: string;
|
|
23
|
+
phoneNumber?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface RegisterResponseDto {
|
|
26
|
+
success: boolean;
|
|
27
|
+
message: string;
|
|
28
|
+
data: TokenDataDto;
|
|
29
|
+
}
|
|
30
|
+
export interface DeleteUserRequestDto {
|
|
31
|
+
userId: string;
|
|
32
|
+
password: string;
|
|
33
|
+
}
|
|
34
|
+
export interface DeleteUserResponseDto {
|
|
35
|
+
success: boolean;
|
|
36
|
+
message: string;
|
|
37
|
+
data: {
|
|
38
|
+
userId: string;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
export interface LogoutDataDto {
|
|
42
|
+
userId: string;
|
|
43
|
+
logoutAt: string;
|
|
44
|
+
}
|
|
45
|
+
export interface LogoutResponseDto {
|
|
46
|
+
success: boolean;
|
|
47
|
+
message: string;
|
|
48
|
+
data: LogoutDataDto;
|
|
49
|
+
}
|
|
50
|
+
export interface RefreshTokenRequestDto {
|
|
51
|
+
refreshToken: string;
|
|
52
|
+
}
|
|
53
|
+
export interface RefreshTokenResponseDto {
|
|
54
|
+
success: boolean;
|
|
55
|
+
message: string;
|
|
56
|
+
data: TokenDataDto;
|
|
57
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* ByZip V2 SDK
|
|
3
|
-
*
|
|
3
|
+
* 자동 생성된 파일입니다. 수정하지 마세요.
|
|
4
4
|
*/
|
|
5
|
-
export * from
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
5
|
+
export * from './auth.const';
|
|
6
|
+
export * from './auth.dto';
|
|
7
|
+
export * from './jwt.types';
|
|
8
|
+
export * from './response.dto';
|
|
9
|
+
export * from './response.helpers';
|
|
10
|
+
export * from './user.dto';
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
3
|
* ByZip V2 SDK
|
|
4
|
-
*
|
|
4
|
+
* 자동 생성된 파일입니다. 수정하지 마세요.
|
|
5
5
|
*/
|
|
6
6
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
7
|
if (k2 === undefined) k2 = k;
|
|
@@ -18,13 +18,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
18
18
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
19
19
|
};
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
|
|
22
|
-
__exportStar(require("./dto"), exports);
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
name: "byzip-v2-sdk",
|
|
28
|
-
version: exports.SDK_VERSION,
|
|
29
|
-
description: "분양모음집 V2 SDK - 프론트엔드와 백엔드 간 타입 통일을 위한 TypeScript SDK",
|
|
30
|
-
};
|
|
21
|
+
__exportStar(require("./auth.const"), exports);
|
|
22
|
+
__exportStar(require("./auth.dto"), exports);
|
|
23
|
+
__exportStar(require("./jwt.types"), exports);
|
|
24
|
+
__exportStar(require("./response.dto"), exports);
|
|
25
|
+
__exportStar(require("./response.helpers"), exports);
|
|
26
|
+
__exportStar(require("./user.dto"), exports);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API 응답 생성 헬퍼 함수
|
|
3
|
+
*/
|
|
4
|
+
import { BaseResponseDto } from './response.dto';
|
|
5
|
+
/**
|
|
6
|
+
* 성공 응답 생성
|
|
7
|
+
*/
|
|
8
|
+
export declare function createSuccessResponse<T>(data: T, message?: string): BaseResponseDto<T>;
|
|
9
|
+
/**
|
|
10
|
+
* 에러 응답 생성
|
|
11
|
+
*/
|
|
12
|
+
export declare function createErrorResponse<T = null>(message: string, data?: T): BaseResponseDto<T>;
|
|
@@ -1,23 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* API 응답 생성 헬퍼 함수
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.createSuccessResponse = createSuccessResponse;
|
|
7
7
|
exports.createErrorResponse = createErrorResponse;
|
|
8
|
-
/**
|
|
9
|
-
|
|
8
|
+
/**
|
|
9
|
+
* 성공 응답 생성
|
|
10
|
+
*/
|
|
11
|
+
function createSuccessResponse(data, message = '요청이 성공적으로 처리되었습니다.') {
|
|
10
12
|
return {
|
|
11
13
|
success: true,
|
|
12
14
|
message,
|
|
13
|
-
data
|
|
15
|
+
data
|
|
14
16
|
};
|
|
15
17
|
}
|
|
16
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* 에러 응답 생성
|
|
20
|
+
*/
|
|
17
21
|
function createErrorResponse(message, data = null) {
|
|
18
22
|
return {
|
|
19
23
|
success: false,
|
|
20
24
|
message,
|
|
21
|
-
data
|
|
25
|
+
data
|
|
22
26
|
};
|
|
23
27
|
}
|
|
@@ -1,27 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 사용자 프로필 관련 DTO 정의
|
|
3
3
|
*/
|
|
4
|
-
/** 사용자 역할 열거형 */
|
|
5
4
|
export declare enum UsersRolesEnum {
|
|
6
5
|
ADMIN = "ADMIN",
|
|
7
6
|
USER = "USER"
|
|
8
7
|
}
|
|
9
|
-
/** 사용자 상태 열거형 */
|
|
10
8
|
export declare enum UsersStatusEnum {
|
|
11
9
|
ACTIVE = "ACTIVE",
|
|
12
10
|
INACTIVE = "INACTIVE",
|
|
13
11
|
SUSPENDED = "SUSPENDED",
|
|
14
12
|
PENDING_VERIFICATION = "PENDING_VERIFICATION"
|
|
15
13
|
}
|
|
16
|
-
/** 사용자 성별 열거형 */
|
|
17
14
|
export declare enum UsersGenderEnum {
|
|
18
15
|
MALE = "MALE",
|
|
19
16
|
FEMALE = "FEMALE",
|
|
20
17
|
OTHER = "OTHER"
|
|
21
18
|
}
|
|
22
|
-
/** 사용자 모델 DTO */
|
|
23
19
|
export interface UsersModelDto {
|
|
24
|
-
/** 사용자 고유 ID
|
|
20
|
+
/** 사용자 고유 ID */
|
|
25
21
|
id: number;
|
|
26
22
|
/** 사용자 ID (로그인용) */
|
|
27
23
|
userId: string;
|
|
@@ -52,133 +48,95 @@ export interface UsersModelDto {
|
|
|
52
48
|
/** 전화번호 인증 여부 */
|
|
53
49
|
phoneVerified: boolean;
|
|
54
50
|
}
|
|
55
|
-
|
|
56
|
-
export interface GetMeResponseDto {
|
|
57
|
-
/** 사용자 고유 ID */
|
|
51
|
+
export interface GetMeDataDto {
|
|
58
52
|
id: number;
|
|
59
|
-
/** 사용자 ID (로그인용) */
|
|
60
53
|
userId: string;
|
|
61
|
-
/** 사용자 이름 */
|
|
62
54
|
name: string;
|
|
63
|
-
/** 이메일 */
|
|
64
55
|
email: string;
|
|
65
|
-
/** 전화번호 */
|
|
66
56
|
phoneNumber?: string;
|
|
67
|
-
/** 프로필 이미지 URL */
|
|
68
57
|
profileImageUrl?: string;
|
|
69
|
-
/** 생년월일 */
|
|
70
58
|
birthDate?: string;
|
|
71
|
-
/** 성별 */
|
|
72
59
|
gender?: UsersGenderEnum;
|
|
73
|
-
/** 계정 생성일 */
|
|
74
60
|
createdAt: string;
|
|
75
|
-
/** 마지막 업데이트일 */
|
|
76
61
|
updatedAt: string;
|
|
77
|
-
/** 계정 상태 */
|
|
78
62
|
status: UsersStatusEnum;
|
|
79
|
-
/** 계정 역할 */
|
|
80
63
|
role: UsersRolesEnum;
|
|
81
|
-
/** 이메일 인증 여부 */
|
|
82
64
|
emailVerified: boolean;
|
|
83
|
-
/** 전화번호 인증 여부 */
|
|
84
65
|
phoneVerified: boolean;
|
|
85
66
|
}
|
|
86
|
-
|
|
67
|
+
export interface GetMeResponseDto {
|
|
68
|
+
success: boolean;
|
|
69
|
+
message: string;
|
|
70
|
+
data: GetMeDataDto;
|
|
71
|
+
}
|
|
87
72
|
export interface ChangePasswordRequestDto {
|
|
88
|
-
/** 현재 비밀번호 */
|
|
89
73
|
currentPassword: string;
|
|
90
|
-
/** 새 비밀번호 */
|
|
91
74
|
newPassword: string;
|
|
92
|
-
/** 새 비밀번호 확인 */
|
|
93
75
|
confirmPassword: string;
|
|
94
76
|
}
|
|
95
|
-
|
|
77
|
+
export interface ChangePasswordDataDto {
|
|
78
|
+
tokenRefreshRequired: boolean;
|
|
79
|
+
}
|
|
96
80
|
export interface ChangePasswordResponseDto {
|
|
97
|
-
|
|
81
|
+
success: boolean;
|
|
98
82
|
message: string;
|
|
99
|
-
|
|
100
|
-
tokenRefreshRequired: boolean;
|
|
83
|
+
data: ChangePasswordDataDto;
|
|
101
84
|
}
|
|
102
|
-
/** 계정 삭제 요청 DTO */
|
|
103
85
|
export interface DeleteAccountRequestDto {
|
|
104
|
-
/** 비밀번호 확인 */
|
|
105
86
|
password: string;
|
|
106
|
-
/** 삭제 사유 */
|
|
107
87
|
reason?: string;
|
|
108
88
|
}
|
|
109
|
-
|
|
89
|
+
export interface DeleteAccountDataDto {
|
|
90
|
+
scheduledDeletionDate: number;
|
|
91
|
+
}
|
|
110
92
|
export interface DeleteAccountResponseDto {
|
|
111
|
-
|
|
93
|
+
success: boolean;
|
|
112
94
|
message: string;
|
|
113
|
-
|
|
114
|
-
scheduledDeletionDate: number;
|
|
95
|
+
data: DeleteAccountDataDto;
|
|
115
96
|
}
|
|
116
|
-
|
|
117
|
-
export interface GetAllUsersResponseDto {
|
|
118
|
-
/** 사용자 고유 ID */
|
|
97
|
+
export interface UserSummaryDto {
|
|
119
98
|
id: number;
|
|
120
|
-
/** 사용자 ID (로그인용) */
|
|
121
99
|
userId: string;
|
|
122
|
-
/** 사용자 이름 */
|
|
123
100
|
name: string;
|
|
124
|
-
/** 이메일 */
|
|
125
101
|
email: string;
|
|
126
|
-
/** 전화번호 */
|
|
127
102
|
phoneNumber?: string;
|
|
128
|
-
/** 프로필 이미지 URL */
|
|
129
103
|
profileImageUrl?: string;
|
|
130
|
-
/** 계정 생성일 */
|
|
131
104
|
createdAt: string;
|
|
132
|
-
/** 계정 상태 */
|
|
133
105
|
status: UsersStatusEnum;
|
|
134
|
-
/** 계정 역할 */
|
|
135
106
|
role: UsersRolesEnum;
|
|
136
|
-
/** 이메일 인증 여부 */
|
|
137
107
|
emailVerified: boolean;
|
|
138
108
|
}
|
|
139
|
-
|
|
109
|
+
export interface GetAllUsersResponseDto {
|
|
110
|
+
success: boolean;
|
|
111
|
+
message: string;
|
|
112
|
+
data: UserSummaryDto[];
|
|
113
|
+
}
|
|
140
114
|
export interface UpdateUserRequestDto {
|
|
141
|
-
/** 사용자 이름 */
|
|
142
115
|
name?: string;
|
|
143
|
-
/** 이메일 */
|
|
144
116
|
email?: string;
|
|
145
|
-
/** 전화번호 */
|
|
146
117
|
phoneNumber?: string;
|
|
147
|
-
/** ROLE */
|
|
148
118
|
role?: UsersRolesEnum;
|
|
149
|
-
/** 생년월일 */
|
|
150
119
|
birthDate?: string;
|
|
151
|
-
/** 성별 */
|
|
152
120
|
gender?: UsersGenderEnum;
|
|
153
121
|
}
|
|
154
|
-
|
|
155
|
-
export interface UpdateUserResponseDto {
|
|
156
|
-
/** 사용자 고유 ID */
|
|
122
|
+
export interface UpdateUserDataDto {
|
|
157
123
|
id: number;
|
|
158
|
-
/** 사용자 ID (로그인용) */
|
|
159
124
|
userId: string;
|
|
160
|
-
/** 사용자 이름 */
|
|
161
125
|
name: string;
|
|
162
|
-
/** 이메일 */
|
|
163
126
|
email: string;
|
|
164
|
-
/** 전화번호 */
|
|
165
127
|
phoneNumber?: string;
|
|
166
|
-
/** 프로필 이미지 URL */
|
|
167
128
|
profileImageUrl?: string;
|
|
168
|
-
/** 생년월일 */
|
|
169
129
|
birthDate?: string;
|
|
170
|
-
/** 성별 */
|
|
171
130
|
gender?: UsersGenderEnum;
|
|
172
|
-
/** 계정 생성일 */
|
|
173
131
|
createdAt: string;
|
|
174
|
-
/** 마지막 업데이트일 */
|
|
175
132
|
updatedAt: string;
|
|
176
|
-
/** 계정 상태 */
|
|
177
133
|
status: UsersStatusEnum;
|
|
178
|
-
/** 계정 역할 */
|
|
179
134
|
role: UsersRolesEnum;
|
|
180
|
-
/** 이메일 인증 여부 */
|
|
181
135
|
emailVerified: boolean;
|
|
182
|
-
/** 전화번호 인증 여부 */
|
|
183
136
|
phoneVerified: boolean;
|
|
184
137
|
}
|
|
138
|
+
export interface UpdateUserResponseDto {
|
|
139
|
+
success: boolean;
|
|
140
|
+
message: string;
|
|
141
|
+
data: UpdateUserDataDto;
|
|
142
|
+
}
|
|
@@ -4,13 +4,11 @@
|
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.UsersGenderEnum = exports.UsersStatusEnum = exports.UsersRolesEnum = void 0;
|
|
7
|
-
/** 사용자 역할 열거형 */
|
|
8
7
|
var UsersRolesEnum;
|
|
9
8
|
(function (UsersRolesEnum) {
|
|
10
9
|
UsersRolesEnum["ADMIN"] = "ADMIN";
|
|
11
10
|
UsersRolesEnum["USER"] = "USER";
|
|
12
11
|
})(UsersRolesEnum || (exports.UsersRolesEnum = UsersRolesEnum = {}));
|
|
13
|
-
/** 사용자 상태 열거형 */
|
|
14
12
|
var UsersStatusEnum;
|
|
15
13
|
(function (UsersStatusEnum) {
|
|
16
14
|
UsersStatusEnum["ACTIVE"] = "ACTIVE";
|
|
@@ -18,7 +16,6 @@ var UsersStatusEnum;
|
|
|
18
16
|
UsersStatusEnum["SUSPENDED"] = "SUSPENDED";
|
|
19
17
|
UsersStatusEnum["PENDING_VERIFICATION"] = "PENDING_VERIFICATION";
|
|
20
18
|
})(UsersStatusEnum || (exports.UsersStatusEnum = UsersStatusEnum = {}));
|
|
21
|
-
/** 사용자 성별 열거형 */
|
|
22
19
|
var UsersGenderEnum;
|
|
23
20
|
(function (UsersGenderEnum) {
|
|
24
21
|
UsersGenderEnum["MALE"] = "MALE";
|
package/package.json
CHANGED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 인증 관련 DTO 정의
|
|
3
|
-
*/
|
|
4
|
-
/** 로그인 요청 DTO */
|
|
5
|
-
export interface LoginRequestDto {
|
|
6
|
-
/** 사용자 ID */
|
|
7
|
-
userId: string;
|
|
8
|
-
/** 비밀번호 */
|
|
9
|
-
password: string;
|
|
10
|
-
}
|
|
11
|
-
/** 토큰 데이터 DTO */
|
|
12
|
-
export interface TokenDataDto {
|
|
13
|
-
/** 액세스 토큰 */
|
|
14
|
-
accessToken: string;
|
|
15
|
-
/** 리프레시 토큰 */
|
|
16
|
-
refreshToken: string;
|
|
17
|
-
}
|
|
18
|
-
/** 로그인 응답 DTO */
|
|
19
|
-
export interface LoginResponseDto {
|
|
20
|
-
/** 요청 성공 여부 */
|
|
21
|
-
success: boolean;
|
|
22
|
-
/** 응답 메시지 */
|
|
23
|
-
message: string;
|
|
24
|
-
/** 토큰 데이터 */
|
|
25
|
-
data: TokenDataDto;
|
|
26
|
-
}
|
|
27
|
-
/** 회원가입 요청 DTO */
|
|
28
|
-
export interface RegisterRequestDto {
|
|
29
|
-
/** 사용자 ID (로그인용) */
|
|
30
|
-
userId: string;
|
|
31
|
-
/** 사용자 이름 */
|
|
32
|
-
name: string;
|
|
33
|
-
/** 이메일 */
|
|
34
|
-
email: string;
|
|
35
|
-
/** 비밀번호 */
|
|
36
|
-
password: string;
|
|
37
|
-
/** 비밀번호 확인 */
|
|
38
|
-
confirmPassword: string;
|
|
39
|
-
/** 전화번호 (선택) */
|
|
40
|
-
phoneNumber?: string;
|
|
41
|
-
}
|
|
42
|
-
/** 회원가입 응답 DTO */
|
|
43
|
-
export interface RegisterResponseDto {
|
|
44
|
-
/** 요청 성공 여부 */
|
|
45
|
-
success: boolean;
|
|
46
|
-
/** 응답 메시지 */
|
|
47
|
-
message: string;
|
|
48
|
-
/** 토큰 데이터 */
|
|
49
|
-
data: TokenDataDto;
|
|
50
|
-
}
|
|
51
|
-
/** 사용자 삭제 요청 DTO */
|
|
52
|
-
export interface DeleteUserRequestDto {
|
|
53
|
-
/** 삭제할 사용자 ID */
|
|
54
|
-
userId: string;
|
|
55
|
-
/** 사용자 비밀번호 (본인 확인용) */
|
|
56
|
-
password: string;
|
|
57
|
-
}
|
|
58
|
-
/** 사용자 삭제 응답 DTO */
|
|
59
|
-
export interface DeleteUserResponseDto {
|
|
60
|
-
/** 요청 성공 여부 */
|
|
61
|
-
success: boolean;
|
|
62
|
-
/** 응답 메시지 */
|
|
63
|
-
message: string;
|
|
64
|
-
/** 삭제된 사용자 정보 */
|
|
65
|
-
data: {
|
|
66
|
-
userId: string;
|
|
67
|
-
};
|
|
68
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 공통 API 응답 구조 DTO
|
|
3
|
-
*/
|
|
4
|
-
/** 기본 API 응답 DTO */
|
|
5
|
-
export interface BaseResponseDto<T = any> {
|
|
6
|
-
/** 요청 성공 여부 */
|
|
7
|
-
success: boolean;
|
|
8
|
-
/** 응답 메시지 */
|
|
9
|
-
message: string;
|
|
10
|
-
/** 응답 데이터 */
|
|
11
|
-
data: T;
|
|
12
|
-
}
|
|
13
|
-
/** 성공 응답 생성 함수 */
|
|
14
|
-
export declare function createSuccessResponse<T>(data: T, message?: string): BaseResponseDto<T>;
|
|
15
|
-
/** 에러 응답 생성 함수 */
|
|
16
|
-
export declare function createErrorResponse<T = null>(message: string, data?: T): BaseResponseDto<T>;
|
package/dist/dto/index.d.ts
DELETED
package/dist/dto/index.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* DTO Export Index
|
|
4
|
-
* 모든 DTO 클래스들을 중앙에서 관리하고 export
|
|
5
|
-
*/
|
|
6
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
-
if (k2 === undefined) k2 = k;
|
|
8
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
-
}
|
|
12
|
-
Object.defineProperty(o, k2, desc);
|
|
13
|
-
}) : (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
o[k2] = m[k];
|
|
16
|
-
}));
|
|
17
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
18
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
19
|
-
};
|
|
20
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
// Auth 관련 DTO
|
|
22
|
-
__exportStar(require("./auth/auth.dto"), exports);
|
|
23
|
-
// Common 관련 DTO
|
|
24
|
-
__exportStar(require("./common/response.dto"), exports);
|
|
25
|
-
// User 관련 DTO
|
|
26
|
-
__exportStar(require("./user/user.dto"), exports);
|
package/dist/users/index.d.ts
DELETED
package/dist/users/index.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Users 모듈 타입 정의 export
|
|
4
|
-
*/
|
|
5
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
-
}
|
|
11
|
-
Object.defineProperty(o, k2, desc);
|
|
12
|
-
}) : (function(o, m, k, k2) {
|
|
13
|
-
if (k2 === undefined) k2 = k;
|
|
14
|
-
o[k2] = m[k];
|
|
15
|
-
}));
|
|
16
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
17
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
18
|
-
};
|
|
19
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
// Login 관련 타입들
|
|
21
|
-
__exportStar(require("./login.dto"), exports);
|
|
22
|
-
// Me (사용자 프로필) 관련 타입들
|
|
23
|
-
__exportStar(require("./me.dto"), exports);
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 사용자 로그인 관련 DTO 정의
|
|
3
|
-
*/
|
|
4
|
-
export interface LoginRequestDto {
|
|
5
|
-
/** 이메일 또는 사용자명 */
|
|
6
|
-
username: string;
|
|
7
|
-
/** 비밀번호 */
|
|
8
|
-
password: string;
|
|
9
|
-
/** 자동 로그인 여부 */
|
|
10
|
-
rememberMe?: boolean;
|
|
11
|
-
}
|
|
12
|
-
export interface LoginResponseDto {
|
|
13
|
-
/** 인증 토큰 */
|
|
14
|
-
accessToken: string;
|
|
15
|
-
/** 리프레시 토큰 */
|
|
16
|
-
refreshToken: string;
|
|
17
|
-
/** 토큰 만료 시간 (Unix timestamp) */
|
|
18
|
-
expiresAt: number;
|
|
19
|
-
/** 사용자 기본 정보 */
|
|
20
|
-
user: {
|
|
21
|
-
/** 사용자 ID */
|
|
22
|
-
id: number;
|
|
23
|
-
/** 사용자명 */
|
|
24
|
-
username: string;
|
|
25
|
-
/** 이메일 */
|
|
26
|
-
email: string;
|
|
27
|
-
/** 프로필 이미지 URL */
|
|
28
|
-
profileImageUrl?: string;
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
export interface LoginErrorDto {
|
|
32
|
-
/** 에러 코드 */
|
|
33
|
-
code: "INVALID_CREDENTIALS" | "ACCOUNT_LOCKED" | "ACCOUNT_NOT_VERIFIED" | "SERVER_ERROR";
|
|
34
|
-
/** 에러 메시지 */
|
|
35
|
-
message: string;
|
|
36
|
-
/** 추가 정보 */
|
|
37
|
-
details?: {
|
|
38
|
-
/** 계정 잠금 해제 시간 (Unix timestamp) */
|
|
39
|
-
unlockAt?: number;
|
|
40
|
-
/** 재시도 가능 횟수 */
|
|
41
|
-
remainingAttempts?: number;
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
export interface RefreshTokenRequestDto {
|
|
45
|
-
/** 리프레시 토큰 */
|
|
46
|
-
refreshToken: string;
|
|
47
|
-
}
|
|
48
|
-
export interface RefreshTokenResponseDto {
|
|
49
|
-
/** 새로운 액세스 토큰 */
|
|
50
|
-
accessToken: string;
|
|
51
|
-
/** 새로운 리프레시 토큰 */
|
|
52
|
-
refreshToken: string;
|
|
53
|
-
/** 토큰 만료 시간 (Unix timestamp) */
|
|
54
|
-
expiresAt: number;
|
|
55
|
-
}
|
package/dist/users/me.dto.d.ts
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 사용자 프로필 관련 DTO 정의
|
|
3
|
-
*/
|
|
4
|
-
export interface UserProfileDto {
|
|
5
|
-
/** 사용자 ID */
|
|
6
|
-
id: number;
|
|
7
|
-
/** 사용자명 */
|
|
8
|
-
username: string;
|
|
9
|
-
/** 이메일 */
|
|
10
|
-
email: string;
|
|
11
|
-
/** 전체 이름 */
|
|
12
|
-
fullName?: string;
|
|
13
|
-
/** 전화번호 */
|
|
14
|
-
phoneNumber?: string;
|
|
15
|
-
/** 프로필 이미지 URL */
|
|
16
|
-
profileImageUrl?: string;
|
|
17
|
-
/** 생년월일 */
|
|
18
|
-
birthDate?: string;
|
|
19
|
-
/** 성별 */
|
|
20
|
-
gender?: "MALE" | "FEMALE" | "OTHER";
|
|
21
|
-
/** 계정 생성일 */
|
|
22
|
-
createdAt: string;
|
|
23
|
-
/** 마지막 업데이트일 */
|
|
24
|
-
updatedAt: string;
|
|
25
|
-
/** 계정 상태 */
|
|
26
|
-
status: "ACTIVE" | "INACTIVE" | "SUSPENDED" | "PENDING_VERIFICATION";
|
|
27
|
-
/** 이메일 인증 여부 */
|
|
28
|
-
emailVerified: boolean;
|
|
29
|
-
/** 전화번호 인증 여부 */
|
|
30
|
-
phoneVerified: boolean;
|
|
31
|
-
}
|
|
32
|
-
export interface GetMeResponseDto {
|
|
33
|
-
/** 사용자 프로필 정보 */
|
|
34
|
-
profile: UserProfileDto;
|
|
35
|
-
/** 사용자 권한 */
|
|
36
|
-
permissions: string[];
|
|
37
|
-
/** 사용자 역할 */
|
|
38
|
-
roles: string[];
|
|
39
|
-
/** 구독 정보 */
|
|
40
|
-
subscription?: {
|
|
41
|
-
/** 구독 플랜 */
|
|
42
|
-
plan: "FREE" | "PREMIUM" | "ENTERPRISE";
|
|
43
|
-
/** 구독 시작일 */
|
|
44
|
-
startDate: string;
|
|
45
|
-
/** 구독 종료일 */
|
|
46
|
-
endDate?: string;
|
|
47
|
-
/** 구독 상태 */
|
|
48
|
-
status: "ACTIVE" | "EXPIRED" | "CANCELLED";
|
|
49
|
-
};
|
|
50
|
-
/** 설정 정보 */
|
|
51
|
-
settings: {
|
|
52
|
-
/** 언어 설정 */
|
|
53
|
-
language: string;
|
|
54
|
-
/** 시간대 설정 */
|
|
55
|
-
timezone: string;
|
|
56
|
-
/** 알림 설정 */
|
|
57
|
-
notifications: {
|
|
58
|
-
/** 이메일 알림 */
|
|
59
|
-
email: boolean;
|
|
60
|
-
/** 푸시 알림 */
|
|
61
|
-
push: boolean;
|
|
62
|
-
/** SMS 알림 */
|
|
63
|
-
sms: boolean;
|
|
64
|
-
};
|
|
65
|
-
/** 개인정보 설정 */
|
|
66
|
-
privacy: {
|
|
67
|
-
/** 프로필 공개 여부 */
|
|
68
|
-
profileVisible: boolean;
|
|
69
|
-
/** 온라인 상태 표시 여부 */
|
|
70
|
-
showOnlineStatus: boolean;
|
|
71
|
-
};
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
export interface UpdateMeRequestDto {
|
|
75
|
-
/** 전체 이름 */
|
|
76
|
-
fullName?: string;
|
|
77
|
-
/** 전화번호 */
|
|
78
|
-
phoneNumber?: string;
|
|
79
|
-
/** 프로필 이미지 URL */
|
|
80
|
-
profileImageUrl?: string;
|
|
81
|
-
/** 생년월일 */
|
|
82
|
-
birthDate?: string;
|
|
83
|
-
/** 성별 */
|
|
84
|
-
gender?: "MALE" | "FEMALE" | "OTHER";
|
|
85
|
-
/** 설정 정보 (부분 업데이트 가능) */
|
|
86
|
-
settings?: {
|
|
87
|
-
/** 언어 설정 */
|
|
88
|
-
language?: string;
|
|
89
|
-
/** 시간대 설정 */
|
|
90
|
-
timezone?: string;
|
|
91
|
-
/** 알림 설정 */
|
|
92
|
-
notifications?: {
|
|
93
|
-
email?: boolean;
|
|
94
|
-
push?: boolean;
|
|
95
|
-
sms?: boolean;
|
|
96
|
-
};
|
|
97
|
-
/** 개인정보 설정 */
|
|
98
|
-
privacy?: {
|
|
99
|
-
profileVisible?: boolean;
|
|
100
|
-
showOnlineStatus?: boolean;
|
|
101
|
-
};
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
export interface UpdateMeResponseDto {
|
|
105
|
-
/** 업데이트된 사용자 프로필 정보 */
|
|
106
|
-
profile: UserProfileDto;
|
|
107
|
-
/** 업데이트 성공 메시지 */
|
|
108
|
-
message: string;
|
|
109
|
-
}
|
|
110
|
-
export interface ChangePasswordRequestDto {
|
|
111
|
-
/** 현재 비밀번호 */
|
|
112
|
-
currentPassword: string;
|
|
113
|
-
/** 새 비밀번호 */
|
|
114
|
-
newPassword: string;
|
|
115
|
-
/** 새 비밀번호 확인 */
|
|
116
|
-
confirmPassword: string;
|
|
117
|
-
}
|
|
118
|
-
export interface ChangePasswordResponseDto {
|
|
119
|
-
/** 성공 메시지 */
|
|
120
|
-
message: string;
|
|
121
|
-
/** 새 토큰 발급 여부 */
|
|
122
|
-
tokenRefreshRequired: boolean;
|
|
123
|
-
}
|
|
124
|
-
export interface DeleteAccountRequestDto {
|
|
125
|
-
/** 비밀번호 확인 */
|
|
126
|
-
password: string;
|
|
127
|
-
/** 삭제 사유 */
|
|
128
|
-
reason?: string;
|
|
129
|
-
}
|
|
130
|
-
export interface DeleteAccountResponseDto {
|
|
131
|
-
/** 성공 메시지 */
|
|
132
|
-
message: string;
|
|
133
|
-
/** 계정 삭제 예정일 (Unix timestamp) */
|
|
134
|
-
scheduledDeletionDate: number;
|
|
135
|
-
}
|
|
File without changes
|