waha-shared 1.0.255 → 1.0.257

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,30 +1,6 @@
1
1
  import { BibleChapter, BibleChapters } from '../types/bibleChapters';
2
2
  import type { LanguageInfo } from '../types/languages';
3
3
  import { ScripturePassage } from '../types/scripturePassages';
4
- export interface VerseRangeInfo {
5
- startBook: string;
6
- startChapter: string;
7
- startVerse: string;
8
- endBook: string;
9
- endChapter: string;
10
- endVerse: string;
11
- startChapterId: string;
12
- endChapterId: string;
13
- }
14
- /**
15
- * Parses a verse range string like "GEN.1.1-GEN.1.25" or "JHN.3.16" or "REV.22"
16
- * Returns the start and end verse IDs
17
- */
18
- export declare function parseVerseRange(passageId: string): VerseRangeInfo;
19
- type GetChapterUrlParams = {
20
- bibleAudioId: string;
21
- passageId: string;
22
- } | {
23
- startBook: string;
24
- startChapter: string;
25
- bibleAudioId: string;
26
- };
27
- export declare function getChapterUrl(params: GetChapterUrlParams): string;
28
4
  /**
29
5
  * Condenses a list of USFM passage IDs into a readable string format. Groups
30
6
  * consecutive passages from the same book together.
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parseVerseRange = parseVerseRange;
4
- exports.getChapterUrl = getChapterUrl;
5
3
  exports.getPassagesString = getPassagesString;
6
4
  exports.getScripturePassage = getScripturePassage;
7
5
  exports.getLessonScripture = getLessonScripture;
@@ -10,24 +8,17 @@ exports.verseToSuperscript = verseToSuperscript;
10
8
  const bibleStatuses_1 = require("../data/bibleStatuses");
11
9
  const languages_1 = require("../functions/languages");
12
10
  const bibleChapters_1 = require("../types/bibleChapters");
13
- const sets_1 = require("./sets");
14
11
  /**
15
- * Parses a verse range string like "GEN.1.1-GEN.1.25" or "JHN.3.16" or "REV.22"
16
- * Returns the start and end verse IDs
12
+ * Parses a verse range string like "GEN.1.1-GEN.1.25" or "JHN.3.16" Returns the
13
+ * start and end verse IDs
17
14
  */
18
15
  function parseVerseRange(passageId) {
19
16
  // Handle single verse: "GEN.1.1" -> "GEN.1.1-GEN.1.1"
20
17
  const parts = passageId.includes('-')
21
18
  ? passageId.split('-')
22
19
  : [passageId, passageId];
23
- const startParts = parts[0].split('.');
24
- const endParts = parts[1].split('.');
25
- const startBook = startParts[0];
26
- const startChapter = startParts[1];
27
- const startVerse = startParts.length > 2 ? startParts[2] : '1';
28
- const endBook = endParts[0];
29
- const endChapter = endParts[1];
30
- const endVerse = endParts.length > 2 ? endParts[2] : '1';
20
+ const [startBook, startChapter, startVerse] = parts[0].split('.');
21
+ const [endBook, endChapter, endVerse] = parts[1].split('.');
31
22
  return {
32
23
  startBook,
33
24
  startChapter,
@@ -35,24 +26,8 @@ function parseVerseRange(passageId) {
35
26
  endBook,
36
27
  endChapter,
37
28
  endVerse,
38
- startChapterId: `${startBook}.${startChapter}`,
39
- endChapterId: `${endBook}.${endChapter}`,
40
29
  };
41
30
  }
42
- function getChapterUrl(params) {
43
- const startBook = 'startBook' in params
44
- ? params.startBook
45
- : parseVerseRange(params.passageId).startBook;
46
- const startChapter = 'startChapter' in params
47
- ? params.startChapter
48
- : parseVerseRange(params.passageId).startChapter;
49
- return (sets_1.firebaseUrl +
50
- encodeURIComponent('audio_bibles' +
51
- `/${params.bibleAudioId}` +
52
- `/${startBook}` +
53
- `/${startBook}_${startChapter.padStart(3, '0')}.mp3`) +
54
- `?alt=media`);
55
- }
56
31
  /** Extracts verses from a chapter based on verse numbers */
57
32
  function extractVersesFromChapter(chapter, startVerse, endVerse) {
58
33
  const verses = chapter.verses.filter((verse) => {
@@ -58,16 +58,10 @@ type Misc = {
58
58
  payload: {
59
59
  enabled: boolean;
60
60
  };
61
- } | {
62
- name: 'StartOnboarding';
63
- payload: {
64
- usedOldOnboarding?: boolean;
65
- };
66
61
  } | {
67
62
  name: 'FinishOnboarding';
68
63
  payload: {
69
- skippedFromPage: number | undefined;
70
- usedOldOnboarding?: boolean;
64
+ skipped: boolean;
71
65
  };
72
66
  } | {
73
67
  name: 'ClickNotification';
@@ -134,17 +128,23 @@ type Bible = {
134
128
  name: 'BibleSession';
135
129
  payload: BibleSession;
136
130
  };
137
- type MicroLessons = {
138
- name: 'MicroLessonStart';
131
+ type Worksheets = {
132
+ name: 'WorksheetNotificationResponse';
133
+ payload: {
134
+ worksheetId: string;
135
+ didApply: boolean;
136
+ };
137
+ } | {
138
+ name: 'WorksheetStart';
139
139
  payload: {
140
- microLessonId: string;
140
+ worksheetId: string;
141
141
  };
142
142
  } | {
143
- name: 'MicroLessonComplete';
143
+ name: 'WorksheetComplete';
144
144
  payload: {
145
- microLessonId: string;
145
+ worksheetId: string;
146
146
  timeToCompletion: number;
147
147
  };
148
148
  };
149
- export type AnalyticsEvent = Meeting | Share | Misc | Article | Bible | Note | MicroLessons | Give;
149
+ export type AnalyticsEvent = Meeting | Share | Misc | Article | Bible | Note | Worksheets | Give;
150
150
  export {};
@@ -146,7 +146,3 @@ export declare const ArticlesResponseSchema: z.ZodObject<{
146
146
  body: z.ZodString;
147
147
  }, z.core.$strip>>;
148
148
  }, z.core.$strip>;
149
- export declare const ArticleLanguagesResponseSchema: z.ZodObject<{
150
- data: z.ZodArray<z.ZodString>;
151
- }, z.core.$strip>;
152
- export type ArticleCategory = z.infer<typeof ArticleSchema>['category'];
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ArticleLanguagesResponseSchema = exports.ArticlesResponseSchema = exports.ResponseArticleSchema = exports.ArticleSchema = void 0;
6
+ exports.ArticlesResponseSchema = exports.ResponseArticleSchema = exports.ArticleSchema = void 0;
7
7
  const v4_1 = __importDefault(require("zod/v4"));
8
8
  const webContent_1 = require("./webContent");
9
9
  exports.ArticleSchema = v4_1.default.object({
@@ -50,6 +50,3 @@ exports.ResponseArticleSchema = v4_1.default.object({
50
50
  exports.ArticlesResponseSchema = v4_1.default.object({
51
51
  data: v4_1.default.array(exports.ResponseArticleSchema),
52
52
  });
53
- exports.ArticleLanguagesResponseSchema = v4_1.default.object({
54
- data: v4_1.default.array(v4_1.default.string()),
55
- });
@@ -1,15 +1,4 @@
1
1
  import z from 'zod/v4';
2
- export declare const MicroLessonRadioButtonSchema: z.ZodObject<{
3
- heading: z.ZodOptional<z.ZodString>;
4
- body: z.ZodOptional<z.ZodString>;
5
- }, z.core.$strip>;
6
- export type MicroLessonRadioButton = z.infer<typeof MicroLessonRadioButtonSchema>;
7
- export declare const MicroLessonCtaButtonSchema: z.ZodObject<{
8
- show: z.ZodBoolean;
9
- label: z.ZodString;
10
- href: z.ZodString;
11
- }, z.core.$strip>;
12
- export type MicroLessonCtaButton = z.infer<typeof MicroLessonCtaButtonSchema>;
13
2
  export declare const MicroLessonSchema: z.ZodObject<{
14
3
  title: z.ZodString;
15
4
  subtitle: z.ZodOptional<z.ZodString>;
@@ -215,7 +204,3 @@ export declare const MicroLessonSubmissionSchema: z.ZodObject<{
215
204
  }>;
216
205
  }, z.core.$strip>;
217
206
  export type MicroLessonSubmission = z.infer<typeof MicroLessonSubmissionSchema>;
218
- export declare const MicroLessonLanguagesResponseSchema: z.ZodObject<{
219
- data: z.ZodArray<z.ZodString>;
220
- }, z.core.$strip>;
221
- export type MicroLessonCategory = z.infer<typeof MicroLessonSchema>['category'];
@@ -3,23 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.MicroLessonLanguagesResponseSchema = exports.MicroLessonSubmissionSchema = exports.MicroLessonsResponse = exports.ResponseMicroLessonSchema = exports.MicroLessonSchema = exports.MicroLessonCtaButtonSchema = exports.MicroLessonRadioButtonSchema = void 0;
6
+ exports.MicroLessonSubmissionSchema = exports.MicroLessonsResponse = exports.ResponseMicroLessonSchema = exports.MicroLessonSchema = void 0;
7
7
  const v4_1 = __importDefault(require("zod/v4"));
8
8
  const users_1 = require("./users");
9
9
  const webContent_1 = require("./webContent");
10
- exports.MicroLessonRadioButtonSchema = v4_1.default
11
- .object({
12
- heading: v4_1.default.string().optional(),
13
- body: v4_1.default.string().optional(),
14
- })
15
- .describe('A single radio button option for a micro lesson page. Heading will show in bold and body will show in regular, gray text.');
16
- exports.MicroLessonCtaButtonSchema = v4_1.default
17
- .object({
18
- show: v4_1.default.boolean(),
19
- label: v4_1.default.string(),
20
- href: v4_1.default.string(),
21
- })
22
- .describe('A call-to-action button that will appear at the bottom of a micro lesson page.');
23
10
  exports.MicroLessonSchema = v4_1.default.object({
24
11
  title: v4_1.default.string(),
25
12
  subtitle: v4_1.default.string().optional(),
@@ -27,57 +14,40 @@ exports.MicroLessonSchema = v4_1.default.object({
27
14
  isDraft: webContent_1.IsDraftSchema,
28
15
  seekerFriendly: webContent_1.SeekerFriendlySchema,
29
16
  platform: webContent_1.PlatformSchema,
30
- image: v4_1.default
31
- .string()
32
- .optional()
33
- .describe("Cover image for the micro lesson. Will display on the micro lesson's card."),
17
+ image: v4_1.default.string().optional(),
34
18
  category: v4_1.default.enum(['Case Studies', 'How Tos']),
35
19
  campaign: v4_1.default
36
20
  .string()
37
21
  .optional()
38
22
  .describe('Optional campaign identifier for tracking purposes.'),
39
- pages: v4_1.default
40
- .array(v4_1.default
41
- .object({
42
- heading: v4_1.default
43
- .string()
44
- .describe('The heading of the page. Will appear in large, bold text.'),
45
- body: v4_1.default
46
- .string()
47
- .optional()
48
- .describe('The body text of the page. Will appear below the heading in regular, gray text.'),
49
- icon: v4_1.default
50
- .string()
51
- .optional()
52
- .describe('An svg icon to display on the page. This will appear fairly small, left-aligned above the heading.'),
53
- image: v4_1.default
54
- .string()
55
- .optional()
56
- .describe('The image to display on the page. This will appear full width and below the heading.'),
23
+ pages: v4_1.default.array(v4_1.default.object({
24
+ heading: v4_1.default.string().describe('The heading of the page'),
25
+ body: v4_1.default.string().optional(),
26
+ icon: v4_1.default.string().optional(),
27
+ image: v4_1.default.string().optional(),
57
28
  audio: webContent_1.AudioSchema,
58
29
  video: webContent_1.VideoSchema,
59
30
  textInput: v4_1.default
60
31
  .object({
61
- show: v4_1.default
62
- .boolean()
63
- .describe('Whether or not the page should show a text input field or not.'),
64
- placeholder: v4_1.default
65
- .string()
66
- .optional()
67
- .describe('The placeholder text that will appear in the text input field before the user starts typing.'),
68
- showCopyButton: v4_1.default
69
- .boolean()
70
- .optional()
71
- .describe('Whether or not there should be a copy/share button below the text input field. Button will say "Share" on the mobile app version of the micro lesson and will open the share sheet. Button will say "Copy to Clipboard" on the web version and will copy the text to the user\'s clipboard.'),
72
- prefilledText: v4_1.default
73
- .string()
74
- .optional()
75
- .describe('The prefilled text that will auto-populate the text input field of the page. Useful if you want to prefill a share message that the user can edit and send.'),
32
+ show: v4_1.default.boolean(),
33
+ placeholder: v4_1.default.string().optional(),
34
+ showCopyButton: v4_1.default.boolean().optional(),
35
+ prefilledText: v4_1.default.string().optional(),
76
36
  })
77
- .describe('Options for the text input field of the page.')
78
37
  .optional(),
79
- ctaButton: exports.MicroLessonCtaButtonSchema.optional(),
80
- radioButtons: v4_1.default.array(exports.MicroLessonRadioButtonSchema).optional(),
38
+ ctaButton: v4_1.default
39
+ .object({
40
+ show: v4_1.default.boolean(),
41
+ label: v4_1.default.string(),
42
+ href: v4_1.default.string(),
43
+ })
44
+ .optional(),
45
+ radioButtons: v4_1.default
46
+ .array(v4_1.default.object({
47
+ heading: v4_1.default.string().optional(),
48
+ body: v4_1.default.string().optional(),
49
+ }))
50
+ .optional(),
81
51
  platform: webContent_1.PlatformSchema.optional(),
82
52
  notification: v4_1.default
83
53
  .object({
@@ -89,9 +59,7 @@ exports.MicroLessonSchema = v4_1.default.object({
89
59
  })
90
60
  .optional()
91
61
  .describe('Optional notification to send after the lesson is completed.'),
92
- })
93
- .describe('A single page of the micro lesson.'))
94
- .describe('The pages that make up the micro lesson. The last page is the completion page and will always have a button redirecting the user back.'),
62
+ })),
95
63
  });
96
64
  exports.ResponseMicroLessonSchema = v4_1.default.object({
97
65
  id: v4_1.default.string(),
@@ -110,6 +78,3 @@ exports.MicroLessonSubmissionSchema = users_1.WahaUserLocationSchema.extend({
110
78
  timeSubmitted: v4_1.default.number(),
111
79
  platform: v4_1.default.enum(['ios', 'android', 'web']),
112
80
  });
113
- exports.MicroLessonLanguagesResponseSchema = v4_1.default.object({
114
- data: v4_1.default.array(v4_1.default.string()),
115
- });
@@ -94,12 +94,32 @@ export declare const CompletionEventSchema: z.ZodObject<{
94
94
  manual: z.ZodOptional<z.ZodBoolean>;
95
95
  }, z.core.$strip>;
96
96
  export type CompletionEvent = z.infer<typeof CompletionEventSchema>;
97
+ declare const WorksheetAnswerSchema: z.ZodObject<{
98
+ question: z.ZodString;
99
+ answer: z.ZodString;
100
+ }, z.core.$strip>;
101
+ export type WorksheetAnswer = z.infer<typeof WorksheetAnswerSchema>;
102
+ declare const WorksheetCompletionEventSchema: z.ZodObject<{
103
+ startTime: z.ZodNumber;
104
+ completionTime: z.ZodOptional<z.ZodNumber>;
105
+ worksheetId: z.ZodString;
106
+ answers: z.ZodArray<z.ZodObject<{
107
+ question: z.ZodString;
108
+ answer: z.ZodString;
109
+ }, z.core.$strip>>;
110
+ country: z.ZodOptional<z.ZodString>;
111
+ region: z.ZodOptional<z.ZodString>;
112
+ city: z.ZodOptional<z.ZodString>;
113
+ didApply: z.ZodOptional<z.ZodBoolean>;
114
+ notificationText: z.ZodOptional<z.ZodString>;
115
+ feedback: z.ZodOptional<z.ZodString>;
116
+ }, z.core.$strip>;
117
+ export type WorksheetCompletionEvent = z.infer<typeof WorksheetCompletionEventSchema>;
97
118
  export declare const WahaShareContentSchema: z.ZodEnum<{
98
119
  lesson: "lesson";
99
120
  note: "note";
100
121
  setLink: "setLink";
101
122
  lessonLink: "lessonLink";
102
- notification: "notification";
103
123
  app: "app";
104
124
  passcode: "passcode";
105
125
  lessonAudio: "lessonAudio";
@@ -109,6 +129,7 @@ export declare const WahaShareContentSchema: z.ZodEnum<{
109
129
  meetingInvite: "meetingInvite";
110
130
  articleLink: "articleLink";
111
131
  videoLink: "videoLink";
132
+ notification: "notification";
112
133
  meetingSchedule: "meetingSchedule";
113
134
  scriptureText: "scriptureText";
114
135
  mt: "mt";
@@ -126,7 +147,6 @@ export declare const ShareLogEventSchema: z.ZodObject<{
126
147
  note: "note";
127
148
  setLink: "setLink";
128
149
  lessonLink: "lessonLink";
129
- notification: "notification";
130
150
  app: "app";
131
151
  passcode: "passcode";
132
152
  lessonAudio: "lessonAudio";
@@ -136,6 +156,7 @@ export declare const ShareLogEventSchema: z.ZodObject<{
136
156
  meetingInvite: "meetingInvite";
137
157
  articleLink: "articleLink";
138
158
  videoLink: "videoLink";
159
+ notification: "notification";
139
160
  meetingSchedule: "meetingSchedule";
140
161
  scriptureText: "scriptureText";
141
162
  mt: "mt";
@@ -147,7 +168,6 @@ export declare const ShareLogEventSchema: z.ZodObject<{
147
168
  }>;
148
169
  lessonId: z.ZodOptional<z.ZodString>;
149
170
  articleSlug: z.ZodOptional<z.ZodString>;
150
- microLessonSlug: z.ZodOptional<z.ZodString>;
151
171
  }, z.core.$strip>;
152
172
  export type ShareLogEvent = z.infer<typeof ShareLogEventSchema>;
153
173
  export declare const BibleSessionSchema: z.ZodObject<{
@@ -249,7 +269,6 @@ export declare const WahaUserSchema: z.ZodObject<{
249
269
  note: "note";
250
270
  setLink: "setLink";
251
271
  lessonLink: "lessonLink";
252
- notification: "notification";
253
272
  app: "app";
254
273
  passcode: "passcode";
255
274
  lessonAudio: "lessonAudio";
@@ -259,6 +278,7 @@ export declare const WahaUserSchema: z.ZodObject<{
259
278
  meetingInvite: "meetingInvite";
260
279
  articleLink: "articleLink";
261
280
  videoLink: "videoLink";
281
+ notification: "notification";
262
282
  meetingSchedule: "meetingSchedule";
263
283
  scriptureText: "scriptureText";
264
284
  mt: "mt";
@@ -270,7 +290,6 @@ export declare const WahaUserSchema: z.ZodObject<{
270
290
  }>;
271
291
  lessonId: z.ZodOptional<z.ZodString>;
272
292
  articleSlug: z.ZodOptional<z.ZodString>;
273
- microLessonSlug: z.ZodOptional<z.ZodString>;
274
293
  }, z.core.$strip>>>;
275
294
  bibleSessions: z.ZodOptional<z.ZodArray<z.ZodObject<{
276
295
  chapter: z.ZodString;
@@ -284,22 +303,16 @@ export declare const WahaUserSchema: z.ZodObject<{
284
303
  startTime: z.ZodNumber;
285
304
  }, z.core.$strip>>>;
286
305
  activated: z.ZodOptional<z.ZodBoolean>;
287
- microLessonCompletions: z.ZodOptional<z.ZodArray<z.ZodObject<{
306
+ worksheetCompletions: z.ZodOptional<z.ZodArray<z.ZodObject<{
288
307
  city: z.ZodOptional<z.ZodString>;
289
308
  country: z.ZodOptional<z.ZodString>;
290
309
  region: z.ZodOptional<z.ZodString>;
291
- microLessonId: z.ZodString;
292
- userId: z.ZodString;
293
- microLessonTitle: z.ZodString;
294
- languageId: z.ZodString;
295
- campaign: z.ZodOptional<z.ZodString>;
296
- timeStarted: z.ZodNumber;
297
- timeSubmitted: z.ZodNumber;
298
- platform: z.ZodEnum<{
299
- web: "web";
300
- ios: "ios";
301
- android: "android";
302
- }>;
310
+ startTime: z.ZodNumber;
311
+ completionTime: z.ZodOptional<z.ZodNumber>;
312
+ worksheetId: z.ZodString;
313
+ didApply: z.ZodOptional<z.ZodBoolean>;
314
+ notificationText: z.ZodOptional<z.ZodString>;
315
+ feedback: z.ZodOptional<z.ZodString>;
303
316
  }, z.core.$strip>>>;
304
317
  }, z.core.$strip>;
305
318
  export declare const PushEnabledWahaUserSchema: z.ZodObject<{
@@ -307,7 +320,6 @@ export declare const PushEnabledWahaUserSchema: z.ZodObject<{
307
320
  appInterface: z.ZodString;
308
321
  email: z.ZodOptional<z.ZodEmail>;
309
322
  meet: z.ZodString;
310
- platform: z.ZodString;
311
323
  location: z.ZodOptional<z.ZodObject<{
312
324
  city: z.ZodOptional<z.ZodString>;
313
325
  country: z.ZodOptional<z.ZodString>;
@@ -361,6 +373,7 @@ export declare const PushEnabledWahaUserSchema: z.ZodObject<{
361
373
  securityModeOn: z.ZodOptional<z.ZodBoolean>;
362
374
  appVersion: z.ZodString;
363
375
  lastUpdate: z.ZodNumber;
376
+ platform: z.ZodString;
364
377
  completions: z.ZodArray<z.ZodObject<{
365
378
  lessonId: z.ZodString;
366
379
  meetLanguageId: z.ZodString;
@@ -381,7 +394,6 @@ export declare const PushEnabledWahaUserSchema: z.ZodObject<{
381
394
  note: "note";
382
395
  setLink: "setLink";
383
396
  lessonLink: "lessonLink";
384
- notification: "notification";
385
397
  app: "app";
386
398
  passcode: "passcode";
387
399
  lessonAudio: "lessonAudio";
@@ -391,6 +403,7 @@ export declare const PushEnabledWahaUserSchema: z.ZodObject<{
391
403
  meetingInvite: "meetingInvite";
392
404
  articleLink: "articleLink";
393
405
  videoLink: "videoLink";
406
+ notification: "notification";
394
407
  meetingSchedule: "meetingSchedule";
395
408
  scriptureText: "scriptureText";
396
409
  mt: "mt";
@@ -402,7 +415,6 @@ export declare const PushEnabledWahaUserSchema: z.ZodObject<{
402
415
  }>;
403
416
  lessonId: z.ZodOptional<z.ZodString>;
404
417
  articleSlug: z.ZodOptional<z.ZodString>;
405
- microLessonSlug: z.ZodOptional<z.ZodString>;
406
418
  }, z.core.$strip>>>;
407
419
  bibleSessions: z.ZodOptional<z.ZodArray<z.ZodObject<{
408
420
  chapter: z.ZodString;
@@ -416,22 +428,16 @@ export declare const PushEnabledWahaUserSchema: z.ZodObject<{
416
428
  startTime: z.ZodNumber;
417
429
  }, z.core.$strip>>>;
418
430
  activated: z.ZodOptional<z.ZodBoolean>;
419
- microLessonCompletions: z.ZodOptional<z.ZodArray<z.ZodObject<{
431
+ worksheetCompletions: z.ZodOptional<z.ZodArray<z.ZodObject<{
420
432
  city: z.ZodOptional<z.ZodString>;
421
433
  country: z.ZodOptional<z.ZodString>;
422
434
  region: z.ZodOptional<z.ZodString>;
423
- microLessonId: z.ZodString;
424
- userId: z.ZodString;
425
- microLessonTitle: z.ZodString;
426
- languageId: z.ZodString;
427
- campaign: z.ZodOptional<z.ZodString>;
428
- timeStarted: z.ZodNumber;
429
- timeSubmitted: z.ZodNumber;
430
- platform: z.ZodEnum<{
431
- web: "web";
432
- ios: "ios";
433
- android: "android";
434
- }>;
435
+ startTime: z.ZodNumber;
436
+ completionTime: z.ZodOptional<z.ZodNumber>;
437
+ worksheetId: z.ZodString;
438
+ didApply: z.ZodOptional<z.ZodBoolean>;
439
+ notificationText: z.ZodOptional<z.ZodString>;
440
+ feedback: z.ZodOptional<z.ZodString>;
435
441
  }, z.core.$strip>>>;
436
442
  wahaUserId: z.ZodString;
437
443
  pushToken: z.ZodString;
@@ -439,3 +445,4 @@ export declare const PushEnabledWahaUserSchema: z.ZodObject<{
439
445
  }, z.core.$strip>;
440
446
  export type PushEnabledWahaUser = z.infer<typeof PushEnabledWahaUserSchema>;
441
447
  export type WahaUser = z.infer<typeof WahaUserSchema>;
448
+ export {};
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PushEnabledWahaUserSchema = exports.WahaUserSchema = exports.ArticleSessionSchema = exports.BibleSessionSchema = exports.ShareLogEventSchema = exports.WahaShareContentSchema = exports.CompletionEventSchema = exports.WahaAppVersionSchema = exports.WahaUserStateSchema = exports.DesireIdSchema = exports.WahaUserLocationSchema = void 0;
4
4
  const zod_1 = require("zod");
5
- const microLessons_1 = require("./microLessons");
6
5
  exports.WahaUserLocationSchema = zod_1.z.object({
7
6
  city: zod_1.z.string().optional(),
8
7
  country: zod_1.z.string().optional(),
@@ -74,6 +73,22 @@ exports.CompletionEventSchema = zod_1.z.object({
74
73
  */
75
74
  manual: zod_1.z.boolean().optional(),
76
75
  });
76
+ const WorksheetAnswerSchema = zod_1.z.object({
77
+ question: zod_1.z.string(),
78
+ answer: zod_1.z.string(),
79
+ });
80
+ const WorksheetCompletionEventSchema = zod_1.z.object({
81
+ startTime: zod_1.z.number(),
82
+ completionTime: zod_1.z.number().optional(),
83
+ worksheetId: zod_1.z.string(),
84
+ answers: zod_1.z.array(WorksheetAnswerSchema),
85
+ country: zod_1.z.string().optional(),
86
+ region: zod_1.z.string().optional(),
87
+ city: zod_1.z.string().optional(),
88
+ didApply: zod_1.z.boolean().optional(),
89
+ notificationText: zod_1.z.string().optional(),
90
+ feedback: zod_1.z.string().optional(),
91
+ });
77
92
  exports.WahaShareContentSchema = zod_1.z.enum([
78
93
  'app',
79
94
  'passcode',
@@ -103,7 +118,6 @@ exports.ShareLogEventSchema = zod_1.z.object({
103
118
  content: exports.WahaShareContentSchema,
104
119
  lessonId: zod_1.z.string().optional(),
105
120
  articleSlug: zod_1.z.string().optional(),
106
- microLessonSlug: zod_1.z.string().optional(),
107
121
  });
108
122
  exports.BibleSessionSchema = zod_1.z.object({
109
123
  chapter: zod_1.z.string(),
@@ -134,7 +148,9 @@ exports.WahaUserSchema = exports.WahaUserStateSchema.extend({
134
148
  bibleSessions: zod_1.z.array(exports.BibleSessionSchema).optional(),
135
149
  articleSessions: zod_1.z.array(exports.ArticleSessionSchema).optional(),
136
150
  activated: zod_1.z.boolean().optional(),
137
- microLessonCompletions: zod_1.z.array(microLessons_1.MicroLessonSubmissionSchema).optional(),
151
+ worksheetCompletions: zod_1.z
152
+ .array(WorksheetCompletionEventSchema.omit({ answers: true }))
153
+ .optional(),
138
154
  });
139
155
  exports.PushEnabledWahaUserSchema = exports.WahaUserSchema.omit({
140
156
  wahaUserId: true,
@@ -24,7 +24,6 @@ exports.AudioSchema = zod_1.default
24
24
  audioUrl: zod_1.default.string(),
25
25
  loop: zod_1.default.boolean().optional(),
26
26
  })
27
- .describe('Optional audio to embed on the page.')
28
27
  .optional();
29
28
  exports.VideoSchema = zod_1.default
30
29
  .object({
@@ -33,5 +32,4 @@ exports.VideoSchema = zod_1.default
33
32
  loop: zod_1.default.boolean().optional(),
34
33
  disableControls: zod_1.default.boolean().optional(),
35
34
  })
36
- .describe('Optional video to embed on the page.')
37
35
  .optional();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waha-shared",
3
- "version": "1.0.255",
3
+ "version": "1.0.257",
4
4
  "author": "Waha",
5
5
  "dependencies": {
6
6
  "@types/signale": "^1.4.7",