czapp-shared 1.0.32 → 1.0.34

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/dist/index.d.mts CHANGED
@@ -80,6 +80,19 @@ declare enum LearningStage {
80
80
  RETIRED = "RETIRED",
81
81
  QUEUED = "QUEUED"
82
82
  }
83
+ /**
84
+ * User-facing grouping of LearningStage, used by the dictionary tabs.
85
+ * NEW is an internal transition stage the user never selects, so it is
86
+ * presented together with LEARNING - the same pairing the stored procedures
87
+ * already use for the active learning set (learningStage IN ('NEW','LEARNING')).
88
+ */
89
+ declare enum LearningStageGroup {
90
+ QUEUED = "QUEUED",
91
+ LEARNING = "LEARNING",
92
+ RETIRED = "RETIRED"
93
+ }
94
+ declare const LEARNING_STAGES_IN_GROUP: Record<LearningStageGroup, LearningStage[]>;
95
+ declare const isLearningStageGroup: (value: unknown) => value is LearningStageGroup;
83
96
  declare enum Progress {
84
97
  WORSE = "WORSE",
85
98
  NONE = "NONE",
@@ -263,12 +276,15 @@ declare enum ApiPath {
263
276
  LEXEMES_ALL = "/lexemes/all",
264
277
  LEXEMES_COUNT = "/lexemes/count/:language",
265
278
  LEXEMES_DELETE_ALL = "/lexemes/deleteAll",
279
+ LEXEMES_LEARNING_INFO = "/lexemes/learningInfo",
266
280
  LEXEMES_PAGE = "/lexemes/:length/:page",
281
+ LEXEMES_PAGE_BY_STAGE = "/lexemes/stage/:stageGroup/:length/:page",
267
282
  LEXEME_PAIR = "/lexemePair/:czId/:enId",
268
283
  LEXEME_PAIRS_BY_TEXT = "/lexemePairsByText/:inputText/:inputLang",
269
284
  LEXEME_PAIR_FAMILIARITY = "/lexemePair/:czId/:enId/:familiarity",
270
285
  LEXEME_PAIR_COUNT = "/lexemePairCount",
271
286
  LEXEME_PAIR_RECYCLE = "/lexemePair/recycle/:czId/:enId",
287
+ PUSH_TOKEN = "/user/pushToken",
272
288
  SIGN_IN = "/signIn",
273
289
  SIGN_OUT = "/signOut",
274
290
  TEST_COMPLETE = "/test/complete",
@@ -326,6 +342,11 @@ interface SignInRequestBody {
326
342
  interface UpdateOnboardingStatusRequestBody {
327
343
  completedOnboarding: boolean;
328
344
  }
345
+ interface RegisterPushTokenRequestBody {
346
+ expoPushToken: string;
347
+ platform: ClientPlatform;
348
+ timezone: string;
349
+ }
329
350
  /**
330
351
  * Request Params
331
352
  */
@@ -347,6 +368,7 @@ interface SelectLexemePairsByTextParams {
347
368
  interface SelectLexemesParams {
348
369
  page: number;
349
370
  length: number;
371
+ stageGroup?: LearningStageGroup;
350
372
  }
351
373
  interface SelectTestLexemesParams {
352
374
  testType: VocabCheckType;
@@ -425,4 +447,4 @@ type DeeplTranslation = {
425
447
  }>;
426
448
  };
427
449
 
428
- export { ApiMethod, ApiPath, AppError, type AutologinRequestBody, ClientPlatform, type ControllerResponse, type DateString, type DeeplTranslation, type DeleteLexemePairRequestParams, Familiarity, type HeatMapParams, type HeatMapResponseData, HttpStatusCode, type IActivityCount, type ICount, type ILexeme, type ILexemeIdPair, type ILexemeLearningInfo, type ILexemePair, type ILexemePairTexts, type ISession, type ITestResult, type IUserData, type IVocabCheckActivity, type InsertOrUpdateRequestBody, type InsertOrUpdateResponseData, Language, LearningStage, Lexeme, LexemePair, type LexemePairRequestBody, type LexemePairWithLang, type MySQLDate, Progress, type RecycleLexemePairParams, ReminderFrequency, type ResetTestUserParams, type Result, Scenario, type SelectAllTranslationsParams, type SelectLexemeCountParams, type SelectLexemePairParams, type SelectLexemePairsByTextParams, type SelectLexemesParams, type SelectTestLexemesParams, type SelectVocabCheckActivityParams, type SignInRequestBody, type SignInResponseData, type Streaks, type TestCompleteRequestBody, type TestCompleteResponseData, type TestInitRequestBody, type TestInitResponseData, type TranslationRequestBody, type TranslationResponseData, type UpdateLexemePairFamiliarityParams, type UpdateOnboardingStatusRequestBody, type UpdateUserRequestBody, VocabCheckType, convertJSDateStringToMySQLDate, dateDifferenceInDays, deriveStreakFromVocabCheckActivity, getFormattedDate, getMysqlDateIgnoreTZ, isClientDateTooFarFromServerDate, isExpired, isStringContainingInteger, isThePreviousDay, isTheSameDay, isValidJsDateString, isValidMysqlDateString, parameterReplace };
450
+ export { ApiMethod, ApiPath, AppError, type AutologinRequestBody, ClientPlatform, type ControllerResponse, type DateString, type DeeplTranslation, type DeleteLexemePairRequestParams, Familiarity, type HeatMapParams, type HeatMapResponseData, HttpStatusCode, type IActivityCount, type ICount, type ILexeme, type ILexemeIdPair, type ILexemeLearningInfo, type ILexemePair, type ILexemePairTexts, type ISession, type ITestResult, type IUserData, type IVocabCheckActivity, type InsertOrUpdateRequestBody, type InsertOrUpdateResponseData, LEARNING_STAGES_IN_GROUP, Language, LearningStage, LearningStageGroup, Lexeme, LexemePair, type LexemePairRequestBody, type LexemePairWithLang, type MySQLDate, Progress, type RecycleLexemePairParams, type RegisterPushTokenRequestBody, ReminderFrequency, type ResetTestUserParams, type Result, Scenario, type SelectAllTranslationsParams, type SelectLexemeCountParams, type SelectLexemePairParams, type SelectLexemePairsByTextParams, type SelectLexemesParams, type SelectTestLexemesParams, type SelectVocabCheckActivityParams, type SignInRequestBody, type SignInResponseData, type Streaks, type TestCompleteRequestBody, type TestCompleteResponseData, type TestInitRequestBody, type TestInitResponseData, type TranslationRequestBody, type TranslationResponseData, type UpdateLexemePairFamiliarityParams, type UpdateOnboardingStatusRequestBody, type UpdateUserRequestBody, VocabCheckType, convertJSDateStringToMySQLDate, dateDifferenceInDays, deriveStreakFromVocabCheckActivity, getFormattedDate, getMysqlDateIgnoreTZ, isClientDateTooFarFromServerDate, isExpired, isLearningStageGroup, isStringContainingInteger, isThePreviousDay, isTheSameDay, isValidJsDateString, isValidMysqlDateString, parameterReplace };
package/dist/index.d.ts CHANGED
@@ -80,6 +80,19 @@ declare enum LearningStage {
80
80
  RETIRED = "RETIRED",
81
81
  QUEUED = "QUEUED"
82
82
  }
83
+ /**
84
+ * User-facing grouping of LearningStage, used by the dictionary tabs.
85
+ * NEW is an internal transition stage the user never selects, so it is
86
+ * presented together with LEARNING - the same pairing the stored procedures
87
+ * already use for the active learning set (learningStage IN ('NEW','LEARNING')).
88
+ */
89
+ declare enum LearningStageGroup {
90
+ QUEUED = "QUEUED",
91
+ LEARNING = "LEARNING",
92
+ RETIRED = "RETIRED"
93
+ }
94
+ declare const LEARNING_STAGES_IN_GROUP: Record<LearningStageGroup, LearningStage[]>;
95
+ declare const isLearningStageGroup: (value: unknown) => value is LearningStageGroup;
83
96
  declare enum Progress {
84
97
  WORSE = "WORSE",
85
98
  NONE = "NONE",
@@ -263,12 +276,15 @@ declare enum ApiPath {
263
276
  LEXEMES_ALL = "/lexemes/all",
264
277
  LEXEMES_COUNT = "/lexemes/count/:language",
265
278
  LEXEMES_DELETE_ALL = "/lexemes/deleteAll",
279
+ LEXEMES_LEARNING_INFO = "/lexemes/learningInfo",
266
280
  LEXEMES_PAGE = "/lexemes/:length/:page",
281
+ LEXEMES_PAGE_BY_STAGE = "/lexemes/stage/:stageGroup/:length/:page",
267
282
  LEXEME_PAIR = "/lexemePair/:czId/:enId",
268
283
  LEXEME_PAIRS_BY_TEXT = "/lexemePairsByText/:inputText/:inputLang",
269
284
  LEXEME_PAIR_FAMILIARITY = "/lexemePair/:czId/:enId/:familiarity",
270
285
  LEXEME_PAIR_COUNT = "/lexemePairCount",
271
286
  LEXEME_PAIR_RECYCLE = "/lexemePair/recycle/:czId/:enId",
287
+ PUSH_TOKEN = "/user/pushToken",
272
288
  SIGN_IN = "/signIn",
273
289
  SIGN_OUT = "/signOut",
274
290
  TEST_COMPLETE = "/test/complete",
@@ -326,6 +342,11 @@ interface SignInRequestBody {
326
342
  interface UpdateOnboardingStatusRequestBody {
327
343
  completedOnboarding: boolean;
328
344
  }
345
+ interface RegisterPushTokenRequestBody {
346
+ expoPushToken: string;
347
+ platform: ClientPlatform;
348
+ timezone: string;
349
+ }
329
350
  /**
330
351
  * Request Params
331
352
  */
@@ -347,6 +368,7 @@ interface SelectLexemePairsByTextParams {
347
368
  interface SelectLexemesParams {
348
369
  page: number;
349
370
  length: number;
371
+ stageGroup?: LearningStageGroup;
350
372
  }
351
373
  interface SelectTestLexemesParams {
352
374
  testType: VocabCheckType;
@@ -425,4 +447,4 @@ type DeeplTranslation = {
425
447
  }>;
426
448
  };
427
449
 
428
- export { ApiMethod, ApiPath, AppError, type AutologinRequestBody, ClientPlatform, type ControllerResponse, type DateString, type DeeplTranslation, type DeleteLexemePairRequestParams, Familiarity, type HeatMapParams, type HeatMapResponseData, HttpStatusCode, type IActivityCount, type ICount, type ILexeme, type ILexemeIdPair, type ILexemeLearningInfo, type ILexemePair, type ILexemePairTexts, type ISession, type ITestResult, type IUserData, type IVocabCheckActivity, type InsertOrUpdateRequestBody, type InsertOrUpdateResponseData, Language, LearningStage, Lexeme, LexemePair, type LexemePairRequestBody, type LexemePairWithLang, type MySQLDate, Progress, type RecycleLexemePairParams, ReminderFrequency, type ResetTestUserParams, type Result, Scenario, type SelectAllTranslationsParams, type SelectLexemeCountParams, type SelectLexemePairParams, type SelectLexemePairsByTextParams, type SelectLexemesParams, type SelectTestLexemesParams, type SelectVocabCheckActivityParams, type SignInRequestBody, type SignInResponseData, type Streaks, type TestCompleteRequestBody, type TestCompleteResponseData, type TestInitRequestBody, type TestInitResponseData, type TranslationRequestBody, type TranslationResponseData, type UpdateLexemePairFamiliarityParams, type UpdateOnboardingStatusRequestBody, type UpdateUserRequestBody, VocabCheckType, convertJSDateStringToMySQLDate, dateDifferenceInDays, deriveStreakFromVocabCheckActivity, getFormattedDate, getMysqlDateIgnoreTZ, isClientDateTooFarFromServerDate, isExpired, isStringContainingInteger, isThePreviousDay, isTheSameDay, isValidJsDateString, isValidMysqlDateString, parameterReplace };
450
+ export { ApiMethod, ApiPath, AppError, type AutologinRequestBody, ClientPlatform, type ControllerResponse, type DateString, type DeeplTranslation, type DeleteLexemePairRequestParams, Familiarity, type HeatMapParams, type HeatMapResponseData, HttpStatusCode, type IActivityCount, type ICount, type ILexeme, type ILexemeIdPair, type ILexemeLearningInfo, type ILexemePair, type ILexemePairTexts, type ISession, type ITestResult, type IUserData, type IVocabCheckActivity, type InsertOrUpdateRequestBody, type InsertOrUpdateResponseData, LEARNING_STAGES_IN_GROUP, Language, LearningStage, LearningStageGroup, Lexeme, LexemePair, type LexemePairRequestBody, type LexemePairWithLang, type MySQLDate, Progress, type RecycleLexemePairParams, type RegisterPushTokenRequestBody, ReminderFrequency, type ResetTestUserParams, type Result, Scenario, type SelectAllTranslationsParams, type SelectLexemeCountParams, type SelectLexemePairParams, type SelectLexemePairsByTextParams, type SelectLexemesParams, type SelectTestLexemesParams, type SelectVocabCheckActivityParams, type SignInRequestBody, type SignInResponseData, type Streaks, type TestCompleteRequestBody, type TestCompleteResponseData, type TestInitRequestBody, type TestInitResponseData, type TranslationRequestBody, type TranslationResponseData, type UpdateLexemePairFamiliarityParams, type UpdateOnboardingStatusRequestBody, type UpdateUserRequestBody, VocabCheckType, convertJSDateStringToMySQLDate, dateDifferenceInDays, deriveStreakFromVocabCheckActivity, getFormattedDate, getMysqlDateIgnoreTZ, isClientDateTooFarFromServerDate, isExpired, isLearningStageGroup, isStringContainingInteger, isThePreviousDay, isTheSameDay, isValidJsDateString, isValidMysqlDateString, parameterReplace };
package/dist/index.js CHANGED
@@ -25,8 +25,10 @@ __export(index_exports, {
25
25
  ClientPlatform: () => ClientPlatform,
26
26
  Familiarity: () => Familiarity,
27
27
  HttpStatusCode: () => HttpStatusCode,
28
+ LEARNING_STAGES_IN_GROUP: () => LEARNING_STAGES_IN_GROUP,
28
29
  Language: () => Language,
29
30
  LearningStage: () => LearningStage,
31
+ LearningStageGroup: () => LearningStageGroup,
30
32
  Lexeme: () => Lexeme,
31
33
  LexemePair: () => LexemePair,
32
34
  Progress: () => Progress,
@@ -40,6 +42,7 @@ __export(index_exports, {
40
42
  getMysqlDateIgnoreTZ: () => getMysqlDateIgnoreTZ,
41
43
  isClientDateTooFarFromServerDate: () => isClientDateTooFarFromServerDate,
42
44
  isExpired: () => isExpired,
45
+ isLearningStageGroup: () => isLearningStageGroup,
43
46
  isStringContainingInteger: () => isStringContainingInteger,
44
47
  isThePreviousDay: () => isThePreviousDay,
45
48
  isTheSameDay: () => isTheSameDay,
@@ -137,6 +140,18 @@ var LearningStage = /* @__PURE__ */ ((LearningStage2) => {
137
140
  LearningStage2["QUEUED"] = "QUEUED";
138
141
  return LearningStage2;
139
142
  })(LearningStage || {});
143
+ var LearningStageGroup = /* @__PURE__ */ ((LearningStageGroup2) => {
144
+ LearningStageGroup2["QUEUED"] = "QUEUED";
145
+ LearningStageGroup2["LEARNING"] = "LEARNING";
146
+ LearningStageGroup2["RETIRED"] = "RETIRED";
147
+ return LearningStageGroup2;
148
+ })(LearningStageGroup || {});
149
+ var LEARNING_STAGES_IN_GROUP = {
150
+ ["QUEUED" /* QUEUED */]: ["QUEUED" /* QUEUED */],
151
+ ["LEARNING" /* LEARNING */]: ["NEW" /* NEW */, "LEARNING" /* LEARNING */],
152
+ ["RETIRED" /* RETIRED */]: ["RETIRED" /* RETIRED */]
153
+ };
154
+ var isLearningStageGroup = (value) => typeof value === "string" && Object.values(LearningStageGroup).includes(value);
140
155
  var Progress = /* @__PURE__ */ ((Progress2) => {
141
156
  Progress2["WORSE"] = "WORSE";
142
157
  Progress2["NONE"] = "NONE";
@@ -294,12 +309,15 @@ var ApiPath = /* @__PURE__ */ ((ApiPath2) => {
294
309
  ApiPath2["LEXEMES_ALL"] = "/lexemes/all";
295
310
  ApiPath2["LEXEMES_COUNT"] = "/lexemes/count/:language";
296
311
  ApiPath2["LEXEMES_DELETE_ALL"] = "/lexemes/deleteAll";
312
+ ApiPath2["LEXEMES_LEARNING_INFO"] = "/lexemes/learningInfo";
297
313
  ApiPath2["LEXEMES_PAGE"] = "/lexemes/:length/:page";
314
+ ApiPath2["LEXEMES_PAGE_BY_STAGE"] = "/lexemes/stage/:stageGroup/:length/:page";
298
315
  ApiPath2["LEXEME_PAIR"] = "/lexemePair/:czId/:enId";
299
316
  ApiPath2["LEXEME_PAIRS_BY_TEXT"] = "/lexemePairsByText/:inputText/:inputLang";
300
317
  ApiPath2["LEXEME_PAIR_FAMILIARITY"] = "/lexemePair/:czId/:enId/:familiarity";
301
318
  ApiPath2["LEXEME_PAIR_COUNT"] = "/lexemePairCount";
302
319
  ApiPath2["LEXEME_PAIR_RECYCLE"] = "/lexemePair/recycle/:czId/:enId";
320
+ ApiPath2["PUSH_TOKEN"] = "/user/pushToken";
303
321
  ApiPath2["SIGN_IN"] = "/signIn";
304
322
  ApiPath2["SIGN_OUT"] = "/signOut";
305
323
  ApiPath2["TEST_COMPLETE"] = "/test/complete";
@@ -327,8 +345,10 @@ var ClientPlatform = /* @__PURE__ */ ((ClientPlatform2) => {
327
345
  ClientPlatform,
328
346
  Familiarity,
329
347
  HttpStatusCode,
348
+ LEARNING_STAGES_IN_GROUP,
330
349
  Language,
331
350
  LearningStage,
351
+ LearningStageGroup,
332
352
  Lexeme,
333
353
  LexemePair,
334
354
  Progress,
@@ -342,6 +362,7 @@ var ClientPlatform = /* @__PURE__ */ ((ClientPlatform2) => {
342
362
  getMysqlDateIgnoreTZ,
343
363
  isClientDateTooFarFromServerDate,
344
364
  isExpired,
365
+ isLearningStageGroup,
345
366
  isStringContainingInteger,
346
367
  isThePreviousDay,
347
368
  isTheSameDay,
package/dist/index.mjs CHANGED
@@ -86,6 +86,18 @@ var LearningStage = /* @__PURE__ */ ((LearningStage2) => {
86
86
  LearningStage2["QUEUED"] = "QUEUED";
87
87
  return LearningStage2;
88
88
  })(LearningStage || {});
89
+ var LearningStageGroup = /* @__PURE__ */ ((LearningStageGroup2) => {
90
+ LearningStageGroup2["QUEUED"] = "QUEUED";
91
+ LearningStageGroup2["LEARNING"] = "LEARNING";
92
+ LearningStageGroup2["RETIRED"] = "RETIRED";
93
+ return LearningStageGroup2;
94
+ })(LearningStageGroup || {});
95
+ var LEARNING_STAGES_IN_GROUP = {
96
+ ["QUEUED" /* QUEUED */]: ["QUEUED" /* QUEUED */],
97
+ ["LEARNING" /* LEARNING */]: ["NEW" /* NEW */, "LEARNING" /* LEARNING */],
98
+ ["RETIRED" /* RETIRED */]: ["RETIRED" /* RETIRED */]
99
+ };
100
+ var isLearningStageGroup = (value) => typeof value === "string" && Object.values(LearningStageGroup).includes(value);
89
101
  var Progress = /* @__PURE__ */ ((Progress2) => {
90
102
  Progress2["WORSE"] = "WORSE";
91
103
  Progress2["NONE"] = "NONE";
@@ -243,12 +255,15 @@ var ApiPath = /* @__PURE__ */ ((ApiPath2) => {
243
255
  ApiPath2["LEXEMES_ALL"] = "/lexemes/all";
244
256
  ApiPath2["LEXEMES_COUNT"] = "/lexemes/count/:language";
245
257
  ApiPath2["LEXEMES_DELETE_ALL"] = "/lexemes/deleteAll";
258
+ ApiPath2["LEXEMES_LEARNING_INFO"] = "/lexemes/learningInfo";
246
259
  ApiPath2["LEXEMES_PAGE"] = "/lexemes/:length/:page";
260
+ ApiPath2["LEXEMES_PAGE_BY_STAGE"] = "/lexemes/stage/:stageGroup/:length/:page";
247
261
  ApiPath2["LEXEME_PAIR"] = "/lexemePair/:czId/:enId";
248
262
  ApiPath2["LEXEME_PAIRS_BY_TEXT"] = "/lexemePairsByText/:inputText/:inputLang";
249
263
  ApiPath2["LEXEME_PAIR_FAMILIARITY"] = "/lexemePair/:czId/:enId/:familiarity";
250
264
  ApiPath2["LEXEME_PAIR_COUNT"] = "/lexemePairCount";
251
265
  ApiPath2["LEXEME_PAIR_RECYCLE"] = "/lexemePair/recycle/:czId/:enId";
266
+ ApiPath2["PUSH_TOKEN"] = "/user/pushToken";
252
267
  ApiPath2["SIGN_IN"] = "/signIn";
253
268
  ApiPath2["SIGN_OUT"] = "/signOut";
254
269
  ApiPath2["TEST_COMPLETE"] = "/test/complete";
@@ -275,8 +290,10 @@ export {
275
290
  ClientPlatform,
276
291
  Familiarity,
277
292
  HttpStatusCode,
293
+ LEARNING_STAGES_IN_GROUP,
278
294
  Language,
279
295
  LearningStage,
296
+ LearningStageGroup,
280
297
  Lexeme,
281
298
  LexemePair,
282
299
  Progress,
@@ -290,6 +307,7 @@ export {
290
307
  getMysqlDateIgnoreTZ,
291
308
  isClientDateTooFarFromServerDate,
292
309
  isExpired,
310
+ isLearningStageGroup,
293
311
  isStringContainingInteger,
294
312
  isThePreviousDay,
295
313
  isTheSameDay,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "czapp-shared",
3
- "version": "1.0.32",
3
+ "version": "1.0.34",
4
4
  "description": "This is a shared library for Czapp projects. It contains common code that is used across multiple projects.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
package/src/design/api.ts CHANGED
@@ -5,6 +5,7 @@ import {
5
5
  Familiarity,
6
6
  ITestResult,
7
7
  Language,
8
+ LearningStageGroup,
8
9
  MySQLDate,
9
10
  Scenario,
10
11
  IVocabCheckActivity,
@@ -38,12 +39,15 @@ export enum ApiPath {
38
39
  LEXEMES_ALL = '/lexemes/all',
39
40
  LEXEMES_COUNT = '/lexemes/count/:language',
40
41
  LEXEMES_DELETE_ALL = '/lexemes/deleteAll',
42
+ LEXEMES_LEARNING_INFO = '/lexemes/learningInfo',
41
43
  LEXEMES_PAGE = '/lexemes/:length/:page',
44
+ LEXEMES_PAGE_BY_STAGE = '/lexemes/stage/:stageGroup/:length/:page',
42
45
  LEXEME_PAIR = '/lexemePair/:czId/:enId',
43
46
  LEXEME_PAIRS_BY_TEXT = '/lexemePairsByText/:inputText/:inputLang',
44
47
  LEXEME_PAIR_FAMILIARITY = '/lexemePair/:czId/:enId/:familiarity',
45
48
  LEXEME_PAIR_COUNT = '/lexemePairCount',
46
49
  LEXEME_PAIR_RECYCLE = '/lexemePair/recycle/:czId/:enId',
50
+ PUSH_TOKEN = '/user/pushToken',
47
51
  SIGN_IN = '/signIn',
48
52
  SIGN_OUT = '/signOut',
49
53
  TEST_COMPLETE = '/test/complete',
@@ -105,6 +109,12 @@ export interface UpdateOnboardingStatusRequestBody {
105
109
  completedOnboarding: boolean;
106
110
  }
107
111
 
112
+ export interface RegisterPushTokenRequestBody {
113
+ expoPushToken: string;
114
+ platform: ClientPlatform;
115
+ timezone: string; // IANA timezone identifier, e.g. "Europe/Prague"
116
+ }
117
+
108
118
  /**
109
119
  * Request Params
110
120
  */
@@ -126,6 +136,7 @@ export interface SelectLexemePairsByTextParams {
126
136
  export interface SelectLexemesParams {
127
137
  page: number;
128
138
  length: number;
139
+ stageGroup?: LearningStageGroup; // undefined means every learning stage
129
140
  }
130
141
  export interface SelectTestLexemesParams {
131
142
  testType: VocabCheckType;
@@ -33,6 +33,28 @@ export enum LearningStage {
33
33
  QUEUED = 'QUEUED',
34
34
  }
35
35
 
36
+ /**
37
+ * User-facing grouping of LearningStage, used by the dictionary tabs.
38
+ * NEW is an internal transition stage the user never selects, so it is
39
+ * presented together with LEARNING - the same pairing the stored procedures
40
+ * already use for the active learning set (learningStage IN ('NEW','LEARNING')).
41
+ */
42
+ export enum LearningStageGroup {
43
+ QUEUED = 'QUEUED',
44
+ LEARNING = 'LEARNING',
45
+ RETIRED = 'RETIRED',
46
+ }
47
+
48
+ export const LEARNING_STAGES_IN_GROUP: Record<LearningStageGroup, LearningStage[]> = {
49
+ [LearningStageGroup.QUEUED]: [LearningStage.QUEUED],
50
+ [LearningStageGroup.LEARNING]: [LearningStage.NEW, LearningStage.LEARNING],
51
+ [LearningStageGroup.RETIRED]: [LearningStage.RETIRED],
52
+ };
53
+
54
+ export const isLearningStageGroup = (value: unknown): value is LearningStageGroup =>
55
+ typeof value === 'string' &&
56
+ Object.values(LearningStageGroup).includes(value as LearningStageGroup);
57
+
36
58
  export enum Progress {
37
59
  WORSE = "WORSE",
38
60
  NONE = "NONE",