@helloao/tools 0.3.0 → 0.4.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.
@@ -1,4 +1,4 @@
1
- import { Commentary, CommentaryBook, CommentaryBookChapter, CommentaryProfile, InputFile, Translation, TranslationBook, TranslationBookChapter, Dataset as CommonDataset, DatasetBook, DatasetBookChapter } from './common-types.js';
1
+ import { Commentary, CommentaryBook, CommentaryBookChapter, CommentaryProfile, InputFile, Translation, TranslationBook, TranslationBookChapter, Dataset as CommonDataset, DatasetBook, DatasetBookChapter, DatasetPerson, DatasetPlace, DatasetEvent, DatasetPeopleGroup } from './common-types.js';
2
2
  import { ParseMessage } from '../parser/types.js';
3
3
  export declare const DATASET_VERSION = 1;
4
4
  /**
@@ -69,6 +69,22 @@ export interface DatasetCommentaryProfile extends CommentaryProfile {
69
69
  }
70
70
  export interface DatasetDataset extends CommonDataset {
71
71
  books: DatasetDatasetBook[];
72
+ /**
73
+ * The list of people that are contained in the dataset.
74
+ */
75
+ people?: DatasetPerson[];
76
+ /**
77
+ * The list of places that are contained in the dataset.
78
+ */
79
+ places?: DatasetPlace[];
80
+ /**
81
+ * The list of events that are contained in the dataset.
82
+ */
83
+ events?: DatasetEvent[];
84
+ /**
85
+ * The list of people groups that are contained in the dataset.
86
+ */
87
+ peopleGroups?: DatasetPeopleGroup[];
72
88
  }
73
89
  export interface DatasetDatasetBook extends DatasetBook {
74
90
  chapters: DatasetBookChapter[];
@@ -0,0 +1,64 @@
1
+ import { Dataset } from './common-types.js';
2
+ import { DatasetDataset } from './dataset.js';
3
+ /**
4
+ * The dataset information for the Theographic Bible Metadata dataset.
5
+ * See https://github.com/robertrouse/theographic-bible-metadata
6
+ */
7
+ export declare const THEOGRAPHIC_DATASET: Dataset;
8
+ /**
9
+ * Defines an interface for a raw Theographic record.
10
+ * The Theographic JSON files are Airtable exports, where each record has an Airtable record ID and a map of fields.
11
+ */
12
+ export interface TheographicRecord {
13
+ /**
14
+ * The Airtable record ID of the record. e.g. "recO5ToygNrV47m4M"
15
+ */
16
+ id: string;
17
+ /**
18
+ * The fields of the record.
19
+ */
20
+ fields: {
21
+ [key: string]: any;
22
+ };
23
+ }
24
+ /**
25
+ * The parsed contents of the Theographic JSON files that are needed
26
+ * to generate the dataset.
27
+ */
28
+ export interface TheographicFiles {
29
+ books: TheographicRecord[];
30
+ verses: TheographicRecord[];
31
+ people: TheographicRecord[];
32
+ places: TheographicRecord[];
33
+ events: TheographicRecord[];
34
+ peopleGroups: TheographicRecord[];
35
+ }
36
+ /**
37
+ * Maps Theographic OSIS book names to USFM book IDs.
38
+ */
39
+ export declare const osisBookMap: Map<string, "GEN" | "EXO" | "LEV" | "NUM" | "DEU" | "JOS" | "JDG" | "RUT" | "1SA" | "2SA" | "1KI" | "2KI" | "1CH" | "2CH" | "EZR" | "NEH" | "EST" | "JOB" | "PSA" | "PRO" | "ECC" | "SNG" | "ISA" | "JER" | "LAM" | "EZK" | "DAN" | "HOS" | "JOL" | "AMO" | "OBA" | "JON" | "MIC" | "NAM" | "HAB" | "ZEP" | "HAG" | "ZEC" | "MAL" | "MAT" | "MRK" | "LUK" | "JHN" | "ACT" | "ROM" | "1CO" | "2CO" | "GAL" | "EPH" | "PHP" | "COL" | "1TH" | "2TH" | "1TI" | "2TI" | "TIT" | "PHM" | "HEB" | "JAS" | "1PE" | "2PE" | "1JN" | "2JN" | "3JN" | "JUD" | "REV" | "TOB" | "JDT" | "ESG" | "WIS" | "SIR" | "BAR" | "LJE" | "S3Y" | "SUS" | "BEL" | "1MA" | "2MA" | "3MA" | "4MA" | "1ES" | "2ES" | "MAN" | "PS2" | "ODA" | "PSS" | "EZA" | "5EZ" | "6EZ" | "DAG" | "PS3" | "2BA" | "LBA" | "JUB" | "ENO" | "1MQ" | "2MQ" | "3MQ" | "REP" | "4BA" | "LAO">;
40
+ /**
41
+ * Slugifies the given string so that it can be used as an entity ID.
42
+ * @param str The string to slugify.
43
+ */
44
+ export declare function slugify(str: string): string;
45
+ /**
46
+ * Removes markdown links from the given text, keeping only the link text.
47
+ * For example, "[Esther 1:10](/esth#Esth.1.10)" becomes "Esther 1:10".
48
+ * @param text The text to clean.
49
+ */
50
+ export declare function stripMarkdownLinks(text: string): string;
51
+ /**
52
+ * Generates a dataset from the given Theographic Bible Metadata files.
53
+ *
54
+ * The returned dataset contains the people, places, events, and people groups
55
+ * from the Theographic data, with all cross-entity relationships resolved to entity IDs
56
+ * and all verse links resolved to Bible verse references.
57
+ *
58
+ * The transformation is deterministic: the same input always produces the same output.
59
+ *
60
+ * @param files The parsed Theographic JSON files.
61
+ * @param dataset The dataset information to use. Defaults to {@link THEOGRAPHIC_DATASET}.
62
+ */
63
+ export declare function generateDatasetFromTheographic(files: TheographicFiles, dataset?: Dataset): DatasetDataset;
64
+ //# sourceMappingURL=theographic.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@helloao/tools",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "A set of tools for managing HelloAO's Free Bible API",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/index.cjs",