czapp-shared 1.0.15 → 1.0.17
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 +31 -1
- package/dist/index.d.ts +31 -1
- package/dist/index.js +3 -0
- package/dist/index.mjs +3 -0
- package/package.json +1 -1
- package/src/design/api.ts +18 -2
- package/src/design/data.ts +17 -0
- package/src/design/lexemes.ts +0 -3
- package/src/design/types.ts +3 -0
- package/src/design/user.ts +1 -0
- package/src/index.ts +1 -0
package/dist/index.d.mts
CHANGED
|
@@ -81,6 +81,7 @@ interface ITestResult {
|
|
|
81
81
|
thinkingTimeSecs: number;
|
|
82
82
|
}
|
|
83
83
|
type MySQLDate = `${number}-${number}-${number} ${number}:${number}:${number}`;
|
|
84
|
+
type DateString = `${number}-${number}-${number}`;
|
|
84
85
|
declare enum ReminderFrequency {
|
|
85
86
|
ALWAYS = "ALWAYS",
|
|
86
87
|
DAILY = "DAILY",
|
|
@@ -98,6 +99,7 @@ declare enum AppError {
|
|
|
98
99
|
REQUEST_UPDATE_FAMILIARITY_FAILED = "Failed to update familiarity",
|
|
99
100
|
REQUEST_UPDATE_USER_SETTINGS_FAILED = "Failed to update user settings",
|
|
100
101
|
REQUEST_INSERT_OR_UPDATE_LEXEME_PAIR_FAILED = "Failed to insert or update lexeme pair",
|
|
102
|
+
REQUEST_RECYCLE_LEXEME_PAIR_FAILED = "Failed to recycle lexeme pair",
|
|
101
103
|
REQUEST_TRANSLATION_FAILED = "Failed to get translation",
|
|
102
104
|
REQUEST_TEST_COMPLETE_FAILED = "Failed to complete test",
|
|
103
105
|
REQUEST_TEST_SKIP_FAILED = "Failed to skip to the next deck"
|
|
@@ -186,6 +188,19 @@ declare class LexemePair implements ILexemePair {
|
|
|
186
188
|
declare const isStringContainingInteger: (str: any) => boolean;
|
|
187
189
|
declare const parameterReplace: (path: string, params?: string[]) => string;
|
|
188
190
|
|
|
191
|
+
interface IAddedData {
|
|
192
|
+
date: DateString;
|
|
193
|
+
count: number;
|
|
194
|
+
}
|
|
195
|
+
interface ITestedData {
|
|
196
|
+
date: DateString;
|
|
197
|
+
questionCount: number;
|
|
198
|
+
}
|
|
199
|
+
interface IReviewedData {
|
|
200
|
+
date: DateString;
|
|
201
|
+
flashcardCount: number;
|
|
202
|
+
}
|
|
203
|
+
|
|
189
204
|
interface IUserData {
|
|
190
205
|
currentStreakEnd: MySQLDate | undefined;
|
|
191
206
|
currentStreakLength: number;
|
|
@@ -204,6 +219,7 @@ interface IUserData {
|
|
|
204
219
|
signUpDate: MySQLDate;
|
|
205
220
|
testsCompletedCount: number;
|
|
206
221
|
uiLanguage: Language;
|
|
222
|
+
onboardingStatus: boolean;
|
|
207
223
|
}
|
|
208
224
|
|
|
209
225
|
declare enum HttpStatusCode {
|
|
@@ -223,6 +239,7 @@ declare enum ApiMethod {
|
|
|
223
239
|
}
|
|
224
240
|
declare enum ApiPath {
|
|
225
241
|
AUTOLOGIN = "/autologin",
|
|
242
|
+
DATA_HEATMAP = "/data/heatmap/:weekCount/:endDate",
|
|
226
243
|
HEALTH = "/health",
|
|
227
244
|
LEXEMES = "/lexemes",
|
|
228
245
|
LEXEMES_ALL = "/lexemes/all",
|
|
@@ -242,6 +259,7 @@ declare enum ApiPath {
|
|
|
242
259
|
TRANSLATE = "/translate",
|
|
243
260
|
TRANSLATIONS_ALL = "/lexemes/allTranslations/:sourceText/:sourceLang",
|
|
244
261
|
USER = "/user",
|
|
262
|
+
USER_ONBOARDING = "/user/onboarding",
|
|
245
263
|
USER_RESET_TEST = "/user/test/reset/:flashcardReviewCompletedCount/:currentStreakEnd"
|
|
246
264
|
}
|
|
247
265
|
declare enum ClientPlatform {
|
|
@@ -286,6 +304,9 @@ interface InsertOrUpdateRequestBody {
|
|
|
286
304
|
interface SignInRequestBody {
|
|
287
305
|
rememberMe: boolean;
|
|
288
306
|
}
|
|
307
|
+
interface UpdateOnboardingStatusRequestBody {
|
|
308
|
+
onboardingStatus: boolean;
|
|
309
|
+
}
|
|
289
310
|
/**
|
|
290
311
|
* Request Params
|
|
291
312
|
*/
|
|
@@ -329,6 +350,10 @@ interface ResetTestUserParams {
|
|
|
329
350
|
flashcardReviewCompletedCount: number;
|
|
330
351
|
currentStreakEnd: MySQLDate;
|
|
331
352
|
}
|
|
353
|
+
interface HeatMapParams {
|
|
354
|
+
weekCount: number;
|
|
355
|
+
endDate: DateString;
|
|
356
|
+
}
|
|
332
357
|
/**
|
|
333
358
|
* Response payloads
|
|
334
359
|
*/
|
|
@@ -362,6 +387,11 @@ interface TestCompleteResponseData {
|
|
|
362
387
|
testResultIds: number[];
|
|
363
388
|
rewardPointsDelta: number;
|
|
364
389
|
}
|
|
390
|
+
interface HeatMapResponseData {
|
|
391
|
+
added: IAddedData[];
|
|
392
|
+
tested: ITestedData[];
|
|
393
|
+
reviewed: IReviewedData[];
|
|
394
|
+
}
|
|
365
395
|
type DeeplTranslation = {
|
|
366
396
|
detectedSourceLanguage: Language;
|
|
367
397
|
translations: Array<{
|
|
@@ -369,4 +399,4 @@ type DeeplTranslation = {
|
|
|
369
399
|
}>;
|
|
370
400
|
};
|
|
371
401
|
|
|
372
|
-
export { ApiMethod, ApiPath, AppError, type AutologinRequestBody, ClientPlatform, type ControllerResponse, type DeeplTranslation, type DeleteLexemePairRequestParams, Familiarity, HttpStatusCode, type ICount, type ILexeme, type ILexemeIdPair, type ILexemeLearningInfo, type ILexemePair, type ITestResult, type IUserData, 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 SignInRequestBody, type SignInResponseData, type TestCompleteRequestBody, type TestCompleteResponseData, type TestInitRequestBody, type TestInitResponseData, type TranslationRequestBody, type TranslationResponseData, type UpdateLexemePairFamiliarityParams, type UpdateUserRequestBody, VocabCheckType, convertJSDateStringToMySQLDate, dateDifferenceInDays, getFormattedDate, getMysqlDateIgnoreTZ, isClientDateTooFarFromServerDate, isStringContainingInteger, isThePreviousDay, isTheSameDay, isValidJsDateString, isValidMysqlDateString, parameterReplace };
|
|
402
|
+
export { ApiMethod, ApiPath, AppError, type AutologinRequestBody, ClientPlatform, type ControllerResponse, type DateString, type DeeplTranslation, type DeleteLexemePairRequestParams, Familiarity, type HeatMapParams, type HeatMapResponseData, HttpStatusCode, type IAddedData, type ICount, type ILexeme, type ILexemeIdPair, type ILexemeLearningInfo, type ILexemePair, type IReviewedData, type ITestResult, type ITestedData, type IUserData, 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 SignInRequestBody, type SignInResponseData, type TestCompleteRequestBody, type TestCompleteResponseData, type TestInitRequestBody, type TestInitResponseData, type TranslationRequestBody, type TranslationResponseData, type UpdateLexemePairFamiliarityParams, type UpdateOnboardingStatusRequestBody, type UpdateUserRequestBody, VocabCheckType, convertJSDateStringToMySQLDate, dateDifferenceInDays, getFormattedDate, getMysqlDateIgnoreTZ, isClientDateTooFarFromServerDate, isStringContainingInteger, isThePreviousDay, isTheSameDay, isValidJsDateString, isValidMysqlDateString, parameterReplace };
|
package/dist/index.d.ts
CHANGED
|
@@ -81,6 +81,7 @@ interface ITestResult {
|
|
|
81
81
|
thinkingTimeSecs: number;
|
|
82
82
|
}
|
|
83
83
|
type MySQLDate = `${number}-${number}-${number} ${number}:${number}:${number}`;
|
|
84
|
+
type DateString = `${number}-${number}-${number}`;
|
|
84
85
|
declare enum ReminderFrequency {
|
|
85
86
|
ALWAYS = "ALWAYS",
|
|
86
87
|
DAILY = "DAILY",
|
|
@@ -98,6 +99,7 @@ declare enum AppError {
|
|
|
98
99
|
REQUEST_UPDATE_FAMILIARITY_FAILED = "Failed to update familiarity",
|
|
99
100
|
REQUEST_UPDATE_USER_SETTINGS_FAILED = "Failed to update user settings",
|
|
100
101
|
REQUEST_INSERT_OR_UPDATE_LEXEME_PAIR_FAILED = "Failed to insert or update lexeme pair",
|
|
102
|
+
REQUEST_RECYCLE_LEXEME_PAIR_FAILED = "Failed to recycle lexeme pair",
|
|
101
103
|
REQUEST_TRANSLATION_FAILED = "Failed to get translation",
|
|
102
104
|
REQUEST_TEST_COMPLETE_FAILED = "Failed to complete test",
|
|
103
105
|
REQUEST_TEST_SKIP_FAILED = "Failed to skip to the next deck"
|
|
@@ -186,6 +188,19 @@ declare class LexemePair implements ILexemePair {
|
|
|
186
188
|
declare const isStringContainingInteger: (str: any) => boolean;
|
|
187
189
|
declare const parameterReplace: (path: string, params?: string[]) => string;
|
|
188
190
|
|
|
191
|
+
interface IAddedData {
|
|
192
|
+
date: DateString;
|
|
193
|
+
count: number;
|
|
194
|
+
}
|
|
195
|
+
interface ITestedData {
|
|
196
|
+
date: DateString;
|
|
197
|
+
questionCount: number;
|
|
198
|
+
}
|
|
199
|
+
interface IReviewedData {
|
|
200
|
+
date: DateString;
|
|
201
|
+
flashcardCount: number;
|
|
202
|
+
}
|
|
203
|
+
|
|
189
204
|
interface IUserData {
|
|
190
205
|
currentStreakEnd: MySQLDate | undefined;
|
|
191
206
|
currentStreakLength: number;
|
|
@@ -204,6 +219,7 @@ interface IUserData {
|
|
|
204
219
|
signUpDate: MySQLDate;
|
|
205
220
|
testsCompletedCount: number;
|
|
206
221
|
uiLanguage: Language;
|
|
222
|
+
onboardingStatus: boolean;
|
|
207
223
|
}
|
|
208
224
|
|
|
209
225
|
declare enum HttpStatusCode {
|
|
@@ -223,6 +239,7 @@ declare enum ApiMethod {
|
|
|
223
239
|
}
|
|
224
240
|
declare enum ApiPath {
|
|
225
241
|
AUTOLOGIN = "/autologin",
|
|
242
|
+
DATA_HEATMAP = "/data/heatmap/:weekCount/:endDate",
|
|
226
243
|
HEALTH = "/health",
|
|
227
244
|
LEXEMES = "/lexemes",
|
|
228
245
|
LEXEMES_ALL = "/lexemes/all",
|
|
@@ -242,6 +259,7 @@ declare enum ApiPath {
|
|
|
242
259
|
TRANSLATE = "/translate",
|
|
243
260
|
TRANSLATIONS_ALL = "/lexemes/allTranslations/:sourceText/:sourceLang",
|
|
244
261
|
USER = "/user",
|
|
262
|
+
USER_ONBOARDING = "/user/onboarding",
|
|
245
263
|
USER_RESET_TEST = "/user/test/reset/:flashcardReviewCompletedCount/:currentStreakEnd"
|
|
246
264
|
}
|
|
247
265
|
declare enum ClientPlatform {
|
|
@@ -286,6 +304,9 @@ interface InsertOrUpdateRequestBody {
|
|
|
286
304
|
interface SignInRequestBody {
|
|
287
305
|
rememberMe: boolean;
|
|
288
306
|
}
|
|
307
|
+
interface UpdateOnboardingStatusRequestBody {
|
|
308
|
+
onboardingStatus: boolean;
|
|
309
|
+
}
|
|
289
310
|
/**
|
|
290
311
|
* Request Params
|
|
291
312
|
*/
|
|
@@ -329,6 +350,10 @@ interface ResetTestUserParams {
|
|
|
329
350
|
flashcardReviewCompletedCount: number;
|
|
330
351
|
currentStreakEnd: MySQLDate;
|
|
331
352
|
}
|
|
353
|
+
interface HeatMapParams {
|
|
354
|
+
weekCount: number;
|
|
355
|
+
endDate: DateString;
|
|
356
|
+
}
|
|
332
357
|
/**
|
|
333
358
|
* Response payloads
|
|
334
359
|
*/
|
|
@@ -362,6 +387,11 @@ interface TestCompleteResponseData {
|
|
|
362
387
|
testResultIds: number[];
|
|
363
388
|
rewardPointsDelta: number;
|
|
364
389
|
}
|
|
390
|
+
interface HeatMapResponseData {
|
|
391
|
+
added: IAddedData[];
|
|
392
|
+
tested: ITestedData[];
|
|
393
|
+
reviewed: IReviewedData[];
|
|
394
|
+
}
|
|
365
395
|
type DeeplTranslation = {
|
|
366
396
|
detectedSourceLanguage: Language;
|
|
367
397
|
translations: Array<{
|
|
@@ -369,4 +399,4 @@ type DeeplTranslation = {
|
|
|
369
399
|
}>;
|
|
370
400
|
};
|
|
371
401
|
|
|
372
|
-
export { ApiMethod, ApiPath, AppError, type AutologinRequestBody, ClientPlatform, type ControllerResponse, type DeeplTranslation, type DeleteLexemePairRequestParams, Familiarity, HttpStatusCode, type ICount, type ILexeme, type ILexemeIdPair, type ILexemeLearningInfo, type ILexemePair, type ITestResult, type IUserData, 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 SignInRequestBody, type SignInResponseData, type TestCompleteRequestBody, type TestCompleteResponseData, type TestInitRequestBody, type TestInitResponseData, type TranslationRequestBody, type TranslationResponseData, type UpdateLexemePairFamiliarityParams, type UpdateUserRequestBody, VocabCheckType, convertJSDateStringToMySQLDate, dateDifferenceInDays, getFormattedDate, getMysqlDateIgnoreTZ, isClientDateTooFarFromServerDate, isStringContainingInteger, isThePreviousDay, isTheSameDay, isValidJsDateString, isValidMysqlDateString, parameterReplace };
|
|
402
|
+
export { ApiMethod, ApiPath, AppError, type AutologinRequestBody, ClientPlatform, type ControllerResponse, type DateString, type DeeplTranslation, type DeleteLexemePairRequestParams, Familiarity, type HeatMapParams, type HeatMapResponseData, HttpStatusCode, type IAddedData, type ICount, type ILexeme, type ILexemeIdPair, type ILexemeLearningInfo, type ILexemePair, type IReviewedData, type ITestResult, type ITestedData, type IUserData, 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 SignInRequestBody, type SignInResponseData, type TestCompleteRequestBody, type TestCompleteResponseData, type TestInitRequestBody, type TestInitResponseData, type TranslationRequestBody, type TranslationResponseData, type UpdateLexemePairFamiliarityParams, type UpdateOnboardingStatusRequestBody, type UpdateUserRequestBody, VocabCheckType, convertJSDateStringToMySQLDate, dateDifferenceInDays, getFormattedDate, getMysqlDateIgnoreTZ, isClientDateTooFarFromServerDate, isStringContainingInteger, isThePreviousDay, isTheSameDay, isValidJsDateString, isValidMysqlDateString, parameterReplace };
|
package/dist/index.js
CHANGED
|
@@ -153,6 +153,7 @@ var AppError = /* @__PURE__ */ ((AppError2) => {
|
|
|
153
153
|
AppError2["REQUEST_UPDATE_FAMILIARITY_FAILED"] = "Failed to update familiarity";
|
|
154
154
|
AppError2["REQUEST_UPDATE_USER_SETTINGS_FAILED"] = "Failed to update user settings";
|
|
155
155
|
AppError2["REQUEST_INSERT_OR_UPDATE_LEXEME_PAIR_FAILED"] = "Failed to insert or update lexeme pair";
|
|
156
|
+
AppError2["REQUEST_RECYCLE_LEXEME_PAIR_FAILED"] = "Failed to recycle lexeme pair";
|
|
156
157
|
AppError2["REQUEST_TRANSLATION_FAILED"] = "Failed to get translation";
|
|
157
158
|
AppError2["REQUEST_TEST_COMPLETE_FAILED"] = "Failed to complete test";
|
|
158
159
|
AppError2["REQUEST_TEST_SKIP_FAILED"] = "Failed to skip to the next deck";
|
|
@@ -233,6 +234,7 @@ var ApiMethod = /* @__PURE__ */ ((ApiMethod2) => {
|
|
|
233
234
|
})(ApiMethod || {});
|
|
234
235
|
var ApiPath = /* @__PURE__ */ ((ApiPath2) => {
|
|
235
236
|
ApiPath2["AUTOLOGIN"] = "/autologin";
|
|
237
|
+
ApiPath2["DATA_HEATMAP"] = "/data/heatmap/:weekCount/:endDate";
|
|
236
238
|
ApiPath2["HEALTH"] = "/health";
|
|
237
239
|
ApiPath2["LEXEMES"] = "/lexemes";
|
|
238
240
|
ApiPath2["LEXEMES_ALL"] = "/lexemes/all";
|
|
@@ -252,6 +254,7 @@ var ApiPath = /* @__PURE__ */ ((ApiPath2) => {
|
|
|
252
254
|
ApiPath2["TRANSLATE"] = "/translate";
|
|
253
255
|
ApiPath2["TRANSLATIONS_ALL"] = "/lexemes/allTranslations/:sourceText/:sourceLang";
|
|
254
256
|
ApiPath2["USER"] = "/user";
|
|
257
|
+
ApiPath2["USER_ONBOARDING"] = "/user/onboarding";
|
|
255
258
|
ApiPath2["USER_RESET_TEST"] = "/user/test/reset/:flashcardReviewCompletedCount/:currentStreakEnd";
|
|
256
259
|
return ApiPath2;
|
|
257
260
|
})(ApiPath || {});
|
package/dist/index.mjs
CHANGED
|
@@ -104,6 +104,7 @@ var AppError = /* @__PURE__ */ ((AppError2) => {
|
|
|
104
104
|
AppError2["REQUEST_UPDATE_FAMILIARITY_FAILED"] = "Failed to update familiarity";
|
|
105
105
|
AppError2["REQUEST_UPDATE_USER_SETTINGS_FAILED"] = "Failed to update user settings";
|
|
106
106
|
AppError2["REQUEST_INSERT_OR_UPDATE_LEXEME_PAIR_FAILED"] = "Failed to insert or update lexeme pair";
|
|
107
|
+
AppError2["REQUEST_RECYCLE_LEXEME_PAIR_FAILED"] = "Failed to recycle lexeme pair";
|
|
107
108
|
AppError2["REQUEST_TRANSLATION_FAILED"] = "Failed to get translation";
|
|
108
109
|
AppError2["REQUEST_TEST_COMPLETE_FAILED"] = "Failed to complete test";
|
|
109
110
|
AppError2["REQUEST_TEST_SKIP_FAILED"] = "Failed to skip to the next deck";
|
|
@@ -184,6 +185,7 @@ var ApiMethod = /* @__PURE__ */ ((ApiMethod2) => {
|
|
|
184
185
|
})(ApiMethod || {});
|
|
185
186
|
var ApiPath = /* @__PURE__ */ ((ApiPath2) => {
|
|
186
187
|
ApiPath2["AUTOLOGIN"] = "/autologin";
|
|
188
|
+
ApiPath2["DATA_HEATMAP"] = "/data/heatmap/:weekCount/:endDate";
|
|
187
189
|
ApiPath2["HEALTH"] = "/health";
|
|
188
190
|
ApiPath2["LEXEMES"] = "/lexemes";
|
|
189
191
|
ApiPath2["LEXEMES_ALL"] = "/lexemes/all";
|
|
@@ -203,6 +205,7 @@ var ApiPath = /* @__PURE__ */ ((ApiPath2) => {
|
|
|
203
205
|
ApiPath2["TRANSLATE"] = "/translate";
|
|
204
206
|
ApiPath2["TRANSLATIONS_ALL"] = "/lexemes/allTranslations/:sourceText/:sourceLang";
|
|
205
207
|
ApiPath2["USER"] = "/user";
|
|
208
|
+
ApiPath2["USER_ONBOARDING"] = "/user/onboarding";
|
|
206
209
|
ApiPath2["USER_RESET_TEST"] = "/user/test/reset/:flashcardReviewCompletedCount/:currentStreakEnd";
|
|
207
210
|
return ApiPath2;
|
|
208
211
|
})(ApiPath || {});
|
package/package.json
CHANGED
package/src/design/api.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { IAddedData, IReviewedData, ITestedData } from './data';
|
|
1
2
|
import { ILexeme, ILexemeIdPair, ILexemeLearningInfo, ILexemePair } from './lexemes';
|
|
2
|
-
import { Familiarity, ITestResult, Language, MySQLDate, Scenario, VocabCheckType } from './types';
|
|
3
|
+
import { DateString, Familiarity, ITestResult, Language, MySQLDate, Scenario, VocabCheckType } from './types';
|
|
3
4
|
import { IUserData } from './user';
|
|
4
5
|
|
|
5
6
|
export enum HttpStatusCode {
|
|
@@ -21,6 +22,7 @@ export enum ApiMethod {
|
|
|
21
22
|
|
|
22
23
|
export enum ApiPath {
|
|
23
24
|
AUTOLOGIN = '/autologin',
|
|
25
|
+
DATA_HEATMAP = '/data/heatmap/:weekCount/:endDate',
|
|
24
26
|
HEALTH = '/health',
|
|
25
27
|
LEXEMES = '/lexemes',
|
|
26
28
|
LEXEMES_ALL = '/lexemes/all',
|
|
@@ -40,6 +42,7 @@ export enum ApiPath {
|
|
|
40
42
|
TRANSLATE = '/translate',
|
|
41
43
|
TRANSLATIONS_ALL = '/lexemes/allTranslations/:sourceText/:sourceLang',
|
|
42
44
|
USER = '/user',
|
|
45
|
+
USER_ONBOARDING = '/user/onboarding',
|
|
43
46
|
USER_RESET_TEST = '/user/test/reset/:flashcardReviewCompletedCount/:currentStreakEnd',
|
|
44
47
|
}
|
|
45
48
|
|
|
@@ -87,6 +90,10 @@ export interface SignInRequestBody {
|
|
|
87
90
|
rememberMe: boolean;
|
|
88
91
|
}
|
|
89
92
|
|
|
93
|
+
export interface UpdateOnboardingStatusRequestBody {
|
|
94
|
+
onboardingStatus: boolean;
|
|
95
|
+
}
|
|
96
|
+
|
|
90
97
|
/**
|
|
91
98
|
* Request Params
|
|
92
99
|
*/
|
|
@@ -130,7 +137,10 @@ export interface ResetTestUserParams {
|
|
|
130
137
|
flashcardReviewCompletedCount: number;
|
|
131
138
|
currentStreakEnd: MySQLDate;
|
|
132
139
|
}
|
|
133
|
-
|
|
140
|
+
export interface HeatMapParams {
|
|
141
|
+
weekCount: number;
|
|
142
|
+
endDate: DateString;
|
|
143
|
+
}
|
|
134
144
|
|
|
135
145
|
|
|
136
146
|
/**
|
|
@@ -172,6 +182,12 @@ export interface TestCompleteResponseData {
|
|
|
172
182
|
rewardPointsDelta: number;
|
|
173
183
|
}
|
|
174
184
|
|
|
185
|
+
export interface HeatMapResponseData {
|
|
186
|
+
added: IAddedData[];
|
|
187
|
+
tested: ITestedData[];
|
|
188
|
+
reviewed: IReviewedData[];
|
|
189
|
+
}
|
|
190
|
+
|
|
175
191
|
// other
|
|
176
192
|
export type DeeplTranslation = {
|
|
177
193
|
detectedSourceLanguage: Language,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DateString } from './types';
|
|
2
|
+
|
|
3
|
+
export interface IAddedData {
|
|
4
|
+
date: DateString;
|
|
5
|
+
count: number;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface ITestedData {
|
|
9
|
+
date: DateString;
|
|
10
|
+
questionCount: number;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface IReviewedData {
|
|
14
|
+
date: DateString;
|
|
15
|
+
flashcardCount: number;
|
|
16
|
+
}
|
|
17
|
+
|
package/src/design/lexemes.ts
CHANGED
package/src/design/types.ts
CHANGED
|
@@ -37,6 +37,8 @@ export interface ITestResult {
|
|
|
37
37
|
|
|
38
38
|
export type MySQLDate = `${number}-${number}-${number} ${number}:${number}:${number}`;
|
|
39
39
|
|
|
40
|
+
export type DateString = `${number}-${number}-${number}`;
|
|
41
|
+
|
|
40
42
|
export enum ReminderFrequency {
|
|
41
43
|
ALWAYS = "ALWAYS",
|
|
42
44
|
DAILY = "DAILY",
|
|
@@ -55,6 +57,7 @@ export enum AppError {
|
|
|
55
57
|
REQUEST_UPDATE_FAMILIARITY_FAILED = 'Failed to update familiarity',
|
|
56
58
|
REQUEST_UPDATE_USER_SETTINGS_FAILED = 'Failed to update user settings',
|
|
57
59
|
REQUEST_INSERT_OR_UPDATE_LEXEME_PAIR_FAILED = 'Failed to insert or update lexeme pair',
|
|
60
|
+
REQUEST_RECYCLE_LEXEME_PAIR_FAILED = 'Failed to recycle lexeme pair',
|
|
58
61
|
REQUEST_TRANSLATION_FAILED = 'Failed to get translation',
|
|
59
62
|
REQUEST_TEST_COMPLETE_FAILED = 'Failed to complete test',
|
|
60
63
|
REQUEST_TEST_SKIP_FAILED = "Failed to skip to the next deck"
|
package/src/design/user.ts
CHANGED
package/src/index.ts
CHANGED