@readerseye2/cr_type 1.0.93 → 1.0.96
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/dist/ast/ast.types.d.ts +13 -11
- package/dist/book/book.type.d.ts +24 -15
- package/dist/book/book.type.js +52 -42
- package/package.json +1 -1
package/dist/ast/ast.types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AudioMeta } from
|
|
1
|
+
import type { AudioMeta } from "../book/book-sections.type";
|
|
2
2
|
export type SectionId = string;
|
|
3
3
|
export type InlineRun = {
|
|
4
4
|
text: string;
|
|
@@ -14,7 +14,7 @@ export type InlineRun = {
|
|
|
14
14
|
audioValue?: string;
|
|
15
15
|
};
|
|
16
16
|
export type ListMeta = {
|
|
17
|
-
kind:
|
|
17
|
+
kind: "ordered" | "bullet";
|
|
18
18
|
level: number;
|
|
19
19
|
numId?: number;
|
|
20
20
|
format?: string;
|
|
@@ -22,14 +22,14 @@ export type ListMeta = {
|
|
|
22
22
|
};
|
|
23
23
|
export type ParagraphBlock = {
|
|
24
24
|
id: string;
|
|
25
|
-
type:
|
|
25
|
+
type: "paragraph";
|
|
26
26
|
runs: InlineRun[];
|
|
27
27
|
list?: ListMeta;
|
|
28
|
-
textAlign?:
|
|
28
|
+
textAlign?: "left" | "right" | "center" | "justify";
|
|
29
29
|
};
|
|
30
30
|
export type ImageBlock = {
|
|
31
31
|
id: string;
|
|
32
|
-
type:
|
|
32
|
+
type: "image";
|
|
33
33
|
src: string;
|
|
34
34
|
alt?: string;
|
|
35
35
|
width?: number;
|
|
@@ -57,16 +57,16 @@ type SectionAudioBase = {
|
|
|
57
57
|
meta: AudioClipMeta;
|
|
58
58
|
};
|
|
59
59
|
export type SavedSectionAudio = SectionAudioBase & {
|
|
60
|
-
kind:
|
|
60
|
+
kind: "saved";
|
|
61
61
|
cdnUrl: string;
|
|
62
62
|
};
|
|
63
63
|
export type TempSectionAudio = SectionAudioBase & {
|
|
64
|
-
kind:
|
|
64
|
+
kind: "temp";
|
|
65
65
|
blobUrl: string;
|
|
66
66
|
};
|
|
67
67
|
export type SectionAudio = SavedSectionAudio | TempSectionAudio;
|
|
68
68
|
export type SectionImage = {
|
|
69
|
-
kind:
|
|
69
|
+
kind: "saved";
|
|
70
70
|
index: number;
|
|
71
71
|
cdnUrl: string;
|
|
72
72
|
alt?: string;
|
|
@@ -74,7 +74,7 @@ export type SectionImage = {
|
|
|
74
74
|
height?: number;
|
|
75
75
|
assetKey?: string;
|
|
76
76
|
} | {
|
|
77
|
-
kind:
|
|
77
|
+
kind: "temp";
|
|
78
78
|
index: number;
|
|
79
79
|
blobUrl: string;
|
|
80
80
|
alt?: string;
|
|
@@ -84,7 +84,7 @@ export type SectionImage = {
|
|
|
84
84
|
};
|
|
85
85
|
export type SectionQuiz = {
|
|
86
86
|
qid: string;
|
|
87
|
-
kind:
|
|
87
|
+
kind: "saved";
|
|
88
88
|
index: number;
|
|
89
89
|
image_cdn_url: string;
|
|
90
90
|
question: string;
|
|
@@ -94,7 +94,7 @@ export type SectionQuiz = {
|
|
|
94
94
|
limit_sec: number;
|
|
95
95
|
} | {
|
|
96
96
|
qid: string;
|
|
97
|
-
kind:
|
|
97
|
+
kind: "temp";
|
|
98
98
|
index: number;
|
|
99
99
|
image_blob_url: string;
|
|
100
100
|
question: string;
|
|
@@ -106,6 +106,8 @@ export type SectionQuiz = {
|
|
|
106
106
|
export type SectionAST = {
|
|
107
107
|
title: string;
|
|
108
108
|
blocks: Block[];
|
|
109
|
+
isAddedSplit?: boolean;
|
|
110
|
+
isAddedAudio?: boolean;
|
|
109
111
|
};
|
|
110
112
|
export type SectionData = {
|
|
111
113
|
section_id: SectionId;
|
package/dist/book/book.type.d.ts
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
|
+
import { SectionData } from "../ast";
|
|
2
|
+
import { SectionSummary } from "./book-sections.type";
|
|
1
3
|
/** 언어 */
|
|
2
|
-
export type BookLanguage =
|
|
4
|
+
export type BookLanguage = "ko" | "en";
|
|
3
5
|
/** 길이 */
|
|
4
|
-
export type BookLength =
|
|
6
|
+
export type BookLength = "short" | "medium" | "long";
|
|
5
7
|
/** 종류 */
|
|
6
|
-
export type BookGenre =
|
|
8
|
+
export type BookGenre = "fiction" | "non-fiction" | "other";
|
|
7
9
|
/** 영어레벨 (영어책 전용) */
|
|
8
|
-
export type BookEnLevel =
|
|
10
|
+
export type BookEnLevel = "story" | "readers" | "early-chapter" | "middle-chapter" | "chapter" | "novel";
|
|
9
11
|
/** 출판 연령등급 */
|
|
10
|
-
export type PublishAgeRating =
|
|
12
|
+
export type PublishAgeRating = "all" | "12" | "15" | "19";
|
|
11
13
|
/** 책 상태 (라이프사이클) */
|
|
12
|
-
export type BookStatus =
|
|
14
|
+
export type BookStatus = "draft" | "pending" | "published" | "suspended";
|
|
13
15
|
/** MySQL book 테이블 매핑 (단일 테이블) */
|
|
14
16
|
export interface Book {
|
|
15
17
|
book_idx: number;
|
|
@@ -30,17 +32,24 @@ export interface Book {
|
|
|
30
32
|
original_publish_date: string | null;
|
|
31
33
|
original_publisher: string | null;
|
|
32
34
|
isbn: string | null;
|
|
33
|
-
word_count: number | null;
|
|
34
|
-
sound_minutes: number | null;
|
|
35
|
-
section_count: number | null;
|
|
36
35
|
price_point: number | null;
|
|
37
36
|
age_rating: PublishAgeRating;
|
|
38
37
|
quiz_retry_allowed: boolean;
|
|
38
|
+
tags: string[] | null;
|
|
39
39
|
isdeleted: boolean;
|
|
40
40
|
created_at: string;
|
|
41
41
|
updated_at: string;
|
|
42
42
|
published_at: string | null;
|
|
43
43
|
}
|
|
44
|
+
/** 책 상세 조회 API 응답 (meta + summary + content) */
|
|
45
|
+
export interface BookDTO {
|
|
46
|
+
meta: Book;
|
|
47
|
+
summary: {
|
|
48
|
+
sectionOrder: string[];
|
|
49
|
+
sections?: SectionSummary[];
|
|
50
|
+
};
|
|
51
|
+
content: SectionData[];
|
|
52
|
+
}
|
|
44
53
|
export declare const BookLanguageLabel: {
|
|
45
54
|
readonly ko: "한국어";
|
|
46
55
|
readonly en: "English";
|
|
@@ -52,22 +61,22 @@ export declare const BookLengthLabel: {
|
|
|
52
61
|
};
|
|
53
62
|
export declare const BookGenreLabel: {
|
|
54
63
|
readonly fiction: "문학";
|
|
55
|
-
readonly
|
|
64
|
+
readonly "non-fiction": "비문학";
|
|
56
65
|
readonly other: "기타";
|
|
57
66
|
};
|
|
58
67
|
export declare const BookEnLevelLabel: {
|
|
59
68
|
readonly story: "스토리";
|
|
60
69
|
readonly readers: "리더스";
|
|
61
|
-
readonly
|
|
62
|
-
readonly
|
|
70
|
+
readonly "early-chapter": "얼리챕터";
|
|
71
|
+
readonly "middle-chapter": "미들챕터";
|
|
63
72
|
readonly chapter: "챕터";
|
|
64
73
|
readonly novel: "노블";
|
|
65
74
|
};
|
|
66
75
|
export declare const PublishAgeRatingLabel: {
|
|
67
76
|
readonly all: "전체이용가";
|
|
68
|
-
readonly
|
|
69
|
-
readonly
|
|
70
|
-
readonly
|
|
77
|
+
readonly "12": "12세 이용가";
|
|
78
|
+
readonly "15": "15세 이용가";
|
|
79
|
+
readonly "19": "19세 이용가";
|
|
71
80
|
};
|
|
72
81
|
/** 권장 연령 범위 (5~19세) */
|
|
73
82
|
export declare const BOOK_AGE_MIN = 5;
|
package/dist/book/book.type.js
CHANGED
|
@@ -4,32 +4,32 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
exports.getAgeOptions = exports.getAgeRatingOptions = exports.getEnLevelOptions = exports.getGenreOptions = exports.getLengthOptions = exports.getLanguageOptions = exports.calcSoundMinutes = exports.getLexileDescription = exports.getARDescription = exports.LEXILE_INDEX_RANGES = exports.AR_INDEX_RANGES = exports.DEFAULT_BOOK_META = exports.BOOK_AGE_MAX = exports.BOOK_AGE_MIN = exports.PublishAgeRatingLabel = exports.BookEnLevelLabel = exports.BookGenreLabel = exports.BookLengthLabel = exports.BookLanguageLabel = void 0;
|
|
5
5
|
// ========== 라벨 (UI 표시용) ==========
|
|
6
6
|
exports.BookLanguageLabel = {
|
|
7
|
-
ko:
|
|
8
|
-
en:
|
|
7
|
+
ko: "한국어",
|
|
8
|
+
en: "English",
|
|
9
9
|
};
|
|
10
10
|
exports.BookLengthLabel = {
|
|
11
|
-
short:
|
|
12
|
-
medium:
|
|
13
|
-
long:
|
|
11
|
+
short: "단편",
|
|
12
|
+
medium: "중편",
|
|
13
|
+
long: "장편",
|
|
14
14
|
};
|
|
15
15
|
exports.BookGenreLabel = {
|
|
16
|
-
fiction:
|
|
17
|
-
|
|
18
|
-
other:
|
|
16
|
+
fiction: "문학",
|
|
17
|
+
"non-fiction": "비문학",
|
|
18
|
+
other: "기타",
|
|
19
19
|
};
|
|
20
20
|
exports.BookEnLevelLabel = {
|
|
21
|
-
story:
|
|
22
|
-
readers:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
chapter:
|
|
26
|
-
novel:
|
|
21
|
+
story: "스토리",
|
|
22
|
+
readers: "리더스",
|
|
23
|
+
"early-chapter": "얼리챕터",
|
|
24
|
+
"middle-chapter": "미들챕터",
|
|
25
|
+
chapter: "챕터",
|
|
26
|
+
novel: "노블",
|
|
27
27
|
};
|
|
28
28
|
exports.PublishAgeRatingLabel = {
|
|
29
|
-
all:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
all: "전체이용가",
|
|
30
|
+
"12": "12세 이용가",
|
|
31
|
+
"15": "15세 이용가",
|
|
32
|
+
"19": "19세 이용가",
|
|
33
33
|
};
|
|
34
34
|
// ========== 상수 ==========
|
|
35
35
|
/** 권장 연령 범위 (5~19세) */
|
|
@@ -37,11 +37,11 @@ exports.BOOK_AGE_MIN = 5;
|
|
|
37
37
|
exports.BOOK_AGE_MAX = 19;
|
|
38
38
|
/** 새 책 생성 시 기본값 */
|
|
39
39
|
exports.DEFAULT_BOOK_META = {
|
|
40
|
-
book_title:
|
|
41
|
-
book_language:
|
|
40
|
+
book_title: "나의 책",
|
|
41
|
+
book_language: "en",
|
|
42
42
|
book_level: 5,
|
|
43
|
-
length:
|
|
44
|
-
genre:
|
|
43
|
+
length: "short",
|
|
44
|
+
genre: "fiction",
|
|
45
45
|
quiz_retry_allowed: true,
|
|
46
46
|
ar_index: 3.0,
|
|
47
47
|
lexile_index: 600,
|
|
@@ -49,33 +49,43 @@ exports.DEFAULT_BOOK_META = {
|
|
|
49
49
|
// ========== AR / Lexile 지수 ==========
|
|
50
50
|
/** AR 지수 범위별 설명 (소수점 1자리 기준) */
|
|
51
51
|
exports.AR_INDEX_RANGES = [
|
|
52
|
-
{
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
{ min:
|
|
59
|
-
{ min:
|
|
60
|
-
{ min:
|
|
52
|
+
{
|
|
53
|
+
min: 0.0,
|
|
54
|
+
max: 1.9,
|
|
55
|
+
level: "유아 ~ 초1",
|
|
56
|
+
description: "그림책, 아주 짧은 문장",
|
|
57
|
+
},
|
|
58
|
+
{ min: 2.0, max: 2.9, level: "초2", description: "기초 리더북" },
|
|
59
|
+
{ min: 3.0, max: 3.9, level: "초3", description: "챕터북 시작" },
|
|
60
|
+
{ min: 4.0, max: 4.9, level: "초4", description: "본격적인 이야기 구조" },
|
|
61
|
+
{ min: 5.0, max: 5.9, level: "초5", description: "어휘·문장 길이 증가" },
|
|
62
|
+
{ min: 6.0, max: 6.9, level: "초6", description: "논픽션 비중 증가" },
|
|
63
|
+
{ min: 7.0, max: 8.9, level: "중학생", description: "복합 문장, 추론 필요" },
|
|
64
|
+
{
|
|
65
|
+
min: 9.0,
|
|
66
|
+
max: 10.9,
|
|
67
|
+
level: "고등학생",
|
|
68
|
+
description: "문학 작품, 추상 개념",
|
|
69
|
+
},
|
|
70
|
+
{ min: 11.0, max: 12.0, level: "고급", description: "성인 소설·고전" },
|
|
61
71
|
];
|
|
62
72
|
/** Lexile 지수 범위별 설명 */
|
|
63
73
|
exports.LEXILE_INDEX_RANGES = [
|
|
64
|
-
{ min: 0, max: 200, level:
|
|
65
|
-
{ min: 200, max: 400, level:
|
|
66
|
-
{ min: 400, max: 600, level:
|
|
67
|
-
{ min: 600, max: 800, level:
|
|
68
|
-
{ min: 800, max: 1000, level:
|
|
69
|
-
{ min: 1000, max: 1200, level:
|
|
70
|
-
{ min: 1200, max: 1400, level:
|
|
71
|
-
{ min: 1400, max: 1600, level:
|
|
72
|
-
{ min: 1600, max: 2000, level:
|
|
74
|
+
{ min: 0, max: 200, level: "유아", description: "알파벳·기초 단어" },
|
|
75
|
+
{ min: 200, max: 400, level: "초1", description: "아주 쉬운 문장" },
|
|
76
|
+
{ min: 400, max: 600, level: "초2", description: "간단한 스토리" },
|
|
77
|
+
{ min: 600, max: 800, level: "초3", description: "챕터북" },
|
|
78
|
+
{ min: 800, max: 1000, level: "초4", description: "정보량 증가" },
|
|
79
|
+
{ min: 1000, max: 1200, level: "초5~6", description: "교과서 수준" },
|
|
80
|
+
{ min: 1200, max: 1400, level: "중학생", description: "추론·비판적 읽기" },
|
|
81
|
+
{ min: 1400, max: 1600, level: "고등학생", description: "문학·비문학 혼합" },
|
|
82
|
+
{ min: 1600, max: 2000, level: "성인", description: "학술·고전 문학" },
|
|
73
83
|
];
|
|
74
84
|
/** AR 지수로 해당 범위 설명 조회 */
|
|
75
|
-
const getARDescription = (ar) => exports.AR_INDEX_RANGES.find(r => ar >= r.min && ar <= r.max);
|
|
85
|
+
const getARDescription = (ar) => exports.AR_INDEX_RANGES.find((r) => ar >= r.min && ar <= r.max);
|
|
76
86
|
exports.getARDescription = getARDescription;
|
|
77
87
|
/** Lexile 지수로 해당 범위 설명 조회 */
|
|
78
|
-
const getLexileDescription = (lexile) => exports.LEXILE_INDEX_RANGES.find(r => lexile >= r.min && lexile <= r.max);
|
|
88
|
+
const getLexileDescription = (lexile) => exports.LEXILE_INDEX_RANGES.find((r) => lexile >= r.min && lexile <= r.max);
|
|
79
89
|
exports.getLexileDescription = getLexileDescription;
|
|
80
90
|
// ========== 헬퍼 함수 ==========
|
|
81
91
|
/** 어절 수 → 재생 분수 계산 (200 WPM 기준) */
|