@helloao/tools 0.1.0 → 0.2.0
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/cjs/generation/api.cjs +727 -2
- package/dist/cjs/generation/api.cjs.map +2 -2
- package/dist/cjs/generation/audio.cjs +52 -5
- package/dist/cjs/generation/audio.cjs.map +2 -2
- package/dist/cjs/generation/book-order.cjs +1 -1
- package/dist/cjs/generation/book-order.cjs.map +2 -2
- package/dist/cjs/generation/common-types.cjs +651 -0
- package/dist/cjs/generation/common-types.cjs.map +2 -2
- package/dist/cjs/generation/dataset.cjs +31 -8
- package/dist/cjs/generation/dataset.cjs.map +2 -2
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/log.cjs.map +1 -1
- package/dist/cjs/parser/codex-parser.cjs.map +1 -1
- package/dist/cjs/parser/commentary-csv-parser.cjs.map +1 -1
- package/dist/cjs/parser/iterators.cjs.map +1 -1
- package/dist/cjs/parser/lockman-parser.cjs +334 -0
- package/dist/cjs/parser/lockman-parser.cjs.map +7 -0
- package/dist/cjs/parser/tyndale-xml-parser.cjs.map +1 -1
- package/dist/cjs/parser/types.cjs.map +1 -1
- package/dist/cjs/parser/usfm-parser.cjs.map +1 -1
- package/dist/cjs/parser/usx-parser.cjs +24 -7
- package/dist/cjs/parser/usx-parser.cjs.map +2 -2
- package/dist/cjs/utils.cjs +152 -0
- package/dist/cjs/utils.cjs.map +3 -3
- package/dist/esm/generation/api.js +696 -2
- package/dist/esm/generation/api.js.map +2 -2
- package/dist/esm/generation/audio.js +46 -3
- package/dist/esm/generation/audio.js.map +2 -2
- package/dist/esm/generation/book-order.js +1 -1
- package/dist/esm/generation/book-order.js.map +2 -2
- package/dist/esm/generation/common-types.js +590 -0
- package/dist/esm/generation/common-types.js.map +3 -3
- package/dist/esm/generation/dataset.js +29 -8
- package/dist/esm/generation/dataset.js.map +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/log.js.map +1 -1
- package/dist/esm/parser/codex-parser.js.map +1 -1
- package/dist/esm/parser/commentary-csv-parser.js.map +1 -1
- package/dist/esm/parser/iterators.js.map +1 -1
- package/dist/esm/parser/lockman-parser.js +306 -0
- package/dist/esm/parser/lockman-parser.js.map +7 -0
- package/dist/esm/parser/tyndale-xml-parser.js.map +1 -1
- package/dist/esm/parser/usfm-parser.js.map +1 -1
- package/dist/esm/parser/usx-parser.js +24 -7
- package/dist/esm/parser/usx-parser.js.map +2 -2
- package/dist/esm/utils.js +138 -0
- package/dist/esm/utils.js.map +2 -2
- package/dist/types/generation/api.d.ts +2515 -470
- package/dist/types/generation/audio.d.ts +5 -0
- package/dist/types/generation/common-types.d.ts +1222 -413
- package/dist/types/generation/dataset.d.ts +1 -0
- package/dist/types/parser/codex-parser.d.ts +18 -138
- package/dist/types/parser/lockman-parser.d.ts +14 -0
- package/dist/types/parser/types.d.ts +4 -0
- package/dist/types/parser/usx-parser.d.ts +2 -2
- package/dist/types/utils.d.ts +223 -18
- package/package.json +5 -3
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Commentary, CommentaryBook, CommentaryBookChapter, CommentaryProfile, InputFile, Translation, TranslationBook, TranslationBookChapter, Dataset as CommonDataset, DatasetBook, DatasetBookChapter } from './common-types.js';
|
|
2
2
|
import { ParseMessage } from '../parser/types.js';
|
|
3
|
+
export declare const DATASET_VERSION = 1;
|
|
3
4
|
/**
|
|
4
5
|
* Defines an interface that contains generated dataset info.
|
|
5
6
|
*/
|
|
@@ -3,23 +3,9 @@ import { ParseTree } from './types.js';
|
|
|
3
3
|
export declare const chapterHeadingSchema: z.ZodObject<{
|
|
4
4
|
type: z.ZodLiteral<"chapter-heading">;
|
|
5
5
|
data: z.ZodObject<{
|
|
6
|
-
chapter: z.
|
|
7
|
-
},
|
|
8
|
-
|
|
9
|
-
}, {
|
|
10
|
-
chapter: number;
|
|
11
|
-
}>;
|
|
12
|
-
}, "strip", z.ZodTypeAny, {
|
|
13
|
-
type: "chapter-heading";
|
|
14
|
-
data: {
|
|
15
|
-
chapter: number;
|
|
16
|
-
};
|
|
17
|
-
}, {
|
|
18
|
-
type: "chapter-heading";
|
|
19
|
-
data: {
|
|
20
|
-
chapter: number;
|
|
21
|
-
};
|
|
22
|
-
}>;
|
|
6
|
+
chapter: z.ZodCoercedNumber<unknown>;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
}, z.core.$strip>;
|
|
23
9
|
export declare const verseSchema: z.ZodObject<{
|
|
24
10
|
type: z.ZodLiteral<"text">;
|
|
25
11
|
id: z.ZodString;
|
|
@@ -27,101 +13,31 @@ export declare const verseSchema: z.ZodObject<{
|
|
|
27
13
|
chapter: z.ZodOptional<z.ZodNumber>;
|
|
28
14
|
verse: z.ZodOptional<z.ZodNumber>;
|
|
29
15
|
data: z.ZodOptional<z.ZodObject<{
|
|
30
|
-
globalReferences: z.ZodOptional<z.ZodArray<z.ZodString
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
}, {
|
|
34
|
-
globalReferences?: string[] | undefined;
|
|
35
|
-
}>>;
|
|
36
|
-
}, "strip", z.ZodTypeAny, {
|
|
37
|
-
id: string;
|
|
38
|
-
type: "text";
|
|
39
|
-
chapter?: number | undefined;
|
|
40
|
-
verse?: number | undefined;
|
|
41
|
-
data?: {
|
|
42
|
-
globalReferences?: string[] | undefined;
|
|
43
|
-
} | undefined;
|
|
44
|
-
bookCode?: string | undefined;
|
|
45
|
-
}, {
|
|
46
|
-
id: string;
|
|
47
|
-
type: "text";
|
|
48
|
-
chapter?: number | undefined;
|
|
49
|
-
verse?: number | undefined;
|
|
50
|
-
data?: {
|
|
51
|
-
globalReferences?: string[] | undefined;
|
|
52
|
-
} | undefined;
|
|
53
|
-
bookCode?: string | undefined;
|
|
54
|
-
}>;
|
|
16
|
+
globalReferences: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
17
|
+
}, z.core.$strip>>;
|
|
18
|
+
}, z.core.$strip>;
|
|
55
19
|
export declare const paratextSchema: z.ZodObject<{
|
|
56
20
|
type: z.ZodLiteral<"paratext">;
|
|
57
21
|
id: z.ZodString;
|
|
58
|
-
},
|
|
59
|
-
|
|
60
|
-
type: "paratext";
|
|
61
|
-
}, {
|
|
62
|
-
id: string;
|
|
63
|
-
type: "paratext";
|
|
64
|
-
}>;
|
|
65
|
-
export declare const metadataSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
export declare const metadataSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
66
24
|
type: z.ZodLiteral<"chapter-heading">;
|
|
67
25
|
data: z.ZodObject<{
|
|
68
|
-
chapter: z.
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
}, {
|
|
72
|
-
chapter: number;
|
|
73
|
-
}>;
|
|
74
|
-
}, "strip", z.ZodTypeAny, {
|
|
75
|
-
type: "chapter-heading";
|
|
76
|
-
data: {
|
|
77
|
-
chapter: number;
|
|
78
|
-
};
|
|
79
|
-
}, {
|
|
80
|
-
type: "chapter-heading";
|
|
81
|
-
data: {
|
|
82
|
-
chapter: number;
|
|
83
|
-
};
|
|
84
|
-
}>, z.ZodObject<{
|
|
26
|
+
chapter: z.ZodCoercedNumber<unknown>;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
85
29
|
type: z.ZodLiteral<"text">;
|
|
86
30
|
id: z.ZodString;
|
|
87
31
|
bookCode: z.ZodOptional<z.ZodString>;
|
|
88
32
|
chapter: z.ZodOptional<z.ZodNumber>;
|
|
89
33
|
verse: z.ZodOptional<z.ZodNumber>;
|
|
90
34
|
data: z.ZodOptional<z.ZodObject<{
|
|
91
|
-
globalReferences: z.ZodOptional<z.ZodArray<z.ZodString
|
|
92
|
-
},
|
|
93
|
-
|
|
94
|
-
}, {
|
|
95
|
-
globalReferences?: string[] | undefined;
|
|
96
|
-
}>>;
|
|
97
|
-
}, "strip", z.ZodTypeAny, {
|
|
98
|
-
id: string;
|
|
99
|
-
type: "text";
|
|
100
|
-
chapter?: number | undefined;
|
|
101
|
-
verse?: number | undefined;
|
|
102
|
-
data?: {
|
|
103
|
-
globalReferences?: string[] | undefined;
|
|
104
|
-
} | undefined;
|
|
105
|
-
bookCode?: string | undefined;
|
|
106
|
-
}, {
|
|
107
|
-
id: string;
|
|
108
|
-
type: "text";
|
|
109
|
-
chapter?: number | undefined;
|
|
110
|
-
verse?: number | undefined;
|
|
111
|
-
data?: {
|
|
112
|
-
globalReferences?: string[] | undefined;
|
|
113
|
-
} | undefined;
|
|
114
|
-
bookCode?: string | undefined;
|
|
115
|
-
}>, z.ZodObject<{
|
|
35
|
+
globalReferences: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
36
|
+
}, z.core.$strip>>;
|
|
37
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
116
38
|
type: z.ZodLiteral<"paratext">;
|
|
117
39
|
id: z.ZodString;
|
|
118
|
-
},
|
|
119
|
-
id: string;
|
|
120
|
-
type: "paratext";
|
|
121
|
-
}, {
|
|
122
|
-
id: string;
|
|
123
|
-
type: "paratext";
|
|
124
|
-
}>]>;
|
|
40
|
+
}, z.core.$strip>], "type">;
|
|
125
41
|
export declare const codexSchema: z.ZodObject<{
|
|
126
42
|
cells: z.ZodArray<z.ZodObject<{
|
|
127
43
|
kind: z.ZodNumber;
|
|
@@ -129,45 +45,9 @@ export declare const codexSchema: z.ZodObject<{
|
|
|
129
45
|
value: z.ZodString;
|
|
130
46
|
metadata: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
131
47
|
type: z.ZodString;
|
|
132
|
-
},
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
type: z.ZodString;
|
|
136
|
-
}, z.ZodTypeAny, "passthrough">>>>;
|
|
137
|
-
}, "strip", z.ZodTypeAny, {
|
|
138
|
-
kind: number;
|
|
139
|
-
value: string;
|
|
140
|
-
languageId: string;
|
|
141
|
-
metadata?: z.objectOutputType<{
|
|
142
|
-
type: z.ZodString;
|
|
143
|
-
}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
144
|
-
}, {
|
|
145
|
-
kind: number;
|
|
146
|
-
value: string;
|
|
147
|
-
languageId: string;
|
|
148
|
-
metadata?: z.objectInputType<{
|
|
149
|
-
type: z.ZodString;
|
|
150
|
-
}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
151
|
-
}>, "many">;
|
|
152
|
-
}, "strip", z.ZodTypeAny, {
|
|
153
|
-
cells: {
|
|
154
|
-
kind: number;
|
|
155
|
-
value: string;
|
|
156
|
-
languageId: string;
|
|
157
|
-
metadata?: z.objectOutputType<{
|
|
158
|
-
type: z.ZodString;
|
|
159
|
-
}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
160
|
-
}[];
|
|
161
|
-
}, {
|
|
162
|
-
cells: {
|
|
163
|
-
kind: number;
|
|
164
|
-
value: string;
|
|
165
|
-
languageId: string;
|
|
166
|
-
metadata?: z.objectInputType<{
|
|
167
|
-
type: z.ZodString;
|
|
168
|
-
}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
169
|
-
}[];
|
|
170
|
-
}>;
|
|
48
|
+
}, z.core.$loose>>>;
|
|
49
|
+
}, z.core.$strip>>;
|
|
50
|
+
}, z.core.$strip>;
|
|
171
51
|
/**
|
|
172
52
|
* Defines a parser for codex files.
|
|
173
53
|
*/
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ParseTree } from './types';
|
|
2
|
+
export declare const LOCKMAN_PARSER_VERSION = 3;
|
|
3
|
+
export declare class LockmanParser {
|
|
4
|
+
parse(text: string): ParseTree[];
|
|
5
|
+
private getBookIdFromVerseTag;
|
|
6
|
+
private parseVerseContent;
|
|
7
|
+
private addText;
|
|
8
|
+
private parseHebrewSubtitleContent;
|
|
9
|
+
private addSubtitleText;
|
|
10
|
+
private processFootnote;
|
|
11
|
+
private processFootnoteForSubtitle;
|
|
12
|
+
private extractFootnoteText;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=lockman-parser.d.ts.map
|
|
@@ -94,6 +94,10 @@ export interface Text {
|
|
|
94
94
|
* This is only used for "hebrew subtitles" that are included inside the verse markers.
|
|
95
95
|
*/
|
|
96
96
|
descriptive?: boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Whether the text should be displayed in italics.
|
|
99
|
+
*/
|
|
100
|
+
italics?: boolean;
|
|
97
101
|
}
|
|
98
102
|
/**
|
|
99
103
|
* Defines an interface that represents a heading that is embedded in a verse.
|
|
@@ -4,7 +4,7 @@ import { RewindableIterator } from './iterators.js';
|
|
|
4
4
|
* The version of the parser.
|
|
5
5
|
* Used to determine whether input files need to be re-parsed.
|
|
6
6
|
*/
|
|
7
|
-
export declare const PARSER_VERSION =
|
|
7
|
+
export declare const PARSER_VERSION = 3;
|
|
8
8
|
/**
|
|
9
9
|
* Defines a class that is able to parse USX content.
|
|
10
10
|
*/
|
|
@@ -25,7 +25,7 @@ export declare class USXParser {
|
|
|
25
25
|
parse(usx: string): ParseTree;
|
|
26
26
|
iterateRootContent(usxElement: Element): Generator<ParseTree['content'][0]>;
|
|
27
27
|
iterateChapterContent(chapter: Chapter, nodes: RewindableIterator<Node>): IterableIterator<ChapterContent>;
|
|
28
|
-
iterateVerseContent(chapter: Chapter, verse: Verse, nodes: RewindableIterator<Node
|
|
28
|
+
iterateVerseContent(chapter: Chapter, verse: Verse, nodes: RewindableIterator<Node>, previousVerse?: Verse | null): IterableIterator<string | FootnoteReference | Text | InlineLineBreak>;
|
|
29
29
|
parseVerse(element: Element, chapter: Chapter, nodes: RewindableIterator<Node>): Verse;
|
|
30
30
|
parseHebrewSubtitle(para: Element, chapter: Chapter, nodes: RewindableIterator<Node>): IterableIterator<HebrewSubtitle | Verse>;
|
|
31
31
|
iterateHebrewSubtitleContent(element: Element, chapter: Chapter, nodes: RewindableIterator<Node>): IterableIterator<Verse | string | Text | FootnoteReference | InlineLineBreak>;
|
package/dist/types/utils.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import z from "zod";
|
|
1
2
|
/**
|
|
2
3
|
* Normalizes the given language code into a ISO 639 code.
|
|
3
4
|
* @param language The language code to normalize.
|
|
@@ -10,23 +11,227 @@ export declare function normalizeLanguage(language: string): string;
|
|
|
10
11
|
export declare function getTranslationId(translationId: string): string;
|
|
11
12
|
export declare function isEmptyOrWhitespace(str: string | null | undefined): boolean;
|
|
12
13
|
export declare function getFirstNonEmpty<T extends string>(...values: T[]): T;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Defines a Zod schema for all USFM book IDs.
|
|
16
|
+
*/
|
|
17
|
+
export declare const BookIdSchema: z.ZodEnum<{
|
|
18
|
+
GEN: "GEN";
|
|
19
|
+
EXO: "EXO";
|
|
20
|
+
LEV: "LEV";
|
|
21
|
+
NUM: "NUM";
|
|
22
|
+
DEU: "DEU";
|
|
23
|
+
JOS: "JOS";
|
|
24
|
+
JDG: "JDG";
|
|
25
|
+
RUT: "RUT";
|
|
26
|
+
"1SA": "1SA";
|
|
27
|
+
"2SA": "2SA";
|
|
28
|
+
"1KI": "1KI";
|
|
29
|
+
"2KI": "2KI";
|
|
30
|
+
"1CH": "1CH";
|
|
31
|
+
"2CH": "2CH";
|
|
32
|
+
EZR: "EZR";
|
|
33
|
+
NEH: "NEH";
|
|
34
|
+
EST: "EST";
|
|
35
|
+
JOB: "JOB";
|
|
36
|
+
PSA: "PSA";
|
|
37
|
+
PRO: "PRO";
|
|
38
|
+
ECC: "ECC";
|
|
39
|
+
SNG: "SNG";
|
|
40
|
+
ISA: "ISA";
|
|
41
|
+
JER: "JER";
|
|
42
|
+
LAM: "LAM";
|
|
43
|
+
EZK: "EZK";
|
|
44
|
+
DAN: "DAN";
|
|
45
|
+
HOS: "HOS";
|
|
46
|
+
JOL: "JOL";
|
|
47
|
+
AMO: "AMO";
|
|
48
|
+
OBA: "OBA";
|
|
49
|
+
JON: "JON";
|
|
50
|
+
MIC: "MIC";
|
|
51
|
+
NAM: "NAM";
|
|
52
|
+
HAB: "HAB";
|
|
53
|
+
ZEP: "ZEP";
|
|
54
|
+
HAG: "HAG";
|
|
55
|
+
ZEC: "ZEC";
|
|
56
|
+
MAL: "MAL";
|
|
57
|
+
MAT: "MAT";
|
|
58
|
+
MRK: "MRK";
|
|
59
|
+
LUK: "LUK";
|
|
60
|
+
JHN: "JHN";
|
|
61
|
+
ACT: "ACT";
|
|
62
|
+
ROM: "ROM";
|
|
63
|
+
"1CO": "1CO";
|
|
64
|
+
"2CO": "2CO";
|
|
65
|
+
GAL: "GAL";
|
|
66
|
+
EPH: "EPH";
|
|
67
|
+
PHP: "PHP";
|
|
68
|
+
COL: "COL";
|
|
69
|
+
"1TH": "1TH";
|
|
70
|
+
"2TH": "2TH";
|
|
71
|
+
"1TI": "1TI";
|
|
72
|
+
"2TI": "2TI";
|
|
73
|
+
TIT: "TIT";
|
|
74
|
+
PHM: "PHM";
|
|
75
|
+
HEB: "HEB";
|
|
76
|
+
JAS: "JAS";
|
|
77
|
+
"1PE": "1PE";
|
|
78
|
+
"2PE": "2PE";
|
|
79
|
+
"1JN": "1JN";
|
|
80
|
+
"2JN": "2JN";
|
|
81
|
+
"3JN": "3JN";
|
|
82
|
+
JUD: "JUD";
|
|
83
|
+
REV: "REV";
|
|
84
|
+
TOB: "TOB";
|
|
85
|
+
JDT: "JDT";
|
|
86
|
+
ESG: "ESG";
|
|
87
|
+
WIS: "WIS";
|
|
88
|
+
SIR: "SIR";
|
|
89
|
+
BAR: "BAR";
|
|
90
|
+
LJE: "LJE";
|
|
91
|
+
S3Y: "S3Y";
|
|
92
|
+
SUS: "SUS";
|
|
93
|
+
BEL: "BEL";
|
|
94
|
+
"1MA": "1MA";
|
|
95
|
+
"2MA": "2MA";
|
|
96
|
+
"3MA": "3MA";
|
|
97
|
+
"4MA": "4MA";
|
|
98
|
+
"1ES": "1ES";
|
|
99
|
+
"2ES": "2ES";
|
|
100
|
+
MAN: "MAN";
|
|
101
|
+
PS2: "PS2";
|
|
102
|
+
ODA: "ODA";
|
|
103
|
+
PSS: "PSS";
|
|
104
|
+
EZA: "EZA";
|
|
105
|
+
"5EZ": "5EZ";
|
|
106
|
+
"6EZ": "6EZ";
|
|
107
|
+
DAG: "DAG";
|
|
108
|
+
PS3: "PS3";
|
|
109
|
+
"2BA": "2BA";
|
|
110
|
+
LBA: "LBA";
|
|
111
|
+
JUB: "JUB";
|
|
112
|
+
ENO: "ENO";
|
|
113
|
+
"1MQ": "1MQ";
|
|
114
|
+
"2MQ": "2MQ";
|
|
115
|
+
"3MQ": "3MQ";
|
|
116
|
+
REP: "REP";
|
|
117
|
+
"4BA": "4BA";
|
|
118
|
+
LAO: "LAO";
|
|
119
|
+
}>;
|
|
120
|
+
export type BookId = z.infer<typeof BookIdSchema>;
|
|
121
|
+
/**
|
|
122
|
+
* Defines a schema for validating verse references.
|
|
123
|
+
*/
|
|
124
|
+
export declare const VerseRefSchema: z.ZodObject<{
|
|
125
|
+
book: z.ZodEnum<{
|
|
126
|
+
GEN: "GEN";
|
|
127
|
+
EXO: "EXO";
|
|
128
|
+
LEV: "LEV";
|
|
129
|
+
NUM: "NUM";
|
|
130
|
+
DEU: "DEU";
|
|
131
|
+
JOS: "JOS";
|
|
132
|
+
JDG: "JDG";
|
|
133
|
+
RUT: "RUT";
|
|
134
|
+
"1SA": "1SA";
|
|
135
|
+
"2SA": "2SA";
|
|
136
|
+
"1KI": "1KI";
|
|
137
|
+
"2KI": "2KI";
|
|
138
|
+
"1CH": "1CH";
|
|
139
|
+
"2CH": "2CH";
|
|
140
|
+
EZR: "EZR";
|
|
141
|
+
NEH: "NEH";
|
|
142
|
+
EST: "EST";
|
|
143
|
+
JOB: "JOB";
|
|
144
|
+
PSA: "PSA";
|
|
145
|
+
PRO: "PRO";
|
|
146
|
+
ECC: "ECC";
|
|
147
|
+
SNG: "SNG";
|
|
148
|
+
ISA: "ISA";
|
|
149
|
+
JER: "JER";
|
|
150
|
+
LAM: "LAM";
|
|
151
|
+
EZK: "EZK";
|
|
152
|
+
DAN: "DAN";
|
|
153
|
+
HOS: "HOS";
|
|
154
|
+
JOL: "JOL";
|
|
155
|
+
AMO: "AMO";
|
|
156
|
+
OBA: "OBA";
|
|
157
|
+
JON: "JON";
|
|
158
|
+
MIC: "MIC";
|
|
159
|
+
NAM: "NAM";
|
|
160
|
+
HAB: "HAB";
|
|
161
|
+
ZEP: "ZEP";
|
|
162
|
+
HAG: "HAG";
|
|
163
|
+
ZEC: "ZEC";
|
|
164
|
+
MAL: "MAL";
|
|
165
|
+
MAT: "MAT";
|
|
166
|
+
MRK: "MRK";
|
|
167
|
+
LUK: "LUK";
|
|
168
|
+
JHN: "JHN";
|
|
169
|
+
ACT: "ACT";
|
|
170
|
+
ROM: "ROM";
|
|
171
|
+
"1CO": "1CO";
|
|
172
|
+
"2CO": "2CO";
|
|
173
|
+
GAL: "GAL";
|
|
174
|
+
EPH: "EPH";
|
|
175
|
+
PHP: "PHP";
|
|
176
|
+
COL: "COL";
|
|
177
|
+
"1TH": "1TH";
|
|
178
|
+
"2TH": "2TH";
|
|
179
|
+
"1TI": "1TI";
|
|
180
|
+
"2TI": "2TI";
|
|
181
|
+
TIT: "TIT";
|
|
182
|
+
PHM: "PHM";
|
|
183
|
+
HEB: "HEB";
|
|
184
|
+
JAS: "JAS";
|
|
185
|
+
"1PE": "1PE";
|
|
186
|
+
"2PE": "2PE";
|
|
187
|
+
"1JN": "1JN";
|
|
188
|
+
"2JN": "2JN";
|
|
189
|
+
"3JN": "3JN";
|
|
190
|
+
JUD: "JUD";
|
|
191
|
+
REV: "REV";
|
|
192
|
+
TOB: "TOB";
|
|
193
|
+
JDT: "JDT";
|
|
194
|
+
ESG: "ESG";
|
|
195
|
+
WIS: "WIS";
|
|
196
|
+
SIR: "SIR";
|
|
197
|
+
BAR: "BAR";
|
|
198
|
+
LJE: "LJE";
|
|
199
|
+
S3Y: "S3Y";
|
|
200
|
+
SUS: "SUS";
|
|
201
|
+
BEL: "BEL";
|
|
202
|
+
"1MA": "1MA";
|
|
203
|
+
"2MA": "2MA";
|
|
204
|
+
"3MA": "3MA";
|
|
205
|
+
"4MA": "4MA";
|
|
206
|
+
"1ES": "1ES";
|
|
207
|
+
"2ES": "2ES";
|
|
208
|
+
MAN: "MAN";
|
|
209
|
+
PS2: "PS2";
|
|
210
|
+
ODA: "ODA";
|
|
211
|
+
PSS: "PSS";
|
|
212
|
+
EZA: "EZA";
|
|
213
|
+
"5EZ": "5EZ";
|
|
214
|
+
"6EZ": "6EZ";
|
|
215
|
+
DAG: "DAG";
|
|
216
|
+
PS3: "PS3";
|
|
217
|
+
"2BA": "2BA";
|
|
218
|
+
LBA: "LBA";
|
|
219
|
+
JUB: "JUB";
|
|
220
|
+
ENO: "ENO";
|
|
221
|
+
"1MQ": "1MQ";
|
|
222
|
+
"2MQ": "2MQ";
|
|
223
|
+
"3MQ": "3MQ";
|
|
224
|
+
REP: "REP";
|
|
225
|
+
"4BA": "4BA";
|
|
226
|
+
LAO: "LAO";
|
|
227
|
+
}>;
|
|
228
|
+
chapter: z.ZodNumber;
|
|
229
|
+
verse: z.ZodNumber;
|
|
230
|
+
content: z.ZodOptional<z.ZodString>;
|
|
231
|
+
endChapter: z.ZodOptional<z.ZodNumber>;
|
|
232
|
+
endVerse: z.ZodOptional<z.ZodNumber>;
|
|
233
|
+
}, z.core.$strip>;
|
|
234
|
+
export type VerseRef = z.infer<typeof VerseRefSchema>;
|
|
30
235
|
/**
|
|
31
236
|
* Parses the given verse reference.
|
|
32
237
|
* Formatted like "GEN 1:1".
|
|
@@ -39,7 +244,7 @@ export declare function parseVerseReference(text: string): VerseRef | null;
|
|
|
39
244
|
* Returns null if the ID could not be found.
|
|
40
245
|
* @param book The name/ID of the book.
|
|
41
246
|
*/
|
|
42
|
-
export declare function getBookId(book: string):
|
|
247
|
+
export declare function getBookId(book: string): BookId | null;
|
|
43
248
|
/**
|
|
44
249
|
* A brief list of verses which may appear in some older translations
|
|
45
250
|
* but are not present in more modern translations.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@helloao/tools",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "A set of tools for managing HelloAO's Free Bible API",
|
|
5
5
|
"main": "./dist/cjs/index.cjs",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -50,12 +50,14 @@
|
|
|
50
50
|
"license": "MIT",
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"lodash": "4.17.21",
|
|
53
|
-
"zod": "^
|
|
53
|
+
"zod": "^4.4.3",
|
|
54
54
|
"papaparse": "5.4.1"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
+
"@types/jest": "^29.4.0",
|
|
57
58
|
"linkedom": "0.18.4",
|
|
58
|
-
"hash.js": "1.1.7"
|
|
59
|
+
"hash.js": "1.1.7",
|
|
60
|
+
"zod-openapi": "5.4.6"
|
|
59
61
|
},
|
|
60
62
|
"files": [
|
|
61
63
|
"/README.md",
|