@readerseye2/cr_type 1.0.49 → 1.0.51

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.
@@ -1,9 +1,12 @@
1
+ /** 언어 코드 */
1
2
  export declare enum BookLanguageCode {
2
3
  KO = "ko",
3
4
  EN = "en"
4
5
  }
6
+ /** 레벨 범위 */
5
7
  export declare const BOOK_LEVEL_MIN = 5;
6
8
  export declare const BOOK_LEVEL_MAX = 19;
9
+ /** 연령 등급 */
7
10
  export declare enum BookAgeGrade {
8
11
  ALL = "all",// 전체이용가
9
12
  AGE_7 = "7+",// 7세 이상
@@ -11,11 +14,7 @@ export declare enum BookAgeGrade {
11
14
  AGE_15 = "15+",// 15세 이상
12
15
  AGE_19 = "19+"
13
16
  }
14
- export declare enum BookLength {
15
- SHORT = "short",// 단편
16
- MEDIUM = "medium",// 중편
17
- LONG = "long"
18
- }
17
+ /** 종류/장르 */
19
18
  export declare enum BookGenre {
20
19
  FICTION = "fiction",// 소설
21
20
  NON_FICTION = "non-fiction",// 비소설
@@ -27,30 +26,88 @@ export declare enum BookGenre {
27
26
  POETRY = "poetry",// 시
28
27
  OTHER = "other"
29
28
  }
29
+ /** 어절 수 → 재생 분수 계산 (200 WPM 기준) */
30
+ export declare const calcSoundMinutes: (wordCount: number) => number;
30
31
  /** 책 기본 정보 (리스트용) */
31
32
  export interface BookShort {
32
33
  id: string;
33
34
  title: string;
34
35
  author: string;
35
36
  coverUrl: string;
36
- rating: number;
37
- lengthText: string;
38
37
  language: BookLanguageCode;
39
38
  level: number;
40
39
  genre: string;
40
+ wordCount?: number;
41
+ soundMinutes?: number;
41
42
  }
42
43
  /** 책 상세 정보 */
43
44
  export interface BookDetail extends BookShort {
44
45
  description?: string;
45
46
  tags?: string[];
46
- publishedAtText?: string;
47
- priceText?: string;
48
- toc?: string[];
49
47
  ageGrade?: BookAgeGrade;
50
- wordCount?: number;
51
48
  isbn?: string;
52
49
  originalPublisher?: string;
53
50
  originalPublishDate?: string;
54
51
  edition?: string;
55
52
  quizRetryAllowed?: boolean;
53
+ toc?: string[];
54
+ rating?: number;
55
+ publishedAtText?: string;
56
+ priceText?: string;
57
+ sections?: SectionSummary[];
58
+ sectionOrder?: string[];
59
+ }
60
+ /** 섹션 요약 정보 */
61
+ export interface SectionSummary {
62
+ sectionId: string;
63
+ title: string;
64
+ order: number;
65
+ audioCount: number;
66
+ imageCount: number;
67
+ quizCount: number;
68
+ wordCount: number;
69
+ soundMinutes?: number;
70
+ isAddedSplit?: boolean;
71
+ isAddedAudio?: boolean;
72
+ isAddedQuiz?: boolean;
73
+ updatedAt?: string;
74
+ }
75
+ /** 섹션 요약 - API 응답용 */
76
+ export interface SectionSummaryResponse {
77
+ section_id: string;
78
+ title: string;
79
+ order: number;
80
+ audio_count: number;
81
+ image_count: number;
82
+ quiz_count: number;
83
+ word_count: number;
84
+ sound_minutes?: number;
85
+ is_added_split?: boolean;
86
+ is_added_audio?: boolean;
87
+ is_added_quiz?: boolean;
88
+ updated_at?: string;
89
+ }
90
+ /** Draft 책 정보 - API 응답용 */
91
+ export interface DraftBookResponse {
92
+ draft_book_idx: number;
93
+ draft_book_title: string;
94
+ draft_book_language: BookLanguageCode;
95
+ draft_book_level: number;
96
+ draft_book_cover_url: string | null;
97
+ draft_book_create_date?: string;
98
+ draft_book_update_date: string;
99
+ draft_book_author?: string | null;
100
+ draft_book_age_grade?: BookAgeGrade | null;
101
+ draft_book_genre?: string | null;
102
+ draft_book_tags?: string[] | null;
103
+ draft_book_description?: string | null;
104
+ draft_book_original_publish_date?: string | null;
105
+ draft_book_original_publisher?: string | null;
106
+ draft_book_edition?: string | null;
107
+ draft_book_isbn?: string | null;
108
+ draft_book_word_count?: number | null;
109
+ draft_book_sound_minutes?: number | null;
110
+ draft_book_quiz_retry_allowed?: boolean;
111
+ draft_book_sections?: SectionSummaryResponse[];
112
+ draft_book_section_order?: string[];
56
113
  }
@@ -1,16 +1,17 @@
1
1
  "use strict";
2
+ // ========== Enums ==========
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BookGenre = exports.BookLength = exports.BookAgeGrade = exports.BOOK_LEVEL_MAX = exports.BOOK_LEVEL_MIN = exports.BookLanguageCode = void 0;
4
- // 자체를 코드로 쓰는 용도 (DB 저장/전송)
4
+ exports.calcSoundMinutes = exports.BookGenre = exports.BookAgeGrade = exports.BOOK_LEVEL_MAX = exports.BOOK_LEVEL_MIN = exports.BookLanguageCode = void 0;
5
+ /** 언어 코드 */
5
6
  var BookLanguageCode;
6
7
  (function (BookLanguageCode) {
7
8
  BookLanguageCode["KO"] = "ko";
8
9
  BookLanguageCode["EN"] = "en";
9
10
  })(BookLanguageCode || (exports.BookLanguageCode = BookLanguageCode = {}));
10
- // 레벨 범위도 중앙집중 관리
11
+ /** 레벨 범위 */
11
12
  exports.BOOK_LEVEL_MIN = 5;
12
13
  exports.BOOK_LEVEL_MAX = 19;
13
- // 연령 등급
14
+ /** 연령 등급 */
14
15
  var BookAgeGrade;
15
16
  (function (BookAgeGrade) {
16
17
  BookAgeGrade["ALL"] = "all";
@@ -19,14 +20,7 @@ var BookAgeGrade;
19
20
  BookAgeGrade["AGE_15"] = "15+";
20
21
  BookAgeGrade["AGE_19"] = "19+";
21
22
  })(BookAgeGrade || (exports.BookAgeGrade = BookAgeGrade = {}));
22
- //길이
23
- var BookLength;
24
- (function (BookLength) {
25
- BookLength["SHORT"] = "short";
26
- BookLength["MEDIUM"] = "medium";
27
- BookLength["LONG"] = "long";
28
- })(BookLength || (exports.BookLength = BookLength = {}));
29
- // 책 종류/장르
23
+ /**종류/장르 */
30
24
  var BookGenre;
31
25
  (function (BookGenre) {
32
26
  BookGenre["FICTION"] = "fiction";
@@ -39,3 +33,7 @@ var BookGenre;
39
33
  BookGenre["POETRY"] = "poetry";
40
34
  BookGenre["OTHER"] = "other";
41
35
  })(BookGenre || (exports.BookGenre = BookGenre = {}));
36
+ // ========== 헬퍼 함수 ==========
37
+ /** 어절 수 → 재생 분수 계산 (200 WPM 기준) */
38
+ const calcSoundMinutes = (wordCount) => Math.ceil(wordCount / 200);
39
+ exports.calcSoundMinutes = calcSoundMinutes;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@readerseye2/cr_type",
3
- "version": "1.0.49",
3
+ "version": "1.0.51",
4
4
  "description": "CheckReading shared TypeScript types",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",