byzip-v2-sdk 1.0.2 → 1.0.4

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
@@ -8,6 +8,7 @@
8
8
  - 📦 **가벼운 번들** - 추가 패키지 설치 불필요
9
9
  - 🔒 **타입 안전성** - 완전한 TypeScript 타입 체크 지원
10
10
  - 🌐 **범용 호환성** - 모든 JavaScript/TypeScript 환경에서 사용 가능
11
+ - 🤖 **자동 업데이트** - 백엔드 타입 변경 시 자동으로 배포
11
12
 
12
13
  ## 📦 설치
13
14
 
@@ -15,97 +16,6 @@
15
16
  npm install byzip-v2-sdk
16
17
  ```
17
18
 
18
- ## 🚀 사용법
19
-
20
- ### 기본 import
21
-
22
- ```typescript
23
- import {
24
- // 인증 관련
25
- LoginRequestDto,
26
- LoginResponseDto,
27
- RegisterRequestDto,
28
- TokenDataDto,
29
-
30
- // 사용자 관련
31
- GetMeResponseDto,
32
- UpdateUserRequestDto,
33
- UsersRolesEnum,
34
- UsersStatusEnum,
35
-
36
- // 공통 응답
37
- BaseResponseDto,
38
- createSuccessResponse,
39
- createErrorResponse,
40
- } from "byzip-v2-sdk";
41
- ```
42
-
43
- ### 사용 예제
44
-
45
- #### 🔐 인증 관련
46
-
47
- ```typescript
48
- import {
49
- LoginRequestDto,
50
- LoginResponseDto,
51
- RegisterRequestDto,
52
- } from "byzip-v2-sdk";
53
-
54
- // 로그인 요청
55
- const loginRequest: LoginRequestDto = {
56
- userId: "user123",
57
- password: "password123!",
58
- };
59
-
60
- // 회원가입 요청
61
- const registerRequest: RegisterRequestDto = {
62
- userId: "newuser",
63
- name: "홍길동",
64
- email: "user@example.com",
65
- password: "password123!",
66
- confirmPassword: "password123!",
67
- phoneNumber: "010-1234-5678", // 선택사항
68
- };
69
-
70
- // 로그인 응답 처리
71
- const handleLoginResponse = (response: LoginResponseDto) => {
72
- if (response.success) {
73
- console.log("로그인 성공:", response.data.accessToken);
74
- console.log("메시지:", response.message);
75
- }
76
- };
77
- ```
78
-
79
- #### 👤 사용자 프로필 관련
80
-
81
- ```typescript
82
- import {
83
- GetMeResponseDto,
84
- UpdateUserRequestDto,
85
- UsersGenderEnum,
86
- UsersRolesEnum,
87
- } from "byzip-v2-sdk";
88
-
89
- // 프로필 조회 응답 처리
90
- const handleProfileResponse = (response: GetMeResponseDto) => {
91
- console.log("사용자 ID:", response.userId);
92
- console.log("이름:", response.name);
93
- console.log("역할:", response.role);
94
- console.log("상태:", response.status);
95
- console.log("이메일 인증:", response.emailVerified);
96
- };
97
-
98
- // 프로필 업데이트 요청
99
- const updateRequest: UpdateUserRequestDto = {
100
- name: "홍길동",
101
- email: "newemail@example.com",
102
- phoneNumber: "010-9876-5432",
103
- birthDate: "1990-01-01",
104
- gender: UsersGenderEnum.MALE,
105
- role: UsersRolesEnum.USER,
106
- };
107
- ```
108
-
109
19
  #### 📝 공통 응답 처리
110
20
 
111
21
  ```typescript
@@ -113,83 +23,58 @@ import {
113
23
  BaseResponseDto,
114
24
  createSuccessResponse,
115
25
  createErrorResponse,
116
- } from "byzip-v2-sdk";
26
+ } from 'byzip-v2-sdk';
117
27
 
118
28
  // 성공 응답 생성
119
29
  const successResponse = createSuccessResponse(
120
- { message: "처리 완료" },
121
- "요청이 성공적으로 처리되었습니다."
30
+ { message: '처리 완료' },
31
+ '요청이 성공적으로 처리되었습니다.',
122
32
  );
123
33
 
124
34
  // 에러 응답 생성
125
- const errorResponse = createErrorResponse("처리 중 오류가 발생했습니다.");
35
+ const errorResponse = createErrorResponse('처리 중 오류가 발생했습니다.');
126
36
 
127
37
  // 응답 타입 처리
128
38
  const handleResponse = <T>(response: BaseResponseDto<T>) => {
129
39
  if (response.success) {
130
- console.log("성공:", response.data);
40
+ console.log('성공:', response.data);
131
41
  } else {
132
- console.error("실패:", response.message);
42
+ console.error('실패:', response.message);
133
43
  }
134
44
  };
135
45
  ```
136
46
 
137
- ## 📚 타입 정의
138
-
139
- ### 🔐 인증 관련 (Auth)
140
-
141
- | 타입 | 설명 |
142
- | ----------------------- | ---------------- |
143
- | `LoginRequestDto` | 로그인 요청 |
144
- | `LoginResponseDto` | 로그인 응답 |
145
- | `RegisterRequestDto` | 회원가입 요청 |
146
- | `RegisterResponseDto` | 회원가입 응답 |
147
- | `TokenDataDto` | 토큰 데이터 |
148
- | `DeleteUserRequestDto` | 사용자 삭제 요청 |
149
- | `DeleteUserResponseDto` | 사용자 삭제 응답 |
150
-
151
- ### 👤 사용자 관련 (User)
152
-
153
- | 타입 | 설명 |
154
- | --------------------------- | --------------------- |
155
- | `UsersModelDto` | 사용자 모델 |
156
- | `GetMeResponseDto` | 내 정보 조회 응답 |
157
- | `UpdateUserRequestDto` | 사용자 정보 수정 요청 |
158
- | `UpdateUserResponseDto` | 사용자 정보 수정 응답 |
159
- | `GetAllUsersResponseDto` | 모든 사용자 조회 응답 |
160
- | `ChangePasswordRequestDto` | 비밀번호 변경 요청 |
161
- | `ChangePasswordResponseDto` | 비밀번호 변경 응답 |
162
- | `DeleteAccountRequestDto` | 계정 삭제 요청 |
163
- | `DeleteAccountResponseDto` | 계정 삭제 응답 |
164
-
165
- ### 📊 열거형 (Enums)
166
-
167
- | 열거형 | 값 |
168
- | ----------------- | --------------------------------------------------------- |
169
- | `UsersRolesEnum` | `ADMIN`, `USER` |
170
- | `UsersStatusEnum` | `ACTIVE`, `INACTIVE`, `SUSPENDED`, `PENDING_VERIFICATION` |
171
- | `UsersGenderEnum` | `MALE`, `FEMALE`, `OTHER` |
172
-
173
- ### 📦 공통 (Common)
174
-
175
- | 타입 | 설명 |
176
- | ---------------------------- | ------------------- |
177
- | `BaseResponseDto<T>` | 기본 API 응답 구조 |
178
- | `createSuccessResponse<T>()` | 성공 응답 생성 함수 |
179
- | `createErrorResponse<T>()` | 에러 응답 생성 함수 |
47
+ ## 🤖 자동 배포
48
+
49
+ 패키지는 백엔드 저장소의 타입 파일(`src/types/`)이 변경될 때마다 GitHub Actions를 통해 자동으로 업데이트되어 NPM에 배포됩니다.
50
+
51
+ ### 배포 프로세스
52
+
53
+ 1. 백엔드 코드의 DTO 타입 변경
54
+ 2. `main` 또는 `dev` 브랜치에 푸시
55
+ 3. GitHub Actions 자동 실행
56
+ 4. 타입 추출 및 변환 (클래스 → 인터페이스)
57
+ 5. 버전 자동 증가
58
+ 6. NPM에 자동 배포
180
59
 
181
60
  ## 🛠️ 개발
182
61
 
62
+ ### 로컬에서 타입 추출
63
+
64
+ ```bash
65
+ npm run sdk:extract
66
+ ```
67
+
183
68
  ### 빌드
184
69
 
185
70
  ```bash
186
- npm run build
71
+ npm run sdk:build
187
72
  ```
188
73
 
189
- ### 배포
74
+ ### 수동 배포
190
75
 
191
76
  ```bash
192
- npm publish
77
+ npm run sdk:publish
193
78
  ```
194
79
 
195
80
  ## 📄 라이선스
@@ -200,9 +85,8 @@ ISC
200
85
 
201
86
  ## 🔄 변경 로그
202
87
 
203
- ### v1.0.2
204
-
205
88
  - ✅ 모든 DTO 클래스를 인터페이스로 변환
206
89
  - ✅ 런타임 의존성 제거 (`@nestjs/swagger` 제거)
207
90
  - ✅ 타입 안전성 향상
208
91
  - ✅ 번들 크기 최적화
92
+ - ✅ 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
+ }
@@ -0,0 +1,91 @@
1
+ export declare enum BugReportStatus {
2
+ OPEN = "open",
3
+ IN_PROGRESS = "in_progress",
4
+ RESOLVED = "resolved",
5
+ CLOSED = "closed"
6
+ }
7
+ export declare enum BugReportSeverity {
8
+ LOW = "low",
9
+ MEDIUM = "medium",
10
+ HIGH = "high",
11
+ CRITICAL = "critical"
12
+ }
13
+ export declare enum BugReportErrorType {
14
+ UNKNOWN = "unknown",
15
+ CLIENT_ERROR = "client_error",
16
+ SERVER_ERROR = "server_error",
17
+ NETWORK_ERROR = "network_error",
18
+ RUNTIME_ERROR = "runtime_error",
19
+ VALIDATION_ERROR = "validation_error",
20
+ SYNTAX_ERROR = "syntax_error",
21
+ REFERENCE_ERROR = "reference_error",
22
+ TYPE_ERROR = "type_error"
23
+ }
24
+ export interface CreateBugReportDto {
25
+ title: string;
26
+ description: string;
27
+ errorMessage?: string;
28
+ errorStack?: string;
29
+ errorType?: BugReportErrorType;
30
+ errorCode?: string;
31
+ url?: string;
32
+ userAgent?: string;
33
+ severity?: BugReportSeverity;
34
+ userId?: string;
35
+ assigneeId?: string;
36
+ metadata?: Record<string, any>;
37
+ }
38
+ export interface UpdateBugReportDto {
39
+ title?: string;
40
+ description?: string;
41
+ status?: BugReportStatus;
42
+ severity?: BugReportSeverity;
43
+ errorMessage?: string;
44
+ errorStack?: string;
45
+ errorType?: BugReportErrorType;
46
+ errorCode?: string;
47
+ assigneeId?: string;
48
+ metadata?: Record<string, any>;
49
+ }
50
+ export interface BugReportDataDto {
51
+ id: number;
52
+ title: string;
53
+ description: string;
54
+ errorMessage?: string;
55
+ errorStack?: string;
56
+ errorType: BugReportErrorType;
57
+ errorCode?: string;
58
+ url?: string;
59
+ userAgent?: string;
60
+ status: BugReportStatus;
61
+ severity: BugReportSeverity;
62
+ userId?: string;
63
+ assigneeId?: string;
64
+ metadata?: Record<string, any>;
65
+ createdAt: Date;
66
+ updatedAt: Date;
67
+ }
68
+ export interface GetBugReportResponseDto {
69
+ success: boolean;
70
+ message: string;
71
+ data: BugReportDataDto;
72
+ }
73
+ export interface GetBugReportsResponseDto {
74
+ success: boolean;
75
+ message: string;
76
+ data: BugReportDataDto[];
77
+ }
78
+ export interface CreateBugReportResponseDto {
79
+ success: boolean;
80
+ message: string;
81
+ data: BugReportDataDto;
82
+ }
83
+ export interface UpdateBugReportResponseDto {
84
+ success: boolean;
85
+ message: string;
86
+ data: BugReportDataDto;
87
+ }
88
+ export interface DeleteBugReportResponseDto {
89
+ success: boolean;
90
+ message: string;
91
+ }
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ // 버그 리포트 관련 타입 정의
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.BugReportErrorType = exports.BugReportSeverity = exports.BugReportStatus = void 0;
5
+ var BugReportStatus;
6
+ (function (BugReportStatus) {
7
+ BugReportStatus["OPEN"] = "open";
8
+ BugReportStatus["IN_PROGRESS"] = "in_progress";
9
+ BugReportStatus["RESOLVED"] = "resolved";
10
+ BugReportStatus["CLOSED"] = "closed";
11
+ })(BugReportStatus || (exports.BugReportStatus = BugReportStatus = {}));
12
+ var BugReportSeverity;
13
+ (function (BugReportSeverity) {
14
+ BugReportSeverity["LOW"] = "low";
15
+ BugReportSeverity["MEDIUM"] = "medium";
16
+ BugReportSeverity["HIGH"] = "high";
17
+ BugReportSeverity["CRITICAL"] = "critical";
18
+ })(BugReportSeverity || (exports.BugReportSeverity = BugReportSeverity = {}));
19
+ var BugReportErrorType;
20
+ (function (BugReportErrorType) {
21
+ BugReportErrorType["UNKNOWN"] = "unknown";
22
+ BugReportErrorType["CLIENT_ERROR"] = "client_error";
23
+ BugReportErrorType["SERVER_ERROR"] = "server_error";
24
+ BugReportErrorType["NETWORK_ERROR"] = "network_error";
25
+ BugReportErrorType["RUNTIME_ERROR"] = "runtime_error";
26
+ BugReportErrorType["VALIDATION_ERROR"] = "validation_error";
27
+ BugReportErrorType["SYNTAX_ERROR"] = "syntax_error";
28
+ BugReportErrorType["REFERENCE_ERROR"] = "reference_error";
29
+ BugReportErrorType["TYPE_ERROR"] = "type_error";
30
+ })(BugReportErrorType || (exports.BugReportErrorType = BugReportErrorType = {}));
package/dist/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  /**
2
2
  * ByZip V2 SDK
3
- * 프론트엔드와 백엔드 타입 통일을 위한 TypeScript SDK
3
+ * 자동 생성된 파일입니다. 수정하지 마세요.
4
4
  */
5
- export * from "./dto";
6
- export declare const SDK_VERSION = "1.0.1";
7
- export declare const SDK_INFO: {
8
- readonly name: "byzip-v2-sdk";
9
- readonly version: "1.0.1";
10
- readonly description: "분양모음집 V2 SDK - 프론트엔드와 백엔드 간 타입 통일을 위한 TypeScript SDK";
11
- };
5
+ export * from './auth.const';
6
+ export * from './auth.dto';
7
+ export * from './bug-report.dto';
8
+ export * from './jwt.types';
9
+ export * from './response.dto';
10
+ export * from './response.helpers';
11
+ 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,13 +18,10 @@ 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
- __exportStar(require("./dto"), exports);
23
- // SDK 버전 정보
24
- exports.SDK_VERSION = "1.0.1";
25
- // SDK 정보
26
- exports.SDK_INFO = {
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("./bug-report.dto"), exports);
24
+ __exportStar(require("./jwt.types"), exports);
25
+ __exportStar(require("./response.dto"), exports);
26
+ __exportStar(require("./response.helpers"), exports);
27
+ __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
+ }
@@ -1,5 +1,3 @@
1
1
  "use strict";
2
- /**
3
- * 사용자 로그인 관련 DTO 정의
4
- */
5
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>;
@@ -1,23 +1,27 @@
1
1
  "use strict";
2
2
  /**
3
- * 공통 API 응답 구조 DTO
3
+ * API 응답 생성 헬퍼 함수
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.createSuccessResponse = createSuccessResponse;
7
7
  exports.createErrorResponse = createErrorResponse;
8
- /** 성공 응답 생성 함수 */
9
- function createSuccessResponse(data, message = "요청이 성공적으로 처리되었습니다.") {
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
- /** 정보 조회 응답 DTO */
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
- /** 비밀번호 변경 요청 DTO */
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
- /** 비밀번호 변경 응답 DTO */
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
- /** 계정 삭제 응답 DTO */
89
+ export interface DeleteAccountDataDto {
90
+ scheduledDeletionDate: number;
91
+ }
110
92
  export interface DeleteAccountResponseDto {
111
- /** 성공 메시지 */
93
+ success: boolean;
112
94
  message: string;
113
- /** 계정 삭제 예정일 (Unix timestamp) */
114
- scheduledDeletionDate: number;
95
+ data: DeleteAccountDataDto;
115
96
  }
116
- /** 모든 사용자 조회 응답 DTO */
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
- /** 사용자 정보 수정 요청 DTO */
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
- /** 사용자 정보 수정 응답 DTO */
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,6 +1,6 @@
1
1
  {
2
2
  "name": "byzip-v2-sdk",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -8,8 +8,7 @@
8
8
  ],
9
9
  "scripts": {
10
10
  "build": "tsc",
11
- "prepublishOnly": "npm run build",
12
- "test": "echo \"Error: no test specified\" && exit 1"
11
+ "prepublishOnly": "npm run build"
13
12
  },
14
13
  "keywords": [
15
14
  "byzip",
@@ -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>;
@@ -1,7 +0,0 @@
1
- /**
2
- * DTO Export Index
3
- * 모든 DTO 클래스들을 중앙에서 관리하고 export
4
- */
5
- export * from "./auth/auth.dto";
6
- export * from "./common/response.dto";
7
- export * from "./user/user.dto";
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);
@@ -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
- }
File without changes