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
package/.DS_Store
ADDED
|
Binary file
|
package/README.md
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# The Shared Directory
|
|
2
|
+
|
|
3
|
+
Several of Waha's other projects require data, types, functions, and translations from the main repo. Specifically:
|
|
4
|
+
|
|
5
|
+
- [waha-upload](https://github.com/kingdomstrategies/waha-upload)
|
|
6
|
+
- [waha-web](https://github.com/kingdomstrategies/waha-web)
|
|
7
|
+
- [waha-website](https://github.com/kingdomstrategies/waha-website)
|
|
8
|
+
- [waha-dashboard](https://github.com/kingdomstrategies/waha-dashboard)
|
|
9
|
+
|
|
10
|
+
This directory contains all of that shared data in one place so it can be easily copied. The ['copy.ts'](copy.ts) file simply copies the `shared` directory and all its contents from this repo into the root directory of whatever project it gets called in.
|
package/__init__.py
ADDED
|
File without changes
|
package/copy.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { cpSync, existsSync, mkdirSync, rmSync, writeFileSync } from 'fs'
|
|
2
|
+
import path from 'path'
|
|
3
|
+
import { fileURLToPath } from 'url'
|
|
4
|
+
|
|
5
|
+
const scriptPath = fileURLToPath(import.meta.url)
|
|
6
|
+
const sharedDir = path.dirname(scriptPath)
|
|
7
|
+
|
|
8
|
+
try {
|
|
9
|
+
if (existsSync('shared')) {
|
|
10
|
+
/** Clear out shared directory first to make sure we have a fresh copy. */
|
|
11
|
+
rmSync('shared', { recursive: true })
|
|
12
|
+
}
|
|
13
|
+
mkdirSync('shared', { recursive: true })
|
|
14
|
+
cpSync(sharedDir, 'shared', { recursive: true })
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Copy script should ONLY be run from the waha-app and thus should not be
|
|
18
|
+
* copied.
|
|
19
|
+
*/
|
|
20
|
+
rmSync('shared/copy.ts', { force: true })
|
|
21
|
+
|
|
22
|
+
writeFileSync(
|
|
23
|
+
'shared/README.md',
|
|
24
|
+
[
|
|
25
|
+
'# The Shared Directory',
|
|
26
|
+
'Do not edit any files in this directory as they are automatically copied over from the main `waha-app` repo. Instead, edit the files in the main `waha-app` repo and then re-copy them to this project.',
|
|
27
|
+
'## Re-copying the Shared Directory',
|
|
28
|
+
'To update the contents of this directory, simply run the command `npx tsx PATH_TO_COPY_FILE_IN_THE_WAHA_APP_REPO` where `PATH_TO_COPY_FILE_IN_THE_WAHA_APP_REPO` is the path to the `copy.ts` file in the `waha-app` repo. For example, if the `waha-app` repo has the same parent directory as this project, you would run `npx tsx ../waha-app/shared/copy.ts`',
|
|
29
|
+
].join('\n\n')
|
|
30
|
+
)
|
|
31
|
+
console.log(
|
|
32
|
+
`Successfully copied the shared folder from ${sharedDir} to shared`
|
|
33
|
+
)
|
|
34
|
+
} catch (error) {
|
|
35
|
+
console.error('Error copying shared directory:', error)
|
|
36
|
+
process.exit(1)
|
|
37
|
+
}
|
package/data/README.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# The `data` directory
|
|
2
|
+
|
|
3
|
+
This directory contains a bunch of json data files that are used in various parts of Waha. Some are used for the mobile app, some for leviathan, and some for both.
|
|
4
|
+
|
|
5
|
+
## Directories
|
|
6
|
+
|
|
7
|
+
- [`bibleResources`](./bibleResources): Contains some miscellaneous files related to the Bible.
|
|
8
|
+
- [`audioBibleLicenses.json`](./bibleResources/audioBibleLicenses.json): Contains all audio Bible licenses that Waha has access to on the Digital Bible Library (DBL). Generated [here](/leviathan/scripts/get_licenses.py).
|
|
9
|
+
- [`bibleBooks.json`](./bibleResources/bibleBooks.json): List of books/chapters of the Bible. Used for the [Bible navigator component](/src/components/Bible/Navigator.tsx).
|
|
10
|
+
- [`bibleChaptersList.json`](./bibleResources/bibleChaptersList.json): List of all chapters in the Bible named by their USFM ids.
|
|
11
|
+
- [`textBibleLicenses.json`](./bibleResources/textBibleLicenses.json): Contains all text Bible licenses that Waha has access to on the DBL. Generated [here](/leviathan/scripts/get_licenses.py).
|
|
12
|
+
|
|
13
|
+
- [`languageResources`](./languageResources): Contains some extra miscellaneous data files related to world languages.
|
|
14
|
+
- [`countriesAndLanguages.json`](./languageResources/countriesAndLanguages.json): Contains a list of all countries in the world and which languages are spoken there. Data scraped from [ethnologue](https://www.ethnologue.com) [here](/scripts/archive/getCountriesAndLanguages.py). Used for 2 purposes. Firstly, to populate the `countries` field for each language in [languages](./languages.json). See [`here`](/scripts/mapCountriesToLanguages.ts). This information is shown on the website to show which countries a language is most spoken in. Secondly, it's used in the mobile app to determine the default meet languages selected for a user when they go through onboarding based on their phone's country.
|
|
15
|
+
- [`iso6933LanguageCodes`](./languageResources/iso6933LanguageCodes.json): Contains a list of ISO 639-3 language codes. See [here](https://iso639-3.sil.org/code_tables/639/data). This is used to make sure we use existing language codes when adding new Waha languages, or to make sure that, if we are adding a language that doesn't have an existing code, we don't accidentally use a code that is already in use. In this case, the new language code should be manually added to this file so it doesn't get used accidentally in the future.
|
|
16
|
+
- [`mmsLanguages`](./languageResources/mmsLanguages.json): Contains a list of languages supported by Facebook's mms model. We use this model all over the place in `leviathan`, and use this list to make sure we are only running it on supported languages.
|
|
17
|
+
- [`phoneLanguages`](./languageResources/phoneLanguages.json): Contains a list of languages that phones support and potential alternatives if Waha doesn't support them. Used to set the user's default app interface language in the mobile app. See [here](/shared/functions/languages.ts) for more info.
|
|
18
|
+
|
|
19
|
+
- [`python`](./python): Contains auto-generated python pydantic types for the data files. Generated using `scripts/makeTypes.ts`. This script takes the schemas found in the `schema` folder and creates pydantic types for using with Leviathan.
|
|
20
|
+
- [`schemas`](./schemas): Contains json schemas for the data files. You can use your own json schema validator to validate the data files against these schemas as you update them. If you use VSCode, they are matched against their files [here](/.vscode/settings.json).
|
|
21
|
+
- [`scripture`](./scripture): Contains full Scripture passages for all Bible translations to be used in Waha lessons. Gets populated by `scripts/getScripture.ts`. These are separated by Bible translation for convenience and clarity, but are combined into a single file in [`prebuild`](/scripts/prebuild.ts) that can be easily imported into the mobile app.
|
|
22
|
+
- [`timings`](./timings): Contains data for the start times of each section (questions and scripture passages) of each Waha lesson, separated into files by language. These are used to skip to a specific section in the lesson and to highlight the text of a section when the audio reaches that point. These get written automatically [here](/leviathan/scripts/make_video_lessons.py). Like [`scripture`](scripture), these are combined into a single file in [`prebuild`](/scripts/prebuild.ts) that can be easily imported into the mobile app.
|
|
23
|
+
- [`typescript`](./typescript): Contains auto-generated typescript interfaces for the data files. Generated using `scripts/makeTypes.ts`. This script takes the schemas found in the `schema` folder and creates Typescript interfaces for importing into the mobile app.
|
|
24
|
+
- [`youtube`](./youtube): Contains data for Waha's Youtube videos and playlists.
|
|
25
|
+
- [`playlists.json`](./youtube/playlists.json): Contains ids for each language's Disciple Making Course Youtube playlist. This is populated by and used [here](/leviathan/scripts/update_youtube_dmc.py) to add videos to the correct playlists.
|
|
26
|
+
- [`videos.json`](./youtube/videos.json): Contains individual ids for each language's Disciple Making Course Youtube video. This is used in the mobile app to determine if we can show a "watch on Youtube" button and if so, link to the correct video. See [here](/shared/functions/sets.ts) where a youtube link is attached to a lesson. This is updated automatically [here](/leviathan/scripts/update_youtube_dmc.py) when videos are updated in Youtube.
|
|
27
|
+
|
|
28
|
+
## Files
|
|
29
|
+
|
|
30
|
+
- [`__init__.py`](./__init__.py): This file is used to make this directory importable into a python file. It is empty and not used for anything else.
|
|
31
|
+
- [`allFiles.json`](./allFiles.json): Contains an array of all uploaded Waha lesson audio and video assets. This makes it really fast to check if a file exists in the mobile app, even when the app is offline, so we can hide or disable features for lessons that don't have all necessary assets. Generated during [`prebuild`](/scripts/prebuild.ts).
|
|
32
|
+
- [`bibleAudios.json`](./bibleAudios.json): Contains information about Waha's audio Bible translations.
|
|
33
|
+
- [`bibleTexts.json`](./bibleTexts.json): Contains information about Waha's text Bible translations.
|
|
34
|
+
- [`clones.json`](./clones.json): Contains information about Waha "clones" or "white-labels": altered versions of Waha that are built from the same source code but are listed separately on the stores with different names, icons, etc. See `docs/clones.md` for more information.
|
|
35
|
+
- [`foundationsCurriculums.json`](./foundationsCurriculums.json): Waha's various foundations curriculums. Matched with sets found in `data/sets.json` to get a language's story sets.
|
|
36
|
+
- [`languages`](./languages.json): Contains a list of Waha's languages and a bunch of information about them.
|
|
37
|
+
- [`notification`](./notification.json): The current push notification to be sent out with [sendPush](/scripts/sendPush.ts). `eng` should be the only language defined first. The rest will be automatically translated before sending.
|
|
38
|
+
- [`questions.json`](./questions.json): Contains a list of Waha's questions and their associated data. This is used in the mobile app to show the questions in the lessons and in Leviathan to determine how to generate the questions. Similar to [`sets.json`](./sets.json), when adding new questions curriculums, any new questions must be added to this file.
|
|
39
|
+
- [`questionsCurriculums.json`](./questionsCurriculums.json): Waha's various question curriculums.
|
|
40
|
+
- [`releaseNotes.json`](./releaseNotes.json): Contains Waha's release notes. This is used in the mobile app to [show the release notes to users when they update the app](/src/hooks/useStartup.ts) and for development logs. This is updated automatically during [building](/scripts/build.ts).
|
|
41
|
+
- [`scripture.json`](./scripture.json): Contains all scripture passages for all Bible translations to be used in Waha lessons. This is combined from the files in the [`scripture`](./scripture) directory and is used in the mobile app to show the scripture passages in the lessons. This is updated automatically during [building](/scripts/build.ts).
|
|
42
|
+
- [`sets.json`](./sets.json): Contains a list of Waha's story sets across all curriculums and their associated data. When adding new story sets, any new sets must be added to this file.
|
|
43
|
+
- [`specialIds.json`](./specialIds.json): Contains a list of miscellaneous set/lesson ids defined for convenience. For example, if wanting to determine if a lesson id is part of the disciple making course, you can use `specialIds.dmCourseLessonIds.includes(lessonId)`.
|
|
44
|
+
- [`timings.json`](./timings.json): Contains data for the start times of each section (questions and scripture passages) of each Waha lesson. This is combined from the files in the [`timings`](./timings) directory and is used in the mobile app to skip to a specific section in the lesson and to highlight the text of a section when the audio reaches that point. This is updated automatically during [building](/scripts/build.ts).
|
|
45
|
+
- [`topicsCurriculums.json`](./topicsCurriculums.json): Waha's various topics curriculums. Matched with sets found in `data/sets.json` to get a language's story sets.
|
package/data/__init__.py
ADDED
|
File without changes
|