waha-shared 1.0.1
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/.DS_Store +0 -0
- package/README.md +10 -0
- package/__init__.py +0 -0
- package/copy.ts +37 -0
- package/data/README.md +45 -0
- package/data/__init__.py +0 -0
- package/data/aslTimestamps.json +192788 -0
- package/data/bibleAudios.json +394 -0
- package/data/bibleAudios.ts +4 -0
- package/data/bibleResources/audioBibleLicenses.json +6235 -0
- package/data/bibleResources/bibleBooks.json +6071 -0
- package/data/bibleResources/bibleBooks.ts +4 -0
- package/data/bibleResources/bibleChaptersList.json +1191 -0
- package/data/bibleResources/bibleChaptersList.ts +4 -0
- package/data/bibleResources/textBibleLicenses.json +14603 -0
- package/data/bibleStatuses.json +9196 -0
- package/data/bibleStatuses.ts +4 -0
- package/data/bibleTexts.json +527 -0
- package/data/bibleTexts.ts +4 -0
- package/data/clones.json +13 -0
- package/data/countryResources/areas.json +74 -0
- package/data/countryResources/areas.ts +4 -0
- package/data/countryResources/countries.json +3362 -0
- package/data/countryResources/countries.ts +4 -0
- package/data/foundationsCurriculums.json +130 -0
- package/data/foundationsCurriculums.ts +4 -0
- package/data/languageResources/countriesAndLanguages.json +11718 -0
- package/data/languageResources/countriesAndLanguages.ts +16 -0
- package/data/languageResources/crowdinLanguages.json +2172 -0
- package/data/languageResources/iosVoiceOverLanguages.json +64 -0
- package/data/languageResources/iso6933LanguageCodes.json +7927 -0
- package/data/languageResources/mmsLanguages.json +28164 -0
- package/data/languageResources/phoneLanguages.json +1532 -0
- package/data/languageResources/phoneLanguages.ts +14 -0
- package/data/languages.json +7045 -0
- package/data/languages.ts +4 -0
- package/data/mediaDurations.json +32364 -0
- package/data/mediaDurations.ts +4 -0
- package/data/notification.json +69 -0
- package/data/notification.ts +4 -0
- package/data/numeralMaps.json +26 -0
- package/data/numeralMaps.ts +4 -0
- package/data/orphanedBibleTexts.json +2747 -0
- package/data/questions.json +317 -0
- package/data/questions.ts +4 -0
- package/data/questionsCurriculums.json +753 -0
- package/data/questionsCurriculums.ts +4 -0
- package/data/releaseNotes.json +2381 -0
- package/data/releaseNotes.ts +4 -0
- package/data/schemas/appTranslations.schema.json +802 -0
- package/data/schemas/areas.schema.json +76 -0
- package/data/schemas/aslTimestamps.schema.json +59 -0
- package/data/schemas/bibleAudios.schema.json +37 -0
- package/data/schemas/bibleBooks.schema.json +112 -0
- package/data/schemas/bibleChapters.schema.json +61 -0
- package/data/schemas/bibleStatuses.schema.json +41 -0
- package/data/schemas/bibleTexts.schema.json +60 -0
- package/data/schemas/clones.schema.json +63 -0
- package/data/schemas/countries.schema.json +84 -0
- package/data/schemas/foundationsCurriculums.schema.json +20 -0
- package/data/schemas/introductionTranslations.schema.json +101 -0
- package/data/schemas/languages.schema.json +365 -0
- package/data/schemas/mediaDurations.schema.json +41 -0
- package/data/schemas/notification.schema.json +111 -0
- package/data/schemas/numeralMaps.schema.json +57 -0
- package/data/schemas/questionTranslations.schema.json +20 -0
- package/data/schemas/questions.schema.json +29 -0
- package/data/schemas/questionsCurriculums.schema.json +34 -0
- package/data/schemas/releaseNotes.schema.json +21 -0
- package/data/schemas/screenshots.schema.json +23 -0
- package/data/schemas/setTranslations.schema.json +70 -0
- package/data/schemas/sets.schema.json +109 -0
- package/data/schemas/topicsCurriculums.schema.json +20 -0
- package/data/screenshots.json +17 -0
- package/data/screenshots.ts +4 -0
- package/data/sets.json +12258 -0
- package/data/sets.ts +4 -0
- package/data/specialIds.json +72 -0
- package/data/specialIds.ts +19 -0
- package/data/timings/som.json +9150 -0
- package/data/topicsCurriculums.json +131 -0
- package/data/topicsCurriculums.ts +4 -0
- package/data/typescript/appTranslations.ts +322 -0
- package/data/typescript/areas.ts +45 -0
- package/data/typescript/aslTimestamps.ts +36 -0
- package/data/typescript/bibleAudioAvailableChapters.ts +35 -0
- package/data/typescript/bibleAudios.ts +32 -0
- package/data/typescript/bibleBookNames.ts +97 -0
- package/data/typescript/bibleBooks.ts +63 -0
- package/data/typescript/bibleChapters.ts +40 -0
- package/data/typescript/bibleStatuses.ts +54 -0
- package/data/typescript/bibleTextAvailableChapters.ts +35 -0
- package/data/typescript/bibleTexts.ts +63 -0
- package/data/typescript/clones.ts +35 -0
- package/data/typescript/countries.ts +152 -0
- package/data/typescript/foundationsCurriculums.ts +15 -0
- package/data/typescript/introductionTranslations.ts +60 -0
- package/data/typescript/languages.ts +369 -0
- package/data/typescript/mediaDurations.ts +89 -0
- package/data/typescript/notification.ts +189 -0
- package/data/typescript/numeralMaps.ts +74 -0
- package/data/typescript/questionTranslations.ts +6 -0
- package/data/typescript/questions.ts +25 -0
- package/data/typescript/questionsCurriculums.ts +26 -0
- package/data/typescript/releaseNotes.ts +10 -0
- package/data/typescript/screenshots.ts +52 -0
- package/data/typescript/setTranslations.ts +39 -0
- package/data/typescript/sets.ts +105 -0
- package/data/typescript/topicsCurriculums.ts +15 -0
- package/data/youtube/playlists.json +28 -0
- package/data/youtube/videos.json +262 -0
- package/data/youtube/videos.ts +2 -0
- package/functions/activeCampaign.ts +127 -0
- package/functions/bibleChapterUtils.ts +241 -0
- package/functions/crowdin.ts +51 -0
- package/functions/languages.ts +284 -0
- package/functions/scripturePassages.ts +368 -0
- package/functions/sets.ts +495 -0
- package/package.json +10 -0
- package/translations/appTranslations.json +10239 -0
- package/translations/appTranslations.ts +4 -0
- package/translations/introductionTranslations.json +422 -0
- package/translations/introductionTranslations.ts +4 -0
- package/translations/questionTranslations.json +1472 -0
- package/translations/questionTranslations.ts +4 -0
- package/translations/setTranslations.json +30257 -0
- package/translations/setTranslations.ts +4 -0
- package/translations/spokenQuestionTranslations.json +1472 -0
- package/types/analytics.ts +147 -0
- package/types/completions.ts +9 -0
- package/types/feedback.ts +27 -0
- package/types/languages.ts +37 -0
- package/types/notifications.ts +37 -0
- package/types/sets.ts +84 -0
- package/types/users.ts +162 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { z } from "zod"
|
|
2
|
+
|
|
3
|
+
export const bibleBookNames = z.record(z.union([z.record(z.string()), z.record(z.union([z.string().describe("Localized name for the book ID (e.g., 'GEN' -> 'Génesis')"), z.string().describe("Localized name of the bible book")])).superRefine((value, ctx) => {
|
|
4
|
+
for (const key in value) {
|
|
5
|
+
let evaluated = false
|
|
6
|
+
if (key.match(new RegExp("^[A-Z0-9]{3}$"))) {
|
|
7
|
+
evaluated = true
|
|
8
|
+
const result = z.string().describe("Localized name for the book ID (e.g., 'GEN' -> 'Génesis')").safeParse(value[key])
|
|
9
|
+
if (!result.success) {
|
|
10
|
+
ctx.addIssue({
|
|
11
|
+
path: [...ctx.path, key],
|
|
12
|
+
code: 'custom',
|
|
13
|
+
message: `Invalid input: Key matching regex /${key}/ must match schema`,
|
|
14
|
+
params: {
|
|
15
|
+
issues: result.error.issues
|
|
16
|
+
}
|
|
17
|
+
})
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
if (!evaluated) {
|
|
21
|
+
const result = z.string().describe("Localized name of the bible book").safeParse(value[key])
|
|
22
|
+
if (!result.success) {
|
|
23
|
+
ctx.addIssue({
|
|
24
|
+
path: [...ctx.path, key],
|
|
25
|
+
code: 'custom',
|
|
26
|
+
message: `Invalid input: must match catchall schema`,
|
|
27
|
+
params: {
|
|
28
|
+
issues: result.error.issues
|
|
29
|
+
}
|
|
30
|
+
})
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}).describe("A mapping of Bible book IDs to their localized names for this translation")])).superRefine((value, ctx) => {
|
|
35
|
+
for (const key in value) {
|
|
36
|
+
let evaluated = false
|
|
37
|
+
if (key.match(new RegExp("^[A-Z0-9]+$"))) {
|
|
38
|
+
evaluated = true
|
|
39
|
+
const result = z.record(z.string()).safeParse(value[key])
|
|
40
|
+
if (!result.success) {
|
|
41
|
+
ctx.addIssue({
|
|
42
|
+
path: [...ctx.path, key],
|
|
43
|
+
code: 'custom',
|
|
44
|
+
message: `Invalid input: Key matching regex /${key}/ must match schema`,
|
|
45
|
+
params: {
|
|
46
|
+
issues: result.error.issues
|
|
47
|
+
}
|
|
48
|
+
})
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
if (!evaluated) {
|
|
52
|
+
const result = z.record(z.union([z.string().describe("Localized name for the book ID (e.g., 'GEN' -> 'Génesis')"), z.string().describe("Localized name of the bible book")])).superRefine((value, ctx) => {
|
|
53
|
+
for (const key in value) {
|
|
54
|
+
let evaluated = false
|
|
55
|
+
if (key.match(new RegExp("^[A-Z0-9]{3}$"))) {
|
|
56
|
+
evaluated = true
|
|
57
|
+
const result = z.string().describe("Localized name for the book ID (e.g., 'GEN' -> 'Génesis')").safeParse(value[key])
|
|
58
|
+
if (!result.success) {
|
|
59
|
+
ctx.addIssue({
|
|
60
|
+
path: [...ctx.path, key],
|
|
61
|
+
code: 'custom',
|
|
62
|
+
message: `Invalid input: Key matching regex /${key}/ must match schema`,
|
|
63
|
+
params: {
|
|
64
|
+
issues: result.error.issues
|
|
65
|
+
}
|
|
66
|
+
})
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
if (!evaluated) {
|
|
70
|
+
const result = z.string().describe("Localized name of the bible book").safeParse(value[key])
|
|
71
|
+
if (!result.success) {
|
|
72
|
+
ctx.addIssue({
|
|
73
|
+
path: [...ctx.path, key],
|
|
74
|
+
code: 'custom',
|
|
75
|
+
message: `Invalid input: must match catchall schema`,
|
|
76
|
+
params: {
|
|
77
|
+
issues: result.error.issues
|
|
78
|
+
}
|
|
79
|
+
})
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}).describe("A mapping of Bible book IDs to their localized names for this translation").safeParse(value[key])
|
|
84
|
+
if (!result.success) {
|
|
85
|
+
ctx.addIssue({
|
|
86
|
+
path: [...ctx.path, key],
|
|
87
|
+
code: 'custom',
|
|
88
|
+
message: `Invalid input: must match catchall schema`,
|
|
89
|
+
params: {
|
|
90
|
+
issues: result.error.issues
|
|
91
|
+
}
|
|
92
|
+
})
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}).describe("A mapping of bible translation IDs to their localized book names")
|
|
97
|
+
export type BibleBookNames = z.infer<typeof bibleBookNames>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
|
|
3
|
+
export const bibleBooks = z.array(
|
|
4
|
+
z.object({
|
|
5
|
+
name: z.string().describe('The name of the book.'),
|
|
6
|
+
title: z.string().describe('The title of the book.'),
|
|
7
|
+
bookId: z
|
|
8
|
+
.string()
|
|
9
|
+
.describe('The book identifier from the second JSON file.'),
|
|
10
|
+
chapters: z
|
|
11
|
+
.array(z.object({ id: z.string(), verses: z.number() }))
|
|
12
|
+
.describe('An array of chapter identifiers for the book.'),
|
|
13
|
+
englishDivision: z
|
|
14
|
+
.string()
|
|
15
|
+
.describe(
|
|
16
|
+
"The English division of the book (e.g., 'Pentateuch', 'Wisdom')."
|
|
17
|
+
),
|
|
18
|
+
hebrewDivision: z
|
|
19
|
+
.union([
|
|
20
|
+
z
|
|
21
|
+
.string()
|
|
22
|
+
.describe(
|
|
23
|
+
"The Hebrew division of the book (e.g., 'Torah', 'Ketuvim')."
|
|
24
|
+
),
|
|
25
|
+
z
|
|
26
|
+
.null()
|
|
27
|
+
.describe(
|
|
28
|
+
"The Hebrew division of the book (e.g., 'Torah', 'Ketuvim')."
|
|
29
|
+
),
|
|
30
|
+
])
|
|
31
|
+
.describe("The Hebrew division of the book (e.g., 'Torah', 'Ketuvim').")
|
|
32
|
+
.optional(),
|
|
33
|
+
hebrewOrder: z
|
|
34
|
+
.union([
|
|
35
|
+
z.number().int().describe('The order of the book in the Hebrew Bible.'),
|
|
36
|
+
z.null().describe('The order of the book in the Hebrew Bible.'),
|
|
37
|
+
])
|
|
38
|
+
.describe('The order of the book in the Hebrew Bible.')
|
|
39
|
+
.optional(),
|
|
40
|
+
isNt: z
|
|
41
|
+
.boolean()
|
|
42
|
+
.describe('Indicates if the book is in the New Testament.'),
|
|
43
|
+
lowercase: z.string().describe('The lowercase title of the book.'),
|
|
44
|
+
lowercase_dashes: z
|
|
45
|
+
.string()
|
|
46
|
+
.describe('The lowercase title of the book with dashes.'),
|
|
47
|
+
number: z
|
|
48
|
+
.number()
|
|
49
|
+
.int()
|
|
50
|
+
.describe('The numeric order of the book in the Bible.'),
|
|
51
|
+
order: z.number().int().describe('The order of the book in the Bible.'),
|
|
52
|
+
testament: z
|
|
53
|
+
.string()
|
|
54
|
+
.describe("The testament of the book ('old' or 'new')."),
|
|
55
|
+
title_dashes: z.string().describe('The title of the book with dashes.'),
|
|
56
|
+
usfm: z.string().describe('The USFM code for the book.'),
|
|
57
|
+
nameAlternates: z
|
|
58
|
+
.array(z.string())
|
|
59
|
+
.describe('Alternative names for the book.')
|
|
60
|
+
.optional(),
|
|
61
|
+
})
|
|
62
|
+
)
|
|
63
|
+
export type BibleBooks = z.infer<typeof bibleBooks>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
|
|
3
|
+
export const bibleChapters = z.array(
|
|
4
|
+
z
|
|
5
|
+
.object({
|
|
6
|
+
bookName: z.string(),
|
|
7
|
+
chapterId: z
|
|
8
|
+
.string()
|
|
9
|
+
.regex(
|
|
10
|
+
new RegExp(
|
|
11
|
+
'^(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)\\.[0-9]+$'
|
|
12
|
+
)
|
|
13
|
+
),
|
|
14
|
+
reference: z.string().optional(),
|
|
15
|
+
titles: z.union([z.record(z.string()), z.null()]).optional(),
|
|
16
|
+
translationId: z.string(),
|
|
17
|
+
verses: z
|
|
18
|
+
.array(
|
|
19
|
+
z
|
|
20
|
+
.object({
|
|
21
|
+
text: z.string(),
|
|
22
|
+
timings: z
|
|
23
|
+
.union([z.tuple([z.number(), z.number()]), z.null()])
|
|
24
|
+
.optional(),
|
|
25
|
+
uroman: z.union([z.string(), z.null()]).optional(),
|
|
26
|
+
verseId: z
|
|
27
|
+
.string()
|
|
28
|
+
.regex(
|
|
29
|
+
new RegExp(
|
|
30
|
+
'^(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)\\.[0-9]+\\.[0-9]+(-[0-9]+)?$'
|
|
31
|
+
)
|
|
32
|
+
),
|
|
33
|
+
})
|
|
34
|
+
.strict()
|
|
35
|
+
)
|
|
36
|
+
.min(1),
|
|
37
|
+
})
|
|
38
|
+
.strict()
|
|
39
|
+
)
|
|
40
|
+
export type BibleChapters = z.infer<typeof bibleChapters>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
|
|
3
|
+
export const bibleStatuses = z
|
|
4
|
+
.record(
|
|
5
|
+
z
|
|
6
|
+
.object({
|
|
7
|
+
text: z.array(
|
|
8
|
+
z.string().regex(new RegExp('^([A-Z0-9]{3}(\\.[0-9]+)?|OT|NT)$'))
|
|
9
|
+
),
|
|
10
|
+
audio: z.array(
|
|
11
|
+
z.string().regex(new RegExp('^([A-Z0-9]{3}(\\.[0-9]+)?|OT|NT)$'))
|
|
12
|
+
),
|
|
13
|
+
timings: z.array(
|
|
14
|
+
z.string().regex(new RegExp('^([A-Z0-9]{3}(\\.[0-9]+)?|OT|NT)$'))
|
|
15
|
+
),
|
|
16
|
+
bookNames: z.record(z.string()),
|
|
17
|
+
})
|
|
18
|
+
.strict()
|
|
19
|
+
)
|
|
20
|
+
.superRefine((value, ctx) => {
|
|
21
|
+
for (const key in value) {
|
|
22
|
+
if (key.match(new RegExp('^[A-Z0-9]+$'))) {
|
|
23
|
+
const result = z
|
|
24
|
+
.object({
|
|
25
|
+
text: z.array(
|
|
26
|
+
z.string().regex(new RegExp('^([A-Z0-9]{3}(\\.[0-9]+)?|OT|NT)$'))
|
|
27
|
+
),
|
|
28
|
+
audio: z.array(
|
|
29
|
+
z.string().regex(new RegExp('^([A-Z0-9]{3}(\\.[0-9]+)?|OT|NT)$'))
|
|
30
|
+
),
|
|
31
|
+
timings: z.array(
|
|
32
|
+
z.string().regex(new RegExp('^([A-Z0-9]{3}(\\.[0-9]+)?|OT|NT)$'))
|
|
33
|
+
),
|
|
34
|
+
bookNames: z.record(z.string()),
|
|
35
|
+
})
|
|
36
|
+
.strict()
|
|
37
|
+
.safeParse(value[key])
|
|
38
|
+
if (!result.success) {
|
|
39
|
+
ctx.addIssue({
|
|
40
|
+
path: [...ctx.path, key],
|
|
41
|
+
code: 'custom',
|
|
42
|
+
message: `Invalid input: Key matching regex /${key}/ must match schema`,
|
|
43
|
+
params: {
|
|
44
|
+
issues: result.error.issues,
|
|
45
|
+
},
|
|
46
|
+
})
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
})
|
|
51
|
+
.describe(
|
|
52
|
+
"Consolidated bible data containing text chapters, audio chapters, timings, and book names for each translation. Entries can be testament IDs ('OT', 'NT'), book IDs (e.g., 'GEN') for complete books, or chapter IDs (e.g., 'GEN.1') for individual chapters."
|
|
53
|
+
)
|
|
54
|
+
export type BibleStatuses = z.infer<typeof bibleStatuses>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { z } from "zod"
|
|
2
|
+
|
|
3
|
+
export const bibleTextAvailableChapters = z.record(z.union([z.array(z.string().regex(new RegExp("^[A-Z0-9]{3}\\.[0-9]+$"))), z.array(z.string().regex(new RegExp("^[A-Z0-9]{3}\\.[0-9]+$")).describe("Chapter identifier in the format 'BOOK.CHAPTER' (e.g., 'GEN.1', 'REV.22')")).describe("Array of available text chapter identifiers for this translation")])).superRefine((value, ctx) => {
|
|
4
|
+
for (const key in value) {
|
|
5
|
+
let evaluated = false
|
|
6
|
+
if (key.match(new RegExp("^[A-Z0-9]+$"))) {
|
|
7
|
+
evaluated = true
|
|
8
|
+
const result = z.array(z.string().regex(new RegExp("^[A-Z0-9]{3}\\.[0-9]+$"))).safeParse(value[key])
|
|
9
|
+
if (!result.success) {
|
|
10
|
+
ctx.addIssue({
|
|
11
|
+
path: [...ctx.path, key],
|
|
12
|
+
code: 'custom',
|
|
13
|
+
message: `Invalid input: Key matching regex /${key}/ must match schema`,
|
|
14
|
+
params: {
|
|
15
|
+
issues: result.error.issues
|
|
16
|
+
}
|
|
17
|
+
})
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
if (!evaluated) {
|
|
21
|
+
const result = z.array(z.string().regex(new RegExp("^[A-Z0-9]{3}\\.[0-9]+$")).describe("Chapter identifier in the format 'BOOK.CHAPTER' (e.g., 'GEN.1', 'REV.22')")).describe("Array of available text chapter identifiers for this translation").safeParse(value[key])
|
|
22
|
+
if (!result.success) {
|
|
23
|
+
ctx.addIssue({
|
|
24
|
+
path: [...ctx.path, key],
|
|
25
|
+
code: 'custom',
|
|
26
|
+
message: `Invalid input: must match catchall schema`,
|
|
27
|
+
params: {
|
|
28
|
+
issues: result.error.issues
|
|
29
|
+
}
|
|
30
|
+
})
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}).describe("A mapping of bible translation IDs to their available text chapters")
|
|
35
|
+
export type BibleTextAvailableChapters = z.infer<typeof bibleTextAvailableChapters>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
|
|
3
|
+
export const bibleTexts = z.array(
|
|
4
|
+
z
|
|
5
|
+
.object({
|
|
6
|
+
bibleTextId: z.string(),
|
|
7
|
+
name: z
|
|
8
|
+
.string()
|
|
9
|
+
.describe('The name of the bible translation in its own language.'),
|
|
10
|
+
alternativeFull: z
|
|
11
|
+
.string()
|
|
12
|
+
.describe(
|
|
13
|
+
"If a bible isn't available for the full Bible due to licensing restrictions, define an alternative Bible that does support full Bible here."
|
|
14
|
+
)
|
|
15
|
+
.optional(),
|
|
16
|
+
audioId: z
|
|
17
|
+
.string()
|
|
18
|
+
.describe(
|
|
19
|
+
'The bibleAudioId of the corresponding audio bible translation, if available.'
|
|
20
|
+
)
|
|
21
|
+
.optional(),
|
|
22
|
+
copyright: z
|
|
23
|
+
.string()
|
|
24
|
+
.describe(
|
|
25
|
+
'The copyright attribution text required to be shown in-app for this translation.'
|
|
26
|
+
)
|
|
27
|
+
.optional(),
|
|
28
|
+
copyrightImage: z
|
|
29
|
+
.string()
|
|
30
|
+
.describe('The image to display with the copyright.')
|
|
31
|
+
.optional(),
|
|
32
|
+
language: z
|
|
33
|
+
.string()
|
|
34
|
+
.regex(new RegExp('^[a-z]{3}$'))
|
|
35
|
+
.describe('The language of the translation.'),
|
|
36
|
+
nameEnglish: z
|
|
37
|
+
.string()
|
|
38
|
+
.describe('The name of the bible translation in English.')
|
|
39
|
+
.optional(),
|
|
40
|
+
textSource: z
|
|
41
|
+
.object({
|
|
42
|
+
includeSectionTitles: z
|
|
43
|
+
.boolean()
|
|
44
|
+
.describe('Whether or not to include section titles in the text.')
|
|
45
|
+
.optional(),
|
|
46
|
+
source: z.enum([
|
|
47
|
+
'dbl',
|
|
48
|
+
'bibleBrain',
|
|
49
|
+
'usfm',
|
|
50
|
+
'usfx',
|
|
51
|
+
'yvp',
|
|
52
|
+
'custom',
|
|
53
|
+
]),
|
|
54
|
+
sourceId: z.string().optional(),
|
|
55
|
+
})
|
|
56
|
+
.strict()
|
|
57
|
+
.describe(
|
|
58
|
+
"Information about how to retrieve the text. Ideally, text is available on the DBL via API.Bible when the license is granted, but there are a few other options. We have access to translations available on BibleBrain as well as being able to parse USFX files. Some translations may be available on the YouVersion Platform (yvp). If none of these work, 'custom' can be used and some custom code added to leviathan to retrieve and parse the text."
|
|
59
|
+
),
|
|
60
|
+
})
|
|
61
|
+
.strict()
|
|
62
|
+
)
|
|
63
|
+
export type BibleTexts = z.infer<typeof bibleTexts>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
|
|
3
|
+
export const clones = z.array(
|
|
4
|
+
z
|
|
5
|
+
.object({
|
|
6
|
+
appId: z.string().regex(new RegExp('^[a-z]*$')),
|
|
7
|
+
appIdCaps: z.string().regex(new RegExp('^[A-Z]*$')),
|
|
8
|
+
appName: z.string(),
|
|
9
|
+
color: z.string().regex(new RegExp('^#[0-9A-Fa-f]{6}$')),
|
|
10
|
+
icon: z
|
|
11
|
+
.string()
|
|
12
|
+
.regex(new RegExp('^src\\/assets\\/clones/[A-Za-z\\-\\_]*\\.png$')),
|
|
13
|
+
iconNoBg: z
|
|
14
|
+
.string()
|
|
15
|
+
.regex(new RegExp('^src\\/assets\\/clones/[A-Za-z\\-\\_]*\\.png$')),
|
|
16
|
+
languages: z.any().optional(),
|
|
17
|
+
linkAndroid: z
|
|
18
|
+
.string()
|
|
19
|
+
.describe(
|
|
20
|
+
'URL to the app in the Google Play Store. Just `https://play.google.com/store/apps/details?id=com.kingdomstrategies.` + the clone appId.'
|
|
21
|
+
),
|
|
22
|
+
linkIos: z
|
|
23
|
+
.string()
|
|
24
|
+
.describe(
|
|
25
|
+
'URL to the app in the Apple App Store. After creating app on ASC, go to App Store Connect > App Information > Additional Information > App Store ID.'
|
|
26
|
+
),
|
|
27
|
+
removeTraining: z
|
|
28
|
+
.boolean()
|
|
29
|
+
.describe(
|
|
30
|
+
'If true, the training section and content will be removed from the clone.'
|
|
31
|
+
),
|
|
32
|
+
})
|
|
33
|
+
.strict()
|
|
34
|
+
)
|
|
35
|
+
export type Clones = z.infer<typeof clones>
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
|
|
3
|
+
export const countries = z
|
|
4
|
+
.record(
|
|
5
|
+
z.union([
|
|
6
|
+
z
|
|
7
|
+
.object({
|
|
8
|
+
name: z.string().describe('The display name of the country'),
|
|
9
|
+
areaId: z
|
|
10
|
+
.enum([
|
|
11
|
+
'north-america',
|
|
12
|
+
'latin-america-caribbean',
|
|
13
|
+
'sub-saharan-africa',
|
|
14
|
+
'middle-east-north-africa',
|
|
15
|
+
'western-asia',
|
|
16
|
+
'western-europe',
|
|
17
|
+
'eastern-europe',
|
|
18
|
+
'southern-asia',
|
|
19
|
+
'central-asia',
|
|
20
|
+
'eastern-asia',
|
|
21
|
+
'southeast-asia',
|
|
22
|
+
'oceania',
|
|
23
|
+
])
|
|
24
|
+
.describe('The geographical area identifier'),
|
|
25
|
+
boundingBox: z
|
|
26
|
+
.object({
|
|
27
|
+
ne: z
|
|
28
|
+
.object({
|
|
29
|
+
lat: z
|
|
30
|
+
.number()
|
|
31
|
+
.gte(-90)
|
|
32
|
+
.lte(90)
|
|
33
|
+
.describe('Northeast latitude coordinate'),
|
|
34
|
+
lon: z
|
|
35
|
+
.number()
|
|
36
|
+
.gte(-180)
|
|
37
|
+
.lte(180)
|
|
38
|
+
.describe('Northeast longitude coordinate'),
|
|
39
|
+
})
|
|
40
|
+
.strict(),
|
|
41
|
+
sw: z
|
|
42
|
+
.object({
|
|
43
|
+
lat: z
|
|
44
|
+
.number()
|
|
45
|
+
.gte(-90)
|
|
46
|
+
.lte(90)
|
|
47
|
+
.describe('Southwest latitude coordinate'),
|
|
48
|
+
lon: z
|
|
49
|
+
.number()
|
|
50
|
+
.gte(-180)
|
|
51
|
+
.lte(180)
|
|
52
|
+
.describe('Southwest longitude coordinate'),
|
|
53
|
+
})
|
|
54
|
+
.strict(),
|
|
55
|
+
})
|
|
56
|
+
.strict()
|
|
57
|
+
.describe('Bounding box coordinates for the country'),
|
|
58
|
+
})
|
|
59
|
+
.strict(),
|
|
60
|
+
z.never(),
|
|
61
|
+
])
|
|
62
|
+
)
|
|
63
|
+
.superRefine((value, ctx) => {
|
|
64
|
+
for (const key in value) {
|
|
65
|
+
let evaluated = false
|
|
66
|
+
if (key.match(new RegExp('^[A-Z]{2}$'))) {
|
|
67
|
+
evaluated = true
|
|
68
|
+
const result = z
|
|
69
|
+
.object({
|
|
70
|
+
name: z.string().describe('The display name of the country'),
|
|
71
|
+
areaId: z
|
|
72
|
+
.enum([
|
|
73
|
+
'north-america',
|
|
74
|
+
'latin-america-caribbean',
|
|
75
|
+
'sub-saharan-africa',
|
|
76
|
+
'middle-east-north-africa',
|
|
77
|
+
'western-asia',
|
|
78
|
+
'western-europe',
|
|
79
|
+
'eastern-europe',
|
|
80
|
+
'southern-asia',
|
|
81
|
+
'central-asia',
|
|
82
|
+
'eastern-asia',
|
|
83
|
+
'southeast-asia',
|
|
84
|
+
'oceania',
|
|
85
|
+
])
|
|
86
|
+
.describe('The geographical area identifier'),
|
|
87
|
+
boundingBox: z
|
|
88
|
+
.object({
|
|
89
|
+
ne: z
|
|
90
|
+
.object({
|
|
91
|
+
lat: z
|
|
92
|
+
.number()
|
|
93
|
+
.gte(-90)
|
|
94
|
+
.lte(90)
|
|
95
|
+
.describe('Northeast latitude coordinate'),
|
|
96
|
+
lon: z
|
|
97
|
+
.number()
|
|
98
|
+
.gte(-180)
|
|
99
|
+
.lte(180)
|
|
100
|
+
.describe('Northeast longitude coordinate'),
|
|
101
|
+
})
|
|
102
|
+
.strict(),
|
|
103
|
+
sw: z
|
|
104
|
+
.object({
|
|
105
|
+
lat: z
|
|
106
|
+
.number()
|
|
107
|
+
.gte(-90)
|
|
108
|
+
.lte(90)
|
|
109
|
+
.describe('Southwest latitude coordinate'),
|
|
110
|
+
lon: z
|
|
111
|
+
.number()
|
|
112
|
+
.gte(-180)
|
|
113
|
+
.lte(180)
|
|
114
|
+
.describe('Southwest longitude coordinate'),
|
|
115
|
+
})
|
|
116
|
+
.strict(),
|
|
117
|
+
})
|
|
118
|
+
.strict()
|
|
119
|
+
.describe('Bounding box coordinates for the country'),
|
|
120
|
+
})
|
|
121
|
+
.strict()
|
|
122
|
+
.safeParse(value[key])
|
|
123
|
+
if (!result.success) {
|
|
124
|
+
ctx.addIssue({
|
|
125
|
+
path: [...ctx.path, key],
|
|
126
|
+
code: 'custom',
|
|
127
|
+
message: `Invalid input: Key matching regex /${key}/ must match schema`,
|
|
128
|
+
params: {
|
|
129
|
+
issues: result.error.issues,
|
|
130
|
+
},
|
|
131
|
+
})
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
if (!evaluated) {
|
|
135
|
+
const result = z.never().safeParse(value[key])
|
|
136
|
+
if (!result.success) {
|
|
137
|
+
ctx.addIssue({
|
|
138
|
+
path: [...ctx.path, key],
|
|
139
|
+
code: 'custom',
|
|
140
|
+
message: `Invalid input: must match catchall schema`,
|
|
141
|
+
params: {
|
|
142
|
+
issues: result.error.issues,
|
|
143
|
+
},
|
|
144
|
+
})
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
})
|
|
149
|
+
.describe(
|
|
150
|
+
'A mapping of country codes to country information including name, area, and bounding box coordinates'
|
|
151
|
+
)
|
|
152
|
+
export type Countries = z.infer<typeof countries>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
|
|
3
|
+
export const foundationsCurriculums = z.array(
|
|
4
|
+
z
|
|
5
|
+
.object({
|
|
6
|
+
curriculumId: z.string(),
|
|
7
|
+
sets: z
|
|
8
|
+
.array(z.string())
|
|
9
|
+
.describe(
|
|
10
|
+
'An array of set ids that make up this foundations curriculum. Set ids must be linked to valid sets present in data/sets.json.'
|
|
11
|
+
),
|
|
12
|
+
})
|
|
13
|
+
.strict()
|
|
14
|
+
)
|
|
15
|
+
export type FoundationsCurriculums = z.infer<typeof foundationsCurriculums>
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
|
|
3
|
+
export const introductionTranslations = z
|
|
4
|
+
.record(
|
|
5
|
+
z
|
|
6
|
+
.object({
|
|
7
|
+
introduction: z.string(),
|
|
8
|
+
introductions: z
|
|
9
|
+
.object({
|
|
10
|
+
'03.005.001': z.string().min(1),
|
|
11
|
+
'03.005.002': z.string().min(1),
|
|
12
|
+
'03.005.003': z.string().min(1),
|
|
13
|
+
'03.005.004': z.string().min(1),
|
|
14
|
+
'03.005.005': z.string().min(1),
|
|
15
|
+
'03.005.006': z.string().min(1),
|
|
16
|
+
'03.005.007': z.string().min(1),
|
|
17
|
+
'03.005.008': z.string().min(1),
|
|
18
|
+
'03.005.009': z.string().min(1),
|
|
19
|
+
'03.005.010': z.string().min(1),
|
|
20
|
+
'03.005.011': z.string().min(1),
|
|
21
|
+
'03.005.012': z.string().min(1),
|
|
22
|
+
'03.006.001': z.string().min(1),
|
|
23
|
+
'03.006.002': z.string().min(1),
|
|
24
|
+
'03.006.003': z.string().min(1),
|
|
25
|
+
'03.006.004': z.string().min(1),
|
|
26
|
+
'03.006.005': z.string().min(1),
|
|
27
|
+
'03.006.006': z.string().min(1),
|
|
28
|
+
'03.006.007': z.string().min(1),
|
|
29
|
+
'03.006.008': z.string().min(1),
|
|
30
|
+
'03.006.009': z.string().min(1),
|
|
31
|
+
'03.006.010': z.string().min(1),
|
|
32
|
+
'03.006.011': z.string().min(1),
|
|
33
|
+
'03.006.012': z.string().min(1),
|
|
34
|
+
'03.007.001': z.string().min(1),
|
|
35
|
+
'03.007.002': z.string().min(1),
|
|
36
|
+
'03.007.003': z.string().min(1),
|
|
37
|
+
'03.007.004': z.string().min(1),
|
|
38
|
+
'03.007.005': z.string().min(1),
|
|
39
|
+
'03.007.006': z.string().min(1),
|
|
40
|
+
'03.007.007': z.string().min(1),
|
|
41
|
+
'03.007.008': z.string().min(1),
|
|
42
|
+
'03.007.009': z.string().min(1),
|
|
43
|
+
'03.007.010': z.string().min(1),
|
|
44
|
+
'03.007.011': z.string().min(1),
|
|
45
|
+
'03.007.012': z.string().min(1),
|
|
46
|
+
eq: z.string().min(1),
|
|
47
|
+
})
|
|
48
|
+
.describe(
|
|
49
|
+
"Mapping of lesson identifiers (NN.NNN.NNN) or 'eq' to translated strings."
|
|
50
|
+
),
|
|
51
|
+
})
|
|
52
|
+
.strict()
|
|
53
|
+
.describe(
|
|
54
|
+
'Translations for a single language (identified by a 3-letter code).'
|
|
55
|
+
)
|
|
56
|
+
)
|
|
57
|
+
.describe(
|
|
58
|
+
"Schema for introductionTranslations_json. Root keys are 3-letter language identifiers (ISO-639 style). Each language object contains an 'introduction' string and an 'introductions' object mapping lesson identifiers (e.g. 03.005.001) or the key 'eq' to localized string content."
|
|
59
|
+
)
|
|
60
|
+
export type IntroductionTranslations = z.infer<typeof introductionTranslations>
|