waha-shared 1.0.343 → 1.0.345

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.
Files changed (32) hide show
  1. package/dist/data/bibleAudios/bibleAudios.json +22 -0
  2. package/dist/data/bibleStatuses/bibleStatuses.json +594 -159
  3. package/dist/data/bibleTexts/bibleTexts.json +21 -0
  4. package/dist/data/languageAssets/index.d.ts +1 -0
  5. package/dist/data/languageAssets/index.js +7 -0
  6. package/dist/data/languageAssets/languageAssets.json +44404 -0
  7. package/dist/data/languageAssets/languageAssets.schema.json +19 -0
  8. package/dist/data/languageAssets/languageAssets.zod.d.ts +3 -0
  9. package/dist/data/languageAssets/languageAssets.zod.js +7 -0
  10. package/dist/data/languages/index.d.ts +5 -1
  11. package/dist/data/languages/languages.json +148 -54
  12. package/dist/data/languages/languages.schema.json +24 -3
  13. package/dist/data/languages/languages.zod.d.ts +10 -1
  14. package/dist/data/languages/languages.zod.js +18 -5
  15. package/dist/data/mediaDurations/mediaDurations.json +31030 -684
  16. package/dist/data/releaseNotes/releaseNotes.json +16 -2
  17. package/dist/data/translationsApp/index.d.ts +1 -0
  18. package/dist/data/translationsApp/translationsApp.json +41 -0
  19. package/dist/data/translationsApp/translationsApp.zod.d.ts +2 -0
  20. package/dist/data/translationsApp/translationsApp.zod.js +1 -0
  21. package/dist/data/youtubeVideos/youtubeVideos.json +55 -115
  22. package/dist/functions/ffmpeg.d.ts +104 -0
  23. package/dist/functions/ffmpeg.js +307 -0
  24. package/dist/functions/scripturePassages.js +9 -11
  25. package/dist/functions/sets.d.ts +15 -4
  26. package/dist/functions/sets.js +172 -228
  27. package/dist/functions/upload.d.ts +34 -0
  28. package/dist/functions/upload.js +49 -0
  29. package/dist/functions/utils.d.ts +6 -1
  30. package/dist/functions/utils.js +18 -4
  31. package/dist/types/sets.d.ts +22 -19
  32. package/package.json +3 -2
@@ -1,8 +1,22 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.firebasePath = exports.join = void 0;
4
- const firebase_1 = require("../data/firebase");
3
+ exports.getCachedDuration = exports.basenamenoext = exports.extname = exports.dirname = exports.first = exports.basename = exports.join = void 0;
4
+ const mediaDurations_1 = require("../data/mediaDurations");
5
5
  const join = (...parts) => parts.join('/').replace(/\/+/g, '/');
6
6
  exports.join = join;
7
- const firebasePath = (path) => firebase_1.firebaseUrl + encodeURIComponent(path) + `?alt=media`;
8
- exports.firebasePath = firebasePath;
7
+ const basename = (p) => p.split('/').pop();
8
+ exports.basename = basename;
9
+ const first = (p) => p.split('/')[0];
10
+ exports.first = first;
11
+ const dirname = (p) => p.substring(0, p.lastIndexOf('/'));
12
+ exports.dirname = dirname;
13
+ const extname = (p) => p.slice(p.lastIndexOf('.'));
14
+ exports.extname = extname;
15
+ const basenamenoext = (p) => {
16
+ const base = (0, exports.basename)(p);
17
+ const dotIndex = base.lastIndexOf('.');
18
+ return dotIndex !== -1 ? base.slice(0, dotIndex) : base;
19
+ };
20
+ exports.basenamenoext = basenamenoext;
21
+ const getCachedDuration = (path) => mediaDurations_1.mediaDurations[(0, exports.first)(path)]?.[(0, exports.basename)(path)];
22
+ exports.getCachedDuration = getCachedDuration;
@@ -13,13 +13,6 @@ export interface SetInfo extends Set {
13
13
  setTag?: string;
14
14
  setLink: string;
15
15
  }
16
- export interface Content {
17
- id: string;
18
- localFileName: string;
19
- remoteFileName: string;
20
- path: string;
21
- url: string;
22
- }
23
16
  export interface BaseInfo extends LanguageInfo {
24
17
  lessonNumber: string;
25
18
  lessonTitle: string | undefined;
@@ -32,7 +25,6 @@ export interface BaseInfo extends LanguageInfo {
32
25
  }
33
26
  export interface Section {
34
27
  id: string;
35
- languageId: string;
36
28
  header?: string;
37
29
  text?: string;
38
30
  index: number;
@@ -44,8 +36,8 @@ export interface Section {
44
36
  * Filename for the "From the Book" clip to insert before this section, if
45
37
  * there is one.
46
38
  */
47
- ftbFileName?: string;
48
- fileName: string;
39
+ ftbPath?: string;
40
+ path: string;
49
41
  }
50
42
  export interface EnrichedSection extends Section {
51
43
  startTime: number;
@@ -60,18 +52,29 @@ export interface EnrichedSection extends Section {
60
52
  }
61
53
  export interface DbsInfo extends BaseInfo, SetInfo, Lesson {
62
54
  type: 'dbs';
63
- full: Content;
64
- story: Content;
65
- dbsCast: {
66
- remoteFileName: string;
67
- url: string;
68
- };
55
+ fullPath: string;
56
+ storyPath: string;
57
+ dbsCastPath: string;
69
58
  passagesString: string;
70
59
  }
71
60
  export interface VideoInfo extends BaseInfo, SetInfo, Lesson {
72
61
  type: 'video';
73
- video: Content;
74
- trainingVideo: Content | undefined;
62
+ videoPath: string;
63
+ trainingVideoPath: string | undefined;
64
+ trainingVideoNarrationPath: string | undefined;
65
+ trainingVideoNarrationWithMusicPath: string | undefined;
66
+ trainingVideoOriginalPath: string | undefined;
67
+ /**
68
+ * Full audio file (training-video audio + scripture + questions). Populated
69
+ * only for video lessons that have audio to play (e.g. dmCourse lessons with
70
+ * scripture passages). Video-only lessons leave this undefined.
71
+ */
72
+ fullPath?: string;
73
+ /**
74
+ * Story audio file (scripture passages only). Same population rules as
75
+ * `full`.
76
+ */
77
+ storyPath?: string;
75
78
  lessonSectionHeader: string | undefined;
76
79
  lessonSectionBody: string | undefined;
77
80
  youtubeLink: string | undefined;
@@ -79,7 +82,7 @@ export interface VideoInfo extends BaseInfo, SetInfo, Lesson {
79
82
  }
80
83
  export interface EqInfo extends BaseInfo, SetInfo, Lesson {
81
84
  type: 'eq';
82
- eq: Content;
85
+ eqPath: string;
83
86
  }
84
87
  export type LessonInfo = DbsInfo | VideoInfo | EqInfo;
85
88
  export declare enum Chapter {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waha-shared",
3
- "version": "1.0.343",
3
+ "version": "1.0.345",
4
4
  "author": "Waha",
5
5
  "dependencies": {
6
6
  "@types/signale": "^1.4.7",
@@ -27,6 +27,7 @@
27
27
  "license": "MIT",
28
28
  "scripts": {
29
29
  "build": "npx tsc && copyfiles \"data/**/*.json\" dist",
30
- "update": "yarn build && REGISTRY_VERSION=$(npm view waha-shared version) && npm version $REGISTRY_VERSION --no-git-tag-version --allow-same-version && npm version patch && git add . && git commit -m 'Update shared types' && bash -c 'npm publish --access public --registry https://registry.npmjs.org --//registry.npmjs.org/:_authToken=$(grep NPM_TOKEN= ../.env | cut -d \"=\" -f2-)'"
30
+ "update": "yarn build && REGISTRY_VERSION=$(npm view waha-shared version) && npm version $REGISTRY_VERSION --no-git-tag-version --allow-same-version && npm version patch && git add . && git commit -m 'chore: update shared types' && bash -c 'npm publish --access public --registry https://registry.npmjs.org --//registry.npmjs.org/:_authToken=$(grep NPM_TOKEN= ../.env | cut -d \"=\" -f2-)'",
31
+ "updateManual": "(npm whoami || npm login) && yarn build && REGISTRY_VERSION=$(npm view waha-shared version) && npm version $REGISTRY_VERSION --no-git-tag-version --allow-same-version && git add dist package.json && git commit -m 'chore: update shared types' && npm publish"
31
32
  }
32
33
  }