byzip-v2-sdk 1.0.1 → 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 CHANGED
@@ -2,108 +2,234 @@
2
2
 
3
3
  분양모음집 V2 프로젝트의 프론트엔드와 백엔드 간 타입 통일을 위한 TypeScript SDK입니다.
4
4
 
5
- ## 설치
5
+ ## ✨ 특징
6
+
7
+ - 🚀 **런타임 의존성 없음** - 순수 TypeScript 타입 정의만 제공
8
+ - 📦 **가벼운 번들** - 추가 패키지 설치 불필요
9
+ - 🔒 **타입 안전성** - 완전한 TypeScript 타입 체크 지원
10
+ - 🌐 **범용 호환성** - 모든 JavaScript/TypeScript 환경에서 사용 가능
11
+ - 🤖 **자동 업데이트** - 백엔드 타입 변경 시 자동으로 배포
12
+
13
+ ## 📦 설치
6
14
 
7
15
  ```bash
8
16
  npm install byzip-v2-sdk
9
17
  ```
10
18
 
11
- ## 사용법
19
+ ## 🚀 사용법
12
20
 
13
21
  ### 기본 import
14
22
 
15
23
  ```typescript
16
24
  import {
25
+ // 인증 관련
17
26
  LoginRequestDto,
18
27
  LoginResponseDto,
28
+ RegisterRequestDto,
29
+ TokenDataDto,
30
+
31
+ // 사용자 관련
19
32
  GetMeResponseDto,
20
- UpdateMeRequestDto,
21
- } from "byzip-v2-sdk";
33
+ UpdateUserRequestDto,
34
+ UsersRolesEnum,
35
+ UsersStatusEnum,
36
+
37
+ // 공통 응답
38
+ BaseResponseDto,
39
+ createSuccessResponse,
40
+ createErrorResponse,
41
+ } from 'byzip-v2-sdk';
22
42
  ```
23
43
 
24
44
  ### 사용 예제
25
45
 
26
- #### 로그인 타입 사용
46
+ #### 🔐 인증 관련
27
47
 
28
48
  ```typescript
29
- import { LoginRequestDto, LoginResponseDto } from "byzip-v2-sdk";
49
+ import {
50
+ LoginRequestDto,
51
+ LoginResponseDto,
52
+ RegisterRequestDto,
53
+ } from 'byzip-v2-sdk';
30
54
 
31
55
  // 로그인 요청
32
56
  const loginRequest: LoginRequestDto = {
33
- username: "user@example.com",
34
- password: "password123",
35
- rememberMe: true,
57
+ userId: 'user123',
58
+ password: 'password123!',
59
+ };
60
+
61
+ // 회원가입 요청
62
+ const registerRequest: RegisterRequestDto = {
63
+ userId: 'newuser',
64
+ name: '홍길동',
65
+ email: 'user@example.com',
66
+ password: 'password123!',
67
+ confirmPassword: 'password123!',
68
+ phoneNumber: '010-1234-5678', // 선택사항
36
69
  };
37
70
 
38
- // 로그인 응답 타입 지정
71
+ // 로그인 응답 처리
39
72
  const handleLoginResponse = (response: LoginResponseDto) => {
40
- console.log("Access Token:", response.accessToken);
41
- console.log("User Info:", response.user);
73
+ if (response.success) {
74
+ console.log('로그인 성공:', response.data.accessToken);
75
+ console.log('메시지:', response.message);
76
+ }
42
77
  };
43
78
  ```
44
79
 
45
- #### 사용자 프로필 타입 사용
80
+ #### 👤 사용자 프로필 관련
46
81
 
47
82
  ```typescript
48
- import { GetMeResponseDto, UpdateMeRequestDto } from "byzip-v2-sdk";
83
+ import {
84
+ GetMeResponseDto,
85
+ UpdateUserRequestDto,
86
+ UsersGenderEnum,
87
+ UsersRolesEnum,
88
+ } from 'byzip-v2-sdk';
49
89
 
50
- // 프로필 조회 응답 타입 지정
90
+ // 프로필 조회 응답 처리
51
91
  const handleProfileResponse = (response: GetMeResponseDto) => {
52
- console.log("Profile:", response.profile);
53
- console.log("Permissions:", response.permissions);
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);
54
98
  };
55
99
 
56
100
  // 프로필 업데이트 요청
57
- const updateRequest: UpdateMeRequestDto = {
58
- fullName: "홍길동",
59
- phoneNumber: "010-1234-5678",
60
- settings: {
61
- language: "ko",
62
- notifications: {
63
- email: true,
64
- push: false,
65
- },
66
- },
101
+ const updateRequest: UpdateUserRequestDto = {
102
+ name: '홍길동',
103
+ email: 'newemail@example.com',
104
+ phoneNumber: '010-9876-5432',
105
+ birthDate: '1990-01-01',
106
+ gender: UsersGenderEnum.MALE,
107
+ role: UsersRolesEnum.USER,
108
+ };
109
+ ```
110
+
111
+ #### 📝 공통 응답 처리
112
+
113
+ ```typescript
114
+ import {
115
+ BaseResponseDto,
116
+ createSuccessResponse,
117
+ createErrorResponse,
118
+ } from 'byzip-v2-sdk';
119
+
120
+ // 성공 응답 생성
121
+ const successResponse = createSuccessResponse(
122
+ { message: '처리 완료' },
123
+ '요청이 성공적으로 처리되었습니다.',
124
+ );
125
+
126
+ // 에러 응답 생성
127
+ const errorResponse = createErrorResponse('처리 중 오류가 발생했습니다.');
128
+
129
+ // 응답 타입 처리
130
+ const handleResponse = <T>(response: BaseResponseDto<T>) => {
131
+ if (response.success) {
132
+ console.log('성공:', response.data);
133
+ } else {
134
+ console.error('실패:', response.message);
135
+ }
67
136
  };
68
137
  ```
69
138
 
70
- ## 타입 정의
139
+ ## 📚 타입 정의
71
140
 
72
- ### Users 모듈
141
+ ### 🔐 인증 관련 (Auth)
73
142
 
74
- #### Login DTO
143
+ | 타입 | 설명 |
144
+ | ------------------------- | ---------------- |
145
+ | `LoginRequestDto` | 로그인 요청 |
146
+ | `LoginResponseDto` | 로그인 응답 |
147
+ | `RegisterRequestDto` | 회원가입 요청 |
148
+ | `RegisterResponseDto` | 회원가입 응답 |
149
+ | `TokenDataDto` | 토큰 데이터 |
150
+ | `RefreshTokenRequestDto` | 토큰 갱신 요청 |
151
+ | `RefreshTokenResponseDto` | 토큰 갱신 응답 |
152
+ | `LogoutResponseDto` | 로그아웃 응답 |
153
+ | `DeleteUserRequestDto` | 사용자 삭제 요청 |
154
+ | `DeleteUserResponseDto` | 사용자 삭제 응답 |
75
155
 
76
- - `LoginRequestDto`: 로그인 요청
77
- - `LoginResponseDto`: 로그인 응답
78
- - `LoginErrorDto`: 로그인 에러 응답
79
- - `RefreshTokenRequestDto`: 토큰 갱신 요청
80
- - `RefreshTokenResponseDto`: 토큰 갱신 응답
156
+ ### 👤 사용자 관련 (User)
81
157
 
82
- #### Me (사용자 프로필) DTO
158
+ | 타입 | 설명 |
159
+ | --------------------------- | --------------------- |
160
+ | `UsersModelDto` | 사용자 모델 |
161
+ | `GetMeResponseDto` | 내 정보 조회 응답 |
162
+ | `GetMeDataDto` | 내 정보 데이터 |
163
+ | `UpdateUserRequestDto` | 사용자 정보 수정 요청 |
164
+ | `UpdateUserResponseDto` | 사용자 정보 수정 응답 |
165
+ | `GetAllUsersResponseDto` | 모든 사용자 조회 응답 |
166
+ | `UserSummaryDto` | 사용자 요약 정보 |
167
+ | `ChangePasswordRequestDto` | 비밀번호 변경 요청 |
168
+ | `ChangePasswordResponseDto` | 비밀번호 변경 응답 |
169
+ | `DeleteAccountRequestDto` | 계정 삭제 요청 |
170
+ | `DeleteAccountResponseDto` | 계정 삭제 응답 |
83
171
 
84
- - `UserProfileDto`: 사용자 기본 정보
85
- - `GetMeResponseDto`: 사용자 프로필 조회 응답
86
- - `UpdateMeRequestDto`: 사용자 프로필 업데이트 요청
87
- - `UpdateMeResponseDto`: 사용자 프로필 업데이트 응답
88
- - `ChangePasswordRequestDto`: 비밀번호 변경 요청
89
- - `ChangePasswordResponseDto`: 비밀번호 변경 응답
90
- - `DeleteAccountRequestDto`: 계정 삭제 요청
91
- - `DeleteAccountResponseDto`: 계정 삭제 응답
172
+ ### 📊 열거형 (Enums)
92
173
 
93
- ## 개발
174
+ | 열거형 | 값 |
175
+ | ----------------- | --------------------------------------------------------- |
176
+ | `UsersRolesEnum` | `ADMIN`, `USER` |
177
+ | `UsersStatusEnum` | `ACTIVE`, `INACTIVE`, `SUSPENDED`, `PENDING_VERIFICATION` |
178
+ | `UsersGenderEnum` | `MALE`, `FEMALE`, `OTHER` |
179
+
180
+ ### 📦 공통 (Common)
181
+
182
+ | 타입 | 설명 |
183
+ | ---------------------------- | ------------------- |
184
+ | `BaseResponseDto<T>` | 기본 API 응답 구조 |
185
+ | `createSuccessResponse<T>()` | 성공 응답 생성 함수 |
186
+ | `createErrorResponse<T>()` | 에러 응답 생성 함수 |
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
+
201
+ ## 🛠️ 개발
202
+
203
+ ### 로컬에서 타입 추출
204
+
205
+ ```bash
206
+ npm run sdk:extract
207
+ ```
94
208
 
95
209
  ### 빌드
96
210
 
97
211
  ```bash
98
- npm run build
212
+ npm run sdk:build
99
213
  ```
100
214
 
101
- ### 배포
215
+ ### 수동 배포
102
216
 
103
217
  ```bash
104
- npm publish
218
+ npm run sdk:publish
105
219
  ```
106
220
 
107
- ## 라이선스
221
+ ## 📄 라이선스
108
222
 
109
223
  ISC
224
+
225
+ ---
226
+
227
+ ## 🔄 변경 로그
228
+
229
+ ### v1.0.2
230
+
231
+ - ✅ 모든 DTO 클래스를 인터페이스로 변환
232
+ - ✅ 런타임 의존성 제거 (`@nestjs/swagger` 제거)
233
+ - ✅ 타입 안전성 향상
234
+ - ✅ 번들 크기 최적화
235
+ - ✅ GitHub Actions 자동 배포 시스템 구축
@@ -0,0 +1 @@
1
+ export declare const SAMPLE = "sample";
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SAMPLE = void 0;
4
+ exports.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
+ }
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  /**
3
- * 사용자 프로필 관련 DTO 정의
3
+ * 인증 관련 DTO 정의
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
package/dist/index.d.ts CHANGED
@@ -1,11 +1,10 @@
1
1
  /**
2
2
  * ByZip V2 SDK
3
- * 프론트엔드와 백엔드 타입 통일을 위한 TypeScript SDK
3
+ * 자동 생성된 파일입니다. 수정하지 마세요.
4
4
  */
5
- export * from "./users";
6
- export declare const SDK_VERSION = "1.0.0";
7
- export declare const SDK_INFO: {
8
- readonly name: "byzip-v2-sdk";
9
- readonly version: "1.0.0";
10
- readonly description: "분양모음집 V2 SDK - 프론트엔드와 백엔드 간 타입 통일을 위한 TypeScript SDK";
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
- * 프론트엔드와 백엔드 타입 통일을 위한 TypeScript SDK
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,14 +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
- exports.SDK_INFO = exports.SDK_VERSION = void 0;
22
- // Users 모듈
23
- __exportStar(require("./users"), exports);
24
- // SDK 버전 정보
25
- exports.SDK_VERSION = "1.0.0";
26
- // SDK 정보
27
- exports.SDK_INFO = {
28
- name: "byzip-v2-sdk",
29
- version: exports.SDK_VERSION,
30
- description: "분양모음집 V2 SDK - 프론트엔드와 백엔드 간 타입 통일을 위한 TypeScript SDK",
31
- };
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,10 @@
1
+ export interface JwtPayload {
2
+ /** 사용자 ID (subject) */
3
+ sub: string;
4
+ /** 토큰 타입 */
5
+ type: 'access' | 'refresh';
6
+ /** 토큰 발급 시간 (issued at) */
7
+ iat?: number;
8
+ /** 토큰 만료 시간 (expiration time) */
9
+ exp?: number;
10
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // GitHub Actions 테스트
@@ -0,0 +1,8 @@
1
+ /**
2
+ * 공통 API 응답 구조 DTO
3
+ */
4
+ export interface BaseResponseDto<T = any> {
5
+ success: boolean;
6
+ message: string;
7
+ data: T;
8
+ }
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  /**
3
- * 사용자 로그인 관련 DTO 정의
3
+ * 공통 API 응답 구조 DTO
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -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>;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ /**
3
+ * API 응답 생성 헬퍼 함수
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.createSuccessResponse = createSuccessResponse;
7
+ exports.createErrorResponse = createErrorResponse;
8
+ /**
9
+ * 성공 응답 생성
10
+ */
11
+ function createSuccessResponse(data, message = '요청이 성공적으로 처리되었습니다.') {
12
+ return {
13
+ success: true,
14
+ message,
15
+ data
16
+ };
17
+ }
18
+ /**
19
+ * 에러 응답 생성
20
+ */
21
+ function createErrorResponse(message, data = null) {
22
+ return {
23
+ success: false,
24
+ message,
25
+ data
26
+ };
27
+ }
@@ -0,0 +1,142 @@
1
+ /**
2
+ * 사용자 프로필 관련 DTO 정의
3
+ */
4
+ export declare enum UsersRolesEnum {
5
+ ADMIN = "ADMIN",
6
+ USER = "USER"
7
+ }
8
+ export declare enum UsersStatusEnum {
9
+ ACTIVE = "ACTIVE",
10
+ INACTIVE = "INACTIVE",
11
+ SUSPENDED = "SUSPENDED",
12
+ PENDING_VERIFICATION = "PENDING_VERIFICATION"
13
+ }
14
+ export declare enum UsersGenderEnum {
15
+ MALE = "MALE",
16
+ FEMALE = "FEMALE",
17
+ OTHER = "OTHER"
18
+ }
19
+ export interface UsersModelDto {
20
+ /** 사용자 고유 ID */
21
+ id: number;
22
+ /** 사용자 ID (로그인용) */
23
+ userId: string;
24
+ /** 사용자 비밀번호 */
25
+ password: string;
26
+ /** 사용자 이름 */
27
+ name: string;
28
+ /** 이메일 */
29
+ email: string;
30
+ /** 전화번호 */
31
+ phoneNumber?: string;
32
+ /** 프로필 이미지 URL */
33
+ profileImageUrl?: string;
34
+ /** 생년월일 */
35
+ birthDate?: string;
36
+ /** 성별 */
37
+ gender?: UsersGenderEnum;
38
+ /** 계정 생성일 */
39
+ createdAt: string;
40
+ /** 마지막 업데이트일 */
41
+ updatedAt: string;
42
+ /** 계정 상태 */
43
+ status: UsersStatusEnum;
44
+ /** 계정 역할 */
45
+ role: UsersRolesEnum;
46
+ /** 이메일 인증 여부 */
47
+ emailVerified: boolean;
48
+ /** 전화번호 인증 여부 */
49
+ phoneVerified: boolean;
50
+ }
51
+ export interface GetMeDataDto {
52
+ id: number;
53
+ userId: string;
54
+ name: string;
55
+ email: string;
56
+ phoneNumber?: string;
57
+ profileImageUrl?: string;
58
+ birthDate?: string;
59
+ gender?: UsersGenderEnum;
60
+ createdAt: string;
61
+ updatedAt: string;
62
+ status: UsersStatusEnum;
63
+ role: UsersRolesEnum;
64
+ emailVerified: boolean;
65
+ phoneVerified: boolean;
66
+ }
67
+ export interface GetMeResponseDto {
68
+ success: boolean;
69
+ message: string;
70
+ data: GetMeDataDto;
71
+ }
72
+ export interface ChangePasswordRequestDto {
73
+ currentPassword: string;
74
+ newPassword: string;
75
+ confirmPassword: string;
76
+ }
77
+ export interface ChangePasswordDataDto {
78
+ tokenRefreshRequired: boolean;
79
+ }
80
+ export interface ChangePasswordResponseDto {
81
+ success: boolean;
82
+ message: string;
83
+ data: ChangePasswordDataDto;
84
+ }
85
+ export interface DeleteAccountRequestDto {
86
+ password: string;
87
+ reason?: string;
88
+ }
89
+ export interface DeleteAccountDataDto {
90
+ scheduledDeletionDate: number;
91
+ }
92
+ export interface DeleteAccountResponseDto {
93
+ success: boolean;
94
+ message: string;
95
+ data: DeleteAccountDataDto;
96
+ }
97
+ export interface UserSummaryDto {
98
+ id: number;
99
+ userId: string;
100
+ name: string;
101
+ email: string;
102
+ phoneNumber?: string;
103
+ profileImageUrl?: string;
104
+ createdAt: string;
105
+ status: UsersStatusEnum;
106
+ role: UsersRolesEnum;
107
+ emailVerified: boolean;
108
+ }
109
+ export interface GetAllUsersResponseDto {
110
+ success: boolean;
111
+ message: string;
112
+ data: UserSummaryDto[];
113
+ }
114
+ export interface UpdateUserRequestDto {
115
+ name?: string;
116
+ email?: string;
117
+ phoneNumber?: string;
118
+ role?: UsersRolesEnum;
119
+ birthDate?: string;
120
+ gender?: UsersGenderEnum;
121
+ }
122
+ export interface UpdateUserDataDto {
123
+ id: number;
124
+ userId: string;
125
+ name: string;
126
+ email: string;
127
+ phoneNumber?: string;
128
+ profileImageUrl?: string;
129
+ birthDate?: string;
130
+ gender?: UsersGenderEnum;
131
+ createdAt: string;
132
+ updatedAt: string;
133
+ status: UsersStatusEnum;
134
+ role: UsersRolesEnum;
135
+ emailVerified: boolean;
136
+ phoneVerified: boolean;
137
+ }
138
+ export interface UpdateUserResponseDto {
139
+ success: boolean;
140
+ message: string;
141
+ data: UpdateUserDataDto;
142
+ }
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ /**
3
+ * 사용자 프로필 관련 DTO 정의
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.UsersGenderEnum = exports.UsersStatusEnum = exports.UsersRolesEnum = void 0;
7
+ var UsersRolesEnum;
8
+ (function (UsersRolesEnum) {
9
+ UsersRolesEnum["ADMIN"] = "ADMIN";
10
+ UsersRolesEnum["USER"] = "USER";
11
+ })(UsersRolesEnum || (exports.UsersRolesEnum = UsersRolesEnum = {}));
12
+ var UsersStatusEnum;
13
+ (function (UsersStatusEnum) {
14
+ UsersStatusEnum["ACTIVE"] = "ACTIVE";
15
+ UsersStatusEnum["INACTIVE"] = "INACTIVE";
16
+ UsersStatusEnum["SUSPENDED"] = "SUSPENDED";
17
+ UsersStatusEnum["PENDING_VERIFICATION"] = "PENDING_VERIFICATION";
18
+ })(UsersStatusEnum || (exports.UsersStatusEnum = UsersStatusEnum = {}));
19
+ var UsersGenderEnum;
20
+ (function (UsersGenderEnum) {
21
+ UsersGenderEnum["MALE"] = "MALE";
22
+ UsersGenderEnum["FEMALE"] = "FEMALE";
23
+ UsersGenderEnum["OTHER"] = "OTHER";
24
+ })(UsersGenderEnum || (exports.UsersGenderEnum = UsersGenderEnum = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "byzip-v2-sdk",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -1,5 +0,0 @@
1
- /**
2
- * Users 모듈 타입 정의 export
3
- */
4
- export * from "./login.dto";
5
- export * from "./me.dto";
@@ -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
- }
@@ -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
- }