waha-shared 1.0.1 → 1.0.3

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 (293) hide show
  1. package/README.md +2 -2
  2. package/dist/data/bibleAudios.d.ts +8 -0
  3. package/dist/data/bibleAudios.js +8 -0
  4. package/dist/data/bibleAudios.json +394 -0
  5. package/dist/data/bibleResources/bibleBooks.d.ts +3 -0
  6. package/dist/data/bibleResources/bibleBooks.js +7 -0
  7. package/dist/data/bibleResources/bibleBooks.json +6071 -0
  8. package/dist/data/bibleResources/bibleChaptersList.d.ts +2 -0
  9. package/dist/data/bibleResources/bibleChaptersList.js +8 -0
  10. package/dist/data/bibleResources/bibleChaptersList.json +1191 -0
  11. package/dist/data/bibleStatuses.d.ts +7 -0
  12. package/dist/data/bibleStatuses.js +8 -0
  13. package/dist/data/bibleStatuses.json +9196 -0
  14. package/dist/data/bibleTexts.d.ts +16 -0
  15. package/dist/data/bibleTexts.js +8 -0
  16. package/dist/data/bibleTexts.json +527 -0
  17. package/dist/data/countryResources/areas.d.ts +3 -0
  18. package/dist/data/countryResources/areas.js +7 -0
  19. package/dist/data/countryResources/areas.json +74 -0
  20. package/dist/data/countryResources/countries.d.ts +3 -0
  21. package/dist/data/countryResources/countries.js +7 -0
  22. package/dist/data/countryResources/countries.json +3362 -0
  23. package/dist/data/foundationsCurriculums.d.ts +5 -0
  24. package/dist/data/foundationsCurriculums.js +8 -0
  25. package/dist/data/foundationsCurriculums.json +130 -0
  26. package/dist/data/languageResources/countriesAndLanguages.d.ts +13 -0
  27. package/dist/data/languageResources/countriesAndLanguages.js +7 -0
  28. package/dist/data/languageResources/countriesAndLanguages.json +11718 -0
  29. package/dist/data/languageResources/phoneLanguages.d.ts +11 -0
  30. package/dist/data/languageResources/phoneLanguages.js +7 -0
  31. package/dist/data/languageResources/phoneLanguages.json +1532 -0
  32. package/dist/data/languages.d.ts +45 -0
  33. package/dist/data/languages.js +8 -0
  34. package/dist/data/languages.json +7045 -0
  35. package/dist/data/mediaDurations.d.ts +6 -0
  36. package/dist/data/mediaDurations.js +8 -0
  37. package/dist/data/mediaDurations.json +32364 -0
  38. package/dist/data/notification.d.ts +16 -0
  39. package/dist/data/notification.js +8 -0
  40. package/dist/data/notification.json +69 -0
  41. package/dist/data/numeralMaps.d.ts +13 -0
  42. package/dist/data/numeralMaps.js +8 -0
  43. package/dist/data/numeralMaps.json +26 -0
  44. package/dist/data/questions.d.ts +8 -0
  45. package/dist/data/questions.js +8 -0
  46. package/dist/data/questions.json +317 -0
  47. package/dist/data/questionsCurriculums.d.ts +8 -0
  48. package/dist/data/questionsCurriculums.js +8 -0
  49. package/dist/data/questionsCurriculums.json +753 -0
  50. package/dist/data/releaseNotes.d.ts +6 -0
  51. package/dist/data/releaseNotes.js +8 -0
  52. package/dist/data/releaseNotes.json +2381 -0
  53. package/dist/data/screenshots.d.ts +5 -0
  54. package/dist/data/screenshots.js +8 -0
  55. package/dist/data/screenshots.json +17 -0
  56. package/dist/data/sets.d.ts +14 -0
  57. package/dist/data/sets.js +8 -0
  58. package/dist/data/sets.json +12258 -0
  59. package/dist/data/specialIds.d.ts +18 -0
  60. package/dist/data/specialIds.js +7 -0
  61. package/dist/data/specialIds.json +72 -0
  62. package/dist/data/topicsCurriculums.d.ts +5 -0
  63. package/dist/data/topicsCurriculums.js +8 -0
  64. package/dist/data/topicsCurriculums.json +131 -0
  65. package/dist/data/typescript/appTranslations.d.ts +915 -0
  66. package/dist/data/typescript/appTranslations.js +315 -0
  67. package/dist/data/typescript/areas.d.ts +18 -0
  68. package/dist/data/typescript/areas.js +42 -0
  69. package/dist/data/typescript/aslTimestamps.d.ts +43 -0
  70. package/dist/data/typescript/aslTimestamps.js +31 -0
  71. package/dist/data/typescript/bibleAudioAvailableChapters.d.ts +3 -0
  72. package/dist/data/typescript/bibleAudioAvailableChapters.js +36 -0
  73. package/dist/data/typescript/bibleAudios.d.ts +21 -0
  74. package/dist/data/typescript/bibleAudios.js +23 -0
  75. package/dist/data/typescript/bibleBookNames.d.ts +3 -0
  76. package/dist/data/typescript/bibleBookNames.js +98 -0
  77. package/dist/data/typescript/bibleBooks.d.ts +69 -0
  78. package/dist/data/typescript/bibleBooks.js +56 -0
  79. package/dist/data/typescript/bibleChapters.d.ts +49 -0
  80. package/dist/data/typescript/bibleChapters.js +29 -0
  81. package/dist/data/typescript/bibleStatuses.d.ts +28 -0
  82. package/dist/data/typescript/bibleStatuses.js +39 -0
  83. package/dist/data/typescript/bibleTextAvailableChapters.d.ts +3 -0
  84. package/dist/data/typescript/bibleTextAvailableChapters.js +36 -0
  85. package/dist/data/typescript/bibleTexts.d.ts +53 -0
  86. package/dist/data/typescript/bibleTexts.js +54 -0
  87. package/dist/data/typescript/clones.d.ts +36 -0
  88. package/dist/data/typescript/clones.js +28 -0
  89. package/dist/data/typescript/countries.d.ts +98 -0
  90. package/dist/data/typescript/countries.js +149 -0
  91. package/dist/data/typescript/foundationsCurriculums.d.ts +12 -0
  92. package/dist/data/typescript/foundationsCurriculums.js +12 -0
  93. package/dist/data/typescript/introductionTranslations.d.ts +202 -0
  94. package/dist/data/typescript/introductionTranslations.js +53 -0
  95. package/dist/data/typescript/languages.d.ts +148 -0
  96. package/dist/data/typescript/languages.js +302 -0
  97. package/dist/data/typescript/mediaDurations.d.ts +23 -0
  98. package/dist/data/typescript/mediaDurations.js +72 -0
  99. package/dist/data/typescript/notification.d.ts +45 -0
  100. package/dist/data/typescript/notification.js +176 -0
  101. package/dist/data/typescript/numeralMaps.d.ts +58 -0
  102. package/dist/data/typescript/numeralMaps.js +71 -0
  103. package/dist/data/typescript/questionTranslations.d.ts +3 -0
  104. package/dist/data/typescript/questionTranslations.js +5 -0
  105. package/dist/data/typescript/questions.d.ts +21 -0
  106. package/dist/data/typescript/questions.js +18 -0
  107. package/dist/data/typescript/questionsCurriculums.d.ts +27 -0
  108. package/dist/data/typescript/questionsCurriculums.js +19 -0
  109. package/dist/data/typescript/releaseNotes.d.ts +15 -0
  110. package/dist/data/typescript/releaseNotes.js +9 -0
  111. package/dist/data/typescript/screenshots.d.ts +12 -0
  112. package/dist/data/typescript/screenshots.js +49 -0
  113. package/dist/data/typescript/setTranslations.d.ts +27 -0
  114. package/dist/data/typescript/setTranslations.js +32 -0
  115. package/dist/data/typescript/sets.d.ts +49 -0
  116. package/dist/data/typescript/sets.js +88 -0
  117. package/dist/data/typescript/topicsCurriculums.d.ts +12 -0
  118. package/dist/data/typescript/topicsCurriculums.js +12 -0
  119. package/dist/data/youtube/videos.d.ts +2 -0
  120. package/dist/data/youtube/videos.js +7 -0
  121. package/dist/data/youtube/videos.json +262 -0
  122. package/dist/functions/activeCampaign.d.ts +8 -0
  123. package/dist/functions/activeCampaign.js +97 -0
  124. package/dist/functions/bibleChapterUtils.d.ts +15 -0
  125. package/dist/functions/bibleChapterUtils.js +231 -0
  126. package/dist/functions/crowdin.d.ts +24 -0
  127. package/dist/functions/crowdin.js +34 -0
  128. package/dist/functions/languages.d.ts +24 -0
  129. package/dist/functions/languages.js +212 -0
  130. package/dist/functions/scripturePassages.d.ts +47 -0
  131. package/dist/functions/scripturePassages.js +261 -0
  132. package/dist/functions/sets.d.ts +30 -0
  133. package/dist/functions/sets.js +371 -0
  134. package/dist/translations/appTranslations.d.ts +306 -0
  135. package/dist/translations/appTranslations.js +8 -0
  136. package/dist/translations/appTranslations.json +10239 -0
  137. package/dist/translations/introductionTranslations.d.ts +43 -0
  138. package/dist/translations/introductionTranslations.js +8 -0
  139. package/dist/translations/introductionTranslations.json +422 -0
  140. package/dist/translations/questionTranslations.d.ts +2 -0
  141. package/dist/translations/questionTranslations.js +8 -0
  142. package/dist/translations/questionTranslations.json +1472 -0
  143. package/dist/translations/setTranslations.d.ts +10 -0
  144. package/dist/translations/setTranslations.js +8 -0
  145. package/dist/translations/setTranslations.json +30257 -0
  146. package/dist/types/analytics.d.ts +119 -0
  147. package/dist/types/analytics.js +2 -0
  148. package/dist/types/completions.d.ts +8 -0
  149. package/dist/types/completions.js +2 -0
  150. package/dist/types/feedback.d.ts +60 -0
  151. package/dist/types/feedback.js +27 -0
  152. package/dist/types/languages.d.ts +31 -0
  153. package/dist/types/languages.js +2 -0
  154. package/dist/types/notifications.d.ts +128 -0
  155. package/dist/types/notifications.js +30 -0
  156. package/dist/types/sets.d.ts +70 -0
  157. package/dist/types/sets.js +10 -0
  158. package/dist/types/users.d.ts +765 -0
  159. package/dist/types/users.js +137 -0
  160. package/package.json +2 -2
  161. package/.DS_Store +0 -0
  162. package/__init__.py +0 -0
  163. package/copy.ts +0 -37
  164. package/data/README.md +0 -45
  165. package/data/__init__.py +0 -0
  166. package/data/aslTimestamps.json +0 -192788
  167. package/data/bibleAudios.json +0 -394
  168. package/data/bibleAudios.ts +0 -4
  169. package/data/bibleResources/audioBibleLicenses.json +0 -6235
  170. package/data/bibleResources/bibleBooks.json +0 -6071
  171. package/data/bibleResources/bibleBooks.ts +0 -4
  172. package/data/bibleResources/bibleChaptersList.json +0 -1191
  173. package/data/bibleResources/bibleChaptersList.ts +0 -4
  174. package/data/bibleResources/textBibleLicenses.json +0 -14603
  175. package/data/bibleStatuses.json +0 -9196
  176. package/data/bibleStatuses.ts +0 -4
  177. package/data/bibleTexts.json +0 -527
  178. package/data/bibleTexts.ts +0 -4
  179. package/data/clones.json +0 -13
  180. package/data/countryResources/areas.json +0 -74
  181. package/data/countryResources/areas.ts +0 -4
  182. package/data/countryResources/countries.json +0 -3362
  183. package/data/countryResources/countries.ts +0 -4
  184. package/data/foundationsCurriculums.json +0 -130
  185. package/data/foundationsCurriculums.ts +0 -4
  186. package/data/languageResources/countriesAndLanguages.json +0 -11718
  187. package/data/languageResources/countriesAndLanguages.ts +0 -16
  188. package/data/languageResources/crowdinLanguages.json +0 -2172
  189. package/data/languageResources/iosVoiceOverLanguages.json +0 -64
  190. package/data/languageResources/iso6933LanguageCodes.json +0 -7927
  191. package/data/languageResources/mmsLanguages.json +0 -28164
  192. package/data/languageResources/phoneLanguages.json +0 -1532
  193. package/data/languageResources/phoneLanguages.ts +0 -14
  194. package/data/languages.json +0 -7045
  195. package/data/languages.ts +0 -4
  196. package/data/mediaDurations.json +0 -32364
  197. package/data/mediaDurations.ts +0 -4
  198. package/data/notification.json +0 -69
  199. package/data/notification.ts +0 -4
  200. package/data/numeralMaps.json +0 -26
  201. package/data/numeralMaps.ts +0 -4
  202. package/data/orphanedBibleTexts.json +0 -2747
  203. package/data/questions.json +0 -317
  204. package/data/questions.ts +0 -4
  205. package/data/questionsCurriculums.json +0 -753
  206. package/data/questionsCurriculums.ts +0 -4
  207. package/data/releaseNotes.json +0 -2381
  208. package/data/releaseNotes.ts +0 -4
  209. package/data/schemas/appTranslations.schema.json +0 -802
  210. package/data/schemas/areas.schema.json +0 -76
  211. package/data/schemas/aslTimestamps.schema.json +0 -59
  212. package/data/schemas/bibleAudios.schema.json +0 -37
  213. package/data/schemas/bibleBooks.schema.json +0 -112
  214. package/data/schemas/bibleChapters.schema.json +0 -61
  215. package/data/schemas/bibleStatuses.schema.json +0 -41
  216. package/data/schemas/bibleTexts.schema.json +0 -60
  217. package/data/schemas/clones.schema.json +0 -63
  218. package/data/schemas/countries.schema.json +0 -84
  219. package/data/schemas/foundationsCurriculums.schema.json +0 -20
  220. package/data/schemas/introductionTranslations.schema.json +0 -101
  221. package/data/schemas/languages.schema.json +0 -365
  222. package/data/schemas/mediaDurations.schema.json +0 -41
  223. package/data/schemas/notification.schema.json +0 -111
  224. package/data/schemas/numeralMaps.schema.json +0 -57
  225. package/data/schemas/questionTranslations.schema.json +0 -20
  226. package/data/schemas/questions.schema.json +0 -29
  227. package/data/schemas/questionsCurriculums.schema.json +0 -34
  228. package/data/schemas/releaseNotes.schema.json +0 -21
  229. package/data/schemas/screenshots.schema.json +0 -23
  230. package/data/schemas/setTranslations.schema.json +0 -70
  231. package/data/schemas/sets.schema.json +0 -109
  232. package/data/schemas/topicsCurriculums.schema.json +0 -20
  233. package/data/screenshots.json +0 -17
  234. package/data/screenshots.ts +0 -4
  235. package/data/sets.json +0 -12258
  236. package/data/sets.ts +0 -4
  237. package/data/specialIds.json +0 -72
  238. package/data/specialIds.ts +0 -19
  239. package/data/timings/som.json +0 -9150
  240. package/data/topicsCurriculums.json +0 -131
  241. package/data/topicsCurriculums.ts +0 -4
  242. package/data/typescript/appTranslations.ts +0 -322
  243. package/data/typescript/areas.ts +0 -45
  244. package/data/typescript/aslTimestamps.ts +0 -36
  245. package/data/typescript/bibleAudioAvailableChapters.ts +0 -35
  246. package/data/typescript/bibleAudios.ts +0 -32
  247. package/data/typescript/bibleBookNames.ts +0 -97
  248. package/data/typescript/bibleBooks.ts +0 -63
  249. package/data/typescript/bibleChapters.ts +0 -40
  250. package/data/typescript/bibleStatuses.ts +0 -54
  251. package/data/typescript/bibleTextAvailableChapters.ts +0 -35
  252. package/data/typescript/bibleTexts.ts +0 -63
  253. package/data/typescript/clones.ts +0 -35
  254. package/data/typescript/countries.ts +0 -152
  255. package/data/typescript/foundationsCurriculums.ts +0 -15
  256. package/data/typescript/introductionTranslations.ts +0 -60
  257. package/data/typescript/languages.ts +0 -369
  258. package/data/typescript/mediaDurations.ts +0 -89
  259. package/data/typescript/notification.ts +0 -189
  260. package/data/typescript/numeralMaps.ts +0 -74
  261. package/data/typescript/questionTranslations.ts +0 -6
  262. package/data/typescript/questions.ts +0 -25
  263. package/data/typescript/questionsCurriculums.ts +0 -26
  264. package/data/typescript/releaseNotes.ts +0 -10
  265. package/data/typescript/screenshots.ts +0 -52
  266. package/data/typescript/setTranslations.ts +0 -39
  267. package/data/typescript/sets.ts +0 -105
  268. package/data/typescript/topicsCurriculums.ts +0 -15
  269. package/data/youtube/playlists.json +0 -28
  270. package/data/youtube/videos.json +0 -262
  271. package/data/youtube/videos.ts +0 -2
  272. package/functions/activeCampaign.ts +0 -127
  273. package/functions/bibleChapterUtils.ts +0 -241
  274. package/functions/crowdin.ts +0 -51
  275. package/functions/languages.ts +0 -284
  276. package/functions/scripturePassages.ts +0 -368
  277. package/functions/sets.ts +0 -495
  278. package/translations/appTranslations.json +0 -10239
  279. package/translations/appTranslations.ts +0 -4
  280. package/translations/introductionTranslations.json +0 -422
  281. package/translations/introductionTranslations.ts +0 -4
  282. package/translations/questionTranslations.json +0 -1472
  283. package/translations/questionTranslations.ts +0 -4
  284. package/translations/setTranslations.json +0 -30257
  285. package/translations/setTranslations.ts +0 -4
  286. package/translations/spokenQuestionTranslations.json +0 -1472
  287. package/types/analytics.ts +0 -147
  288. package/types/completions.ts +0 -9
  289. package/types/feedback.ts +0 -27
  290. package/types/languages.ts +0 -37
  291. package/types/notifications.ts +0 -37
  292. package/types/sets.ts +0 -84
  293. package/types/users.ts +0 -162
@@ -1,147 +0,0 @@
1
- import type { ArticleSession, BibleSession, WahaShareContent } from './users'
2
-
3
- type Meeting =
4
- | {
5
- name: 'OpenPlayScreen'
6
- payload: {
7
- isLessonDownloaded: boolean
8
- }
9
- }
10
- | {
11
- name: 'CompleteLesson'
12
- payload: {
13
- timeToCompletion: number
14
- isAudioFacilitator: boolean
15
- }
16
- }
17
- | {
18
- name: 'ScheduleNextMeeting'
19
- payload: {
20
- date: number
21
- }
22
- }
23
- | {
24
- name: 'LeavePlayScreen'
25
- payload: {
26
- sessionLength: number
27
- endedInCompletion: boolean
28
- }
29
- }
30
- | {
31
- name: 'DbsCast'
32
- payload: null
33
- }
34
-
35
- type Article = {
36
- name: 'ArticleSession'
37
- payload: ArticleSession
38
- }
39
-
40
- type Share = {
41
- name: 'Share'
42
- payload: {
43
- content: WahaShareContent
44
- lessonId?: string
45
- }
46
- }
47
-
48
- type Misc =
49
- | {
50
- name: 'UnlockMobilizationTools'
51
- payload: null
52
- }
53
- | {
54
- name: 'EnableSecurityMode'
55
- payload: null
56
- }
57
- | {
58
- name: 'ClearStorage'
59
- payload: {
60
- languageToClear: string
61
- }
62
- }
63
- | {
64
- name: 'RequestCode'
65
- payload: null
66
- }
67
- | {
68
- name: 'ClickGiveButton'
69
- payload: null
70
- }
71
- | {
72
- name: 'NotificationOptIn'
73
- payload: {
74
- enabled: boolean
75
- }
76
- }
77
- | {
78
- name: 'FinishOnboarding'
79
- payload: {
80
- skipped: boolean
81
- }
82
- }
83
- | {
84
- name: 'ClickNotification'
85
- payload: {
86
- id: string
87
- notificationDate: string
88
- }
89
- }
90
- | {
91
- name: 'ClickNotificationLink'
92
- payload: {
93
- id: string
94
- notificationDate: string
95
- }
96
- }
97
- | {
98
- name: 'SetInitialLanguages'
99
- payload: {
100
- ipCountry: string
101
- phoneCountry: string
102
- languages: string[]
103
- }
104
- }
105
- | {
106
- name: 'ChangeInitialLanguages'
107
- payload: {
108
- ipCountry: string
109
- phoneCountry: string
110
- languages: string[]
111
- }
112
- }
113
- | {
114
- name: 'AskForReview'
115
- payload: null
116
- }
117
-
118
- type Note =
119
- | {
120
- name: 'MakeNote'
121
- payload: null
122
- }
123
- | {
124
- name: 'EditNote'
125
- payload: null
126
- }
127
- | {
128
- name: 'ViewNotes'
129
- payload: null
130
- }
131
- | {
132
- name: 'SavedNote'
133
- payload: {
134
- length: number
135
- }
136
- }
137
- | {
138
- name: 'DeleteNote'
139
- payload: null
140
- }
141
-
142
- type Bible = {
143
- name: 'BibleSession'
144
- payload: BibleSession
145
- }
146
-
147
- export type AnalyticsEvent = Meeting | Share | Misc | Article | Bible | Note
@@ -1,9 +0,0 @@
1
- import type { CompletionEvent } from './users'
2
-
3
- export interface SetProgress {
4
- completionEvents: CompletionEvent[]
5
- uniqueCompletions: CompletionEvent[]
6
- total: number
7
- progress: number
8
- percent: number
9
- }
package/types/feedback.ts DELETED
@@ -1,27 +0,0 @@
1
- import { z } from 'zod'
2
-
3
- export const FeedbackSchema = z.object({
4
- language: z.string(),
5
- appVersion: z.string(),
6
- OS: z.string(),
7
- timeSubmitted: z.number(),
8
- formName: z.string(),
9
- country: z.string().optional(),
10
- city: z.string().optional(),
11
- lessonId: z.string().nullable().optional(),
12
- wahaUserId: z.string().optional(),
13
- name: z.string().optional(),
14
- email: z.string().email(),
15
- // For the standard contact us form.
16
- message: z.string().optional(),
17
- // For the code request form.
18
- journey: z.union([z.string(), z.record(z.string(), z.boolean())]).optional(),
19
- goals: z.string().optional(),
20
- hear: z.string().optional(),
21
- // For the share story form.
22
- beforeWaha: z.string().optional(),
23
- godDone: z.string().optional(),
24
- findOut: z.string().optional(),
25
- })
26
-
27
- export type Feedback = z.infer<typeof FeedbackSchema>
@@ -1,37 +0,0 @@
1
- import type { BibleAudios } from '../data/typescript/bibleAudios'
2
- import type { BibleTexts } from '../data/typescript/bibleTexts'
3
- import type { IntroductionTranslations } from '../data/typescript/introductionTranslations'
4
- import type { Languages } from '../data/typescript/languages'
5
- import type { QuestionsCurriculums } from '../data/typescript/questionsCurriculums'
6
- import type { QuestionTranslations } from '../data/typescript/questionTranslations'
7
- import type { SetTranslations } from '../data/typescript/setTranslations'
8
-
9
- type Language = Languages[number]
10
- type BibleText = BibleTexts[number]
11
- type BibleAudio = BibleAudios[number]
12
-
13
- export interface BibleInfo
14
- extends Omit<BibleText, 'language' | 'copyright'>,
15
- Omit<BibleAudio, 'language' | 'copyright'> {
16
- language: Language
17
- availableTextChapters: string[]
18
- availableAudioChapters: string[]
19
- fullCopyright: string
20
- bookNames: Record<string, string>
21
- }
22
-
23
- export interface LanguageInfo
24
- extends Omit<Language, 'bible' | 'bibleFallback'> {
25
- sets: string[]
26
- questionSets: QuestionsCurriculums[number]['questionSets']
27
- bible: BibleInfo
28
- bibleFallback: BibleInfo | undefined
29
- trainingVideoLanguage: string
30
- isRtl: boolean
31
- }
32
-
33
- export interface MeetTranslations {
34
- sets: SetTranslations[string]
35
- questions: QuestionTranslations[string]
36
- introductions: IntroductionTranslations[string]
37
- }
@@ -1,37 +0,0 @@
1
- import { notification } from '../data/typescript/notification'
2
- import { z } from 'zod'
3
-
4
- export const PushNotificationPayloadSchema = z.object({
5
- actionUrl: z.string().url().optional(),
6
- /**
7
- * We want the full title, not the push title, to be attached to the
8
- * notification.
9
- */
10
- title: z.string(),
11
- /**
12
- * We want the full body, not the push body, to be attached to the
13
- * notification.
14
- */
15
- body: z.string(),
16
- titleSource: z.string(),
17
- bodySource: z.string(),
18
- verified: z.boolean(),
19
- imageUrl: z.string().url().optional(),
20
- wahaUserId: z.string(),
21
- date: z.string(),
22
- })
23
-
24
- export type PushNotificationPayload = z.infer<
25
- typeof PushNotificationPayloadSchema
26
- >
27
-
28
- export const PushNotificationRecordSchema = z.object({
29
- date: z.string(),
30
- notification,
31
- receivedTokens: z.array(z.string()),
32
- receivedUserIds: z.array(z.string()),
33
- })
34
-
35
- export type PushNotificationRecord = z.infer<
36
- typeof PushNotificationRecordSchema
37
- >
package/types/sets.ts DELETED
@@ -1,84 +0,0 @@
1
- import { type Languages } from '../data/typescript/languages'
2
- import { type Sets } from '../data/typescript/sets'
3
-
4
- export type Set = Sets[number]
5
- export type Lesson = Sets[number]['lessons'][number]
6
-
7
- export type SetCategory = 'Foundations' | 'Topics' | 'WahaTraining'
8
-
9
- export interface SetInfo extends Set {
10
- // Id info.
11
- meetLanguageId: Languages[number]['languageId']
12
- category: SetCategory
13
- setNumber: string
14
- // Translations.
15
- setTitle?: string
16
- setSubtitle: string
17
- setDescription?: string
18
- setTag?: string
19
- setLink: string
20
- }
21
-
22
- export interface Content {
23
- languageId: string
24
- id: string
25
- localFileName: string
26
- remoteFileName: string
27
- path: string
28
- url: string
29
- }
30
-
31
- interface BaseInfo {
32
- lessonNumber: string
33
- // Translations.
34
- lessonTitle: string | undefined
35
- lessonIntroduction: string | undefined
36
- lessonLink: string
37
- sections: Section[]
38
- }
39
-
40
- export interface Section {
41
- id: string
42
- header: string | null
43
- text: string
44
- isChapter: boolean
45
- hasBeep: boolean
46
- index: number
47
- indexWithinChapter: number
48
- chapter: Chapter | null
49
- }
50
-
51
- export interface DbsInfo extends BaseInfo, SetInfo, Lesson {
52
- type: 'dbs'
53
- full: Content
54
- dbsCast: {
55
- remoteFileName: string
56
- url: string
57
- }
58
- lessonIntroduction: string | undefined
59
- passagesString: string
60
- }
61
-
62
- export interface VideoInfo extends BaseInfo, SetInfo, Lesson {
63
- type: 'video'
64
- video: Content
65
- lessonSectionHeader: string | undefined
66
- lessonSectionBody: string | undefined
67
- youtubeLink: string | undefined
68
- passagesString: string
69
- }
70
-
71
- export interface EqInfo extends BaseInfo, SetInfo, Lesson {
72
- type: 'eq'
73
- // text: string
74
- eq: Content
75
- }
76
-
77
- export type LessonInfo = DbsInfo | VideoInfo | EqInfo
78
-
79
- export enum Chapter {
80
- FELLOWSHIP = 'f',
81
- INTRODUCTION = 'i',
82
- STORY = 's',
83
- APPLICATION = 'a',
84
- }
package/types/users.ts DELETED
@@ -1,162 +0,0 @@
1
- import { z } from 'zod'
2
-
3
- const WahaUserLocationSchema = z.object({
4
- city: z.string().optional(),
5
- country: z.string().optional(),
6
- region: z.string().optional(),
7
- })
8
- export type WahaUserLocation = z.infer<typeof WahaUserLocationSchema>
9
-
10
- export type WahaAppVersion = `${number}.${number}.${number}`
11
-
12
- const DesireIdSchema = z.enum([
13
- 'talk_to_others_about_jesus',
14
- 'build_a_team_of_disciple_makers',
15
- 'reach_my_entire_people_or_nation_for_god',
16
- 'understand_wahas_impact',
17
- 'understand_how_waha_works',
18
- 'get_coaching',
19
- 'see_god_transform_my_community',
20
- 'discover_whats_in_the_bible',
21
- 'find_hope_in_my_troubles',
22
- 'get_right_with_god',
23
- 'learn_more_about_jesus',
24
- ])
25
- export type DesireId = z.infer<typeof DesireIdSchema>
26
-
27
- const WahaUserStateSchema = z.object({
28
- wahaUserId: z.string().optional(),
29
- name: z.string().optional(),
30
- email: z.string().email().optional(),
31
- location: WahaUserLocationSchema.optional(),
32
- pastLocations: z.array(WahaUserLocationSchema).optional(),
33
- phoneLocation: z.string().optional(),
34
- isSubscribedToEmailUpdates: z.boolean().optional(),
35
- pushToken: z.string().optional(),
36
- notificationPermission: z.enum(['granted', 'undetermined', 'denied']),
37
- utm: z.record(z.string(), z.string()).optional(),
38
- firstOpen: z.number().optional(),
39
- finishedOnboarding: z.number().optional(),
40
- howFamiliarWithBible: z.number().optional(),
41
- followingFor2Years: z.number().optional(),
42
- notificationsClicked: z.number().optional(),
43
- notificationLinksClicked: z.number().optional(),
44
- isBeliever: z.boolean().optional(),
45
- isInAGroup: z.boolean().optional(),
46
- desires: z.array(DesireIdSchema).optional(),
47
- customDesire: z.string().optional(),
48
- isCCWorker: z.boolean().optional(),
49
- isAdvocate: z.boolean().optional(),
50
- onboardingStatus: z
51
- .enum([
52
- 'skipped-from-first',
53
- 'skipped-from-second',
54
- 'finished-from-first',
55
- 'finished-from-second',
56
- 'finished-from-languages',
57
- ])
58
- .optional(),
59
- })
60
-
61
- export type WahaUserState = z.infer<typeof WahaUserStateSchema>
62
-
63
- const WahaAppVersionSchema = z.string().regex(/^\d+\.\d+\.\d+$/)
64
-
65
- const CompletionEventSchema = z.object({
66
- lessonId: z.string(),
67
- meetLanguageId: z.string(),
68
- time: z.number(),
69
- country: z.string().optional(),
70
- region: z.string().optional(),
71
- city: z.string().optional(),
72
- /**
73
- * Indicates that the lesson was completed manually from the lesson sheet
74
- * rather than automatically by doing the lesson on the lesson screen.
75
- */
76
- manual: z.boolean().optional(),
77
- })
78
-
79
- export type CompletionEvent = z.infer<typeof CompletionEventSchema>
80
-
81
- const WahaShareContentSchema = z.enum([
82
- 'app',
83
- 'passcode',
84
- 'lessonAudio',
85
- 'lessonText',
86
- 'storyText',
87
- 'storyAudio',
88
- 'lessonLink',
89
- 'setLink',
90
- 'meetingInvite',
91
- 'articleLink',
92
- 'videoLink',
93
- 'notification',
94
- 'meetingSchedule',
95
- 'scriptureText',
96
- 'mt',
97
- 'scriptureAudio',
98
- 'inviteGroup',
99
- 'lesson',
100
- 'offlineVersionLink',
101
- 'note',
102
- 'customSet',
103
- ])
104
- export type WahaShareContent = z.infer<typeof WahaShareContentSchema>
105
-
106
- const ShareLogEventSchema = z.object({
107
- time: z.number(),
108
- content: WahaShareContentSchema,
109
- lessonId: z.string().optional(),
110
- articleSlug: z.string().optional(),
111
- })
112
-
113
- export type ShareLogEvent = z.infer<typeof ShareLogEventSchema>
114
-
115
- const BibleSessionSchema = z.object({
116
- chapter: z.string(),
117
- timeSpent: z.number(),
118
- startTime: z.number(),
119
- translation: z.string(),
120
- })
121
- export type BibleSession = z.infer<typeof BibleSessionSchema>
122
-
123
- const ArticleSessionSchema = z.object({
124
- articleSlug: z.string(),
125
- timeSpent: z.number(),
126
- startTime: z.number(),
127
- })
128
- export type ArticleSession = z.infer<typeof ArticleSessionSchema>
129
-
130
- // Zod schema for WahaUser extending WahaUserStateSchema
131
- export const WahaUserSchema = WahaUserStateSchema.extend({
132
- pushToken: z.string().optional(),
133
- securityModeOn: z.boolean().optional(),
134
- appVersion: WahaAppVersionSchema,
135
- lastUpdate: z.number(),
136
- platform: z.string(),
137
- completions: z.array(CompletionEventSchema),
138
- trainingUnlocked: z.boolean().optional(),
139
- meet: z.string(),
140
- appInterface: z.string(),
141
- meetFavorites: z.array(z.string()),
142
- osVersion: z.string().nullable(),
143
- isDev: z.boolean(),
144
- shareLog: z.array(ShareLogEventSchema).optional(),
145
- bibleSessions: z.array(BibleSessionSchema).optional(),
146
- articleSessions: z.array(ArticleSessionSchema).optional(),
147
- activated: z.boolean().optional(),
148
- })
149
-
150
- export const PushEnabledWahaUserSchema = WahaUserSchema.omit({
151
- wahaUserId: true,
152
- pushToken: true,
153
- notificationPermission: true,
154
- }).extend({
155
- wahaUserId: z.string(),
156
- pushToken: z.string(),
157
- notificationPermission: z.literal('granted'),
158
- })
159
- export type PushEnabledWahaUser = z.infer<typeof PushEnabledWahaUserSchema>
160
-
161
- // Type inferred from the Zod schema
162
- export type WahaUser = z.infer<typeof WahaUserSchema>