czapp-shared 1.0.9 → 1.0.10
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 +12 -5
- package/dist/index.d.ts +12 -5
- package/dist/index.js +3 -1
- package/dist/index.mjs +3 -1
- package/package.json +1 -1
- package/src/design/api.ts +5 -3
- package/src/design/lexemes.ts +6 -0
- package/src/design/types.ts +1 -0
- package/src/design/user.ts +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -104,7 +104,8 @@ declare enum AppError {
|
|
|
104
104
|
REQUEST_UPDATE_USER_SETTINGS_FAILED = "Failed to update user settings",
|
|
105
105
|
REQUEST_INSERT_OR_UPDATE_LEXEME_PAIR_FAILED = "Failed to insert or update lexeme pair",
|
|
106
106
|
REQUEST_TRANSLATION_FAILED = "Failed to get translation",
|
|
107
|
-
REQUEST_TEST_COMPLETE_FAILED = "Failed to complete test"
|
|
107
|
+
REQUEST_TEST_COMPLETE_FAILED = "Failed to complete test",
|
|
108
|
+
REQUEST_TEST_SKIP_FAILED = "Failed to skip to the next deck"
|
|
108
109
|
}
|
|
109
110
|
declare enum Scenario {
|
|
110
111
|
S1_INSERT_HAPPY_PATH = "Insert, happy path",
|
|
@@ -159,6 +160,11 @@ type LexemePairWithLang = {
|
|
|
159
160
|
interface ICount {
|
|
160
161
|
count: number;
|
|
161
162
|
}
|
|
163
|
+
interface ILexemeLearningInfo {
|
|
164
|
+
newCount: number;
|
|
165
|
+
learningCount: number;
|
|
166
|
+
retiredCount: number;
|
|
167
|
+
}
|
|
162
168
|
|
|
163
169
|
declare class Lexeme implements ILexeme {
|
|
164
170
|
text: string;
|
|
@@ -202,7 +208,6 @@ interface IUserData {
|
|
|
202
208
|
rewardPoints: number;
|
|
203
209
|
signUpDate: MySQLDate;
|
|
204
210
|
testsCompletedCount: number;
|
|
205
|
-
testsUnlocked: boolean;
|
|
206
211
|
uiLanguage: Language;
|
|
207
212
|
}
|
|
208
213
|
|
|
@@ -236,10 +241,11 @@ declare enum ApiPath {
|
|
|
236
241
|
SIGN_OUT = "/signOut",
|
|
237
242
|
TEST_COMPLETE = "/test/complete",
|
|
238
243
|
TEST_INIT = "/test/init",
|
|
244
|
+
TEST_SKIP_DECK = "/test/skipDeck",
|
|
239
245
|
TRANSLATE = "/translate",
|
|
240
246
|
TRANSLATIONS_ALL = "/lexemes/allTranslations/:sourceText/:sourceLang",
|
|
241
247
|
USER = "/user",
|
|
242
|
-
USER_RESET_TEST = "/user/test/reset/:flashcardReviewCompletedCount/:
|
|
248
|
+
USER_RESET_TEST = "/user/test/reset/:flashcardReviewCompletedCount/:currentStreakEnd"
|
|
243
249
|
}
|
|
244
250
|
/**
|
|
245
251
|
* Request payloads
|
|
@@ -314,7 +320,7 @@ interface DeleteLexemePairRequestParams {
|
|
|
314
320
|
}
|
|
315
321
|
interface ResetTestUserParams {
|
|
316
322
|
flashcardReviewCompletedCount: number;
|
|
317
|
-
|
|
323
|
+
currentStreakEnd: MySQLDate;
|
|
318
324
|
}
|
|
319
325
|
/**
|
|
320
326
|
* Response payloads
|
|
@@ -341,6 +347,7 @@ interface SignInResponseData {
|
|
|
341
347
|
}
|
|
342
348
|
interface TestInitResponseData {
|
|
343
349
|
lexemePairs: ILexemePair[];
|
|
350
|
+
lexemeLearningInfo: ILexemeLearningInfo;
|
|
344
351
|
vocabCheckType: VocabCheckType;
|
|
345
352
|
}
|
|
346
353
|
interface TestCompleteResponseData {
|
|
@@ -355,4 +362,4 @@ type DeeplTranslation = {
|
|
|
355
362
|
}>;
|
|
356
363
|
};
|
|
357
364
|
|
|
358
|
-
export { ApiMethod, ApiPath, AppError, type AutologinRequestBody, type ControllerResponse, type DeeplTranslation, type DeleteLexemePairRequestParams, Familiarity, HttpStatusCode, type ICount, type ILexeme, type ILexemeIdPair, type ILexemePair, type ITestResult, type IUserData, type InsertOrUpdateRequestBody, type InsertOrUpdateResponseData, Language, LearningStage, Lexeme, LexemePair, type LexemePairRequestBody, type LexemePairWithLang, type MySQLDate, Progress, 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, getMysqlDateAllowingForTZ, getMysqlDateIgnoreTZ, isClientDateTooFarFromServerDate, isStringContainingInteger, isThePreviousDay, isTheSameDay, isValidJsDateString, isValidMysqlDateString, parameterReplace };
|
|
365
|
+
export { ApiMethod, ApiPath, AppError, type AutologinRequestBody, 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, 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, getMysqlDateAllowingForTZ, getMysqlDateIgnoreTZ, isClientDateTooFarFromServerDate, isStringContainingInteger, isThePreviousDay, isTheSameDay, isValidJsDateString, isValidMysqlDateString, parameterReplace };
|
package/dist/index.d.ts
CHANGED
|
@@ -104,7 +104,8 @@ declare enum AppError {
|
|
|
104
104
|
REQUEST_UPDATE_USER_SETTINGS_FAILED = "Failed to update user settings",
|
|
105
105
|
REQUEST_INSERT_OR_UPDATE_LEXEME_PAIR_FAILED = "Failed to insert or update lexeme pair",
|
|
106
106
|
REQUEST_TRANSLATION_FAILED = "Failed to get translation",
|
|
107
|
-
REQUEST_TEST_COMPLETE_FAILED = "Failed to complete test"
|
|
107
|
+
REQUEST_TEST_COMPLETE_FAILED = "Failed to complete test",
|
|
108
|
+
REQUEST_TEST_SKIP_FAILED = "Failed to skip to the next deck"
|
|
108
109
|
}
|
|
109
110
|
declare enum Scenario {
|
|
110
111
|
S1_INSERT_HAPPY_PATH = "Insert, happy path",
|
|
@@ -159,6 +160,11 @@ type LexemePairWithLang = {
|
|
|
159
160
|
interface ICount {
|
|
160
161
|
count: number;
|
|
161
162
|
}
|
|
163
|
+
interface ILexemeLearningInfo {
|
|
164
|
+
newCount: number;
|
|
165
|
+
learningCount: number;
|
|
166
|
+
retiredCount: number;
|
|
167
|
+
}
|
|
162
168
|
|
|
163
169
|
declare class Lexeme implements ILexeme {
|
|
164
170
|
text: string;
|
|
@@ -202,7 +208,6 @@ interface IUserData {
|
|
|
202
208
|
rewardPoints: number;
|
|
203
209
|
signUpDate: MySQLDate;
|
|
204
210
|
testsCompletedCount: number;
|
|
205
|
-
testsUnlocked: boolean;
|
|
206
211
|
uiLanguage: Language;
|
|
207
212
|
}
|
|
208
213
|
|
|
@@ -236,10 +241,11 @@ declare enum ApiPath {
|
|
|
236
241
|
SIGN_OUT = "/signOut",
|
|
237
242
|
TEST_COMPLETE = "/test/complete",
|
|
238
243
|
TEST_INIT = "/test/init",
|
|
244
|
+
TEST_SKIP_DECK = "/test/skipDeck",
|
|
239
245
|
TRANSLATE = "/translate",
|
|
240
246
|
TRANSLATIONS_ALL = "/lexemes/allTranslations/:sourceText/:sourceLang",
|
|
241
247
|
USER = "/user",
|
|
242
|
-
USER_RESET_TEST = "/user/test/reset/:flashcardReviewCompletedCount/:
|
|
248
|
+
USER_RESET_TEST = "/user/test/reset/:flashcardReviewCompletedCount/:currentStreakEnd"
|
|
243
249
|
}
|
|
244
250
|
/**
|
|
245
251
|
* Request payloads
|
|
@@ -314,7 +320,7 @@ interface DeleteLexemePairRequestParams {
|
|
|
314
320
|
}
|
|
315
321
|
interface ResetTestUserParams {
|
|
316
322
|
flashcardReviewCompletedCount: number;
|
|
317
|
-
|
|
323
|
+
currentStreakEnd: MySQLDate;
|
|
318
324
|
}
|
|
319
325
|
/**
|
|
320
326
|
* Response payloads
|
|
@@ -341,6 +347,7 @@ interface SignInResponseData {
|
|
|
341
347
|
}
|
|
342
348
|
interface TestInitResponseData {
|
|
343
349
|
lexemePairs: ILexemePair[];
|
|
350
|
+
lexemeLearningInfo: ILexemeLearningInfo;
|
|
344
351
|
vocabCheckType: VocabCheckType;
|
|
345
352
|
}
|
|
346
353
|
interface TestCompleteResponseData {
|
|
@@ -355,4 +362,4 @@ type DeeplTranslation = {
|
|
|
355
362
|
}>;
|
|
356
363
|
};
|
|
357
364
|
|
|
358
|
-
export { ApiMethod, ApiPath, AppError, type AutologinRequestBody, type ControllerResponse, type DeeplTranslation, type DeleteLexemePairRequestParams, Familiarity, HttpStatusCode, type ICount, type ILexeme, type ILexemeIdPair, type ILexemePair, type ITestResult, type IUserData, type InsertOrUpdateRequestBody, type InsertOrUpdateResponseData, Language, LearningStage, Lexeme, LexemePair, type LexemePairRequestBody, type LexemePairWithLang, type MySQLDate, Progress, 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, getMysqlDateAllowingForTZ, getMysqlDateIgnoreTZ, isClientDateTooFarFromServerDate, isStringContainingInteger, isThePreviousDay, isTheSameDay, isValidJsDateString, isValidMysqlDateString, parameterReplace };
|
|
365
|
+
export { ApiMethod, ApiPath, AppError, type AutologinRequestBody, 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, 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, getMysqlDateAllowingForTZ, getMysqlDateIgnoreTZ, isClientDateTooFarFromServerDate, isStringContainingInteger, isThePreviousDay, isTheSameDay, isValidJsDateString, isValidMysqlDateString, parameterReplace };
|
package/dist/index.js
CHANGED
|
@@ -161,6 +161,7 @@ var AppError = /* @__PURE__ */ ((AppError2) => {
|
|
|
161
161
|
AppError2["REQUEST_INSERT_OR_UPDATE_LEXEME_PAIR_FAILED"] = "Failed to insert or update lexeme pair";
|
|
162
162
|
AppError2["REQUEST_TRANSLATION_FAILED"] = "Failed to get translation";
|
|
163
163
|
AppError2["REQUEST_TEST_COMPLETE_FAILED"] = "Failed to complete test";
|
|
164
|
+
AppError2["REQUEST_TEST_SKIP_FAILED"] = "Failed to skip to the next deck";
|
|
164
165
|
return AppError2;
|
|
165
166
|
})(AppError || {});
|
|
166
167
|
var Scenario = /* @__PURE__ */ ((Scenario2) => {
|
|
@@ -251,10 +252,11 @@ var ApiPath = /* @__PURE__ */ ((ApiPath2) => {
|
|
|
251
252
|
ApiPath2["SIGN_OUT"] = "/signOut";
|
|
252
253
|
ApiPath2["TEST_COMPLETE"] = "/test/complete";
|
|
253
254
|
ApiPath2["TEST_INIT"] = "/test/init";
|
|
255
|
+
ApiPath2["TEST_SKIP_DECK"] = "/test/skipDeck";
|
|
254
256
|
ApiPath2["TRANSLATE"] = "/translate";
|
|
255
257
|
ApiPath2["TRANSLATIONS_ALL"] = "/lexemes/allTranslations/:sourceText/:sourceLang";
|
|
256
258
|
ApiPath2["USER"] = "/user";
|
|
257
|
-
ApiPath2["USER_RESET_TEST"] = "/user/test/reset/:flashcardReviewCompletedCount/:
|
|
259
|
+
ApiPath2["USER_RESET_TEST"] = "/user/test/reset/:flashcardReviewCompletedCount/:currentStreakEnd";
|
|
258
260
|
return ApiPath2;
|
|
259
261
|
})(ApiPath || {});
|
|
260
262
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/index.mjs
CHANGED
|
@@ -112,6 +112,7 @@ var AppError = /* @__PURE__ */ ((AppError2) => {
|
|
|
112
112
|
AppError2["REQUEST_INSERT_OR_UPDATE_LEXEME_PAIR_FAILED"] = "Failed to insert or update lexeme pair";
|
|
113
113
|
AppError2["REQUEST_TRANSLATION_FAILED"] = "Failed to get translation";
|
|
114
114
|
AppError2["REQUEST_TEST_COMPLETE_FAILED"] = "Failed to complete test";
|
|
115
|
+
AppError2["REQUEST_TEST_SKIP_FAILED"] = "Failed to skip to the next deck";
|
|
115
116
|
return AppError2;
|
|
116
117
|
})(AppError || {});
|
|
117
118
|
var Scenario = /* @__PURE__ */ ((Scenario2) => {
|
|
@@ -202,10 +203,11 @@ var ApiPath = /* @__PURE__ */ ((ApiPath2) => {
|
|
|
202
203
|
ApiPath2["SIGN_OUT"] = "/signOut";
|
|
203
204
|
ApiPath2["TEST_COMPLETE"] = "/test/complete";
|
|
204
205
|
ApiPath2["TEST_INIT"] = "/test/init";
|
|
206
|
+
ApiPath2["TEST_SKIP_DECK"] = "/test/skipDeck";
|
|
205
207
|
ApiPath2["TRANSLATE"] = "/translate";
|
|
206
208
|
ApiPath2["TRANSLATIONS_ALL"] = "/lexemes/allTranslations/:sourceText/:sourceLang";
|
|
207
209
|
ApiPath2["USER"] = "/user";
|
|
208
|
-
ApiPath2["USER_RESET_TEST"] = "/user/test/reset/:flashcardReviewCompletedCount/:
|
|
210
|
+
ApiPath2["USER_RESET_TEST"] = "/user/test/reset/:flashcardReviewCompletedCount/:currentStreakEnd";
|
|
209
211
|
return ApiPath2;
|
|
210
212
|
})(ApiPath || {});
|
|
211
213
|
export {
|
package/package.json
CHANGED
package/src/design/api.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ILexeme, ILexemeIdPair, ILexemePair } from './lexemes';
|
|
1
|
+
import { ILexeme, ILexemeIdPair, ILexemeLearningInfo, ILexemePair } from './lexemes';
|
|
2
2
|
import { Familiarity, ITestResult, Language, MySQLDate, Scenario, VocabCheckType } from './types';
|
|
3
3
|
import { IUserData } from './user';
|
|
4
4
|
|
|
@@ -34,10 +34,11 @@ export enum ApiPath {
|
|
|
34
34
|
SIGN_OUT = '/signOut',
|
|
35
35
|
TEST_COMPLETE = '/test/complete',
|
|
36
36
|
TEST_INIT = '/test/init',
|
|
37
|
+
TEST_SKIP_DECK = '/test/skipDeck',
|
|
37
38
|
TRANSLATE = '/translate',
|
|
38
39
|
TRANSLATIONS_ALL = '/lexemes/allTranslations/:sourceText/:sourceLang',
|
|
39
40
|
USER = '/user',
|
|
40
|
-
USER_RESET_TEST = '/user/test/reset/:flashcardReviewCompletedCount/:
|
|
41
|
+
USER_RESET_TEST = '/user/test/reset/:flashcardReviewCompletedCount/:currentStreakEnd',
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
|
|
@@ -115,7 +116,7 @@ export interface DeleteLexemePairRequestParams {
|
|
|
115
116
|
}
|
|
116
117
|
export interface ResetTestUserParams {
|
|
117
118
|
flashcardReviewCompletedCount: number;
|
|
118
|
-
|
|
119
|
+
currentStreakEnd: MySQLDate;
|
|
119
120
|
}
|
|
120
121
|
|
|
121
122
|
|
|
@@ -150,6 +151,7 @@ export interface SignInResponseData {
|
|
|
150
151
|
}
|
|
151
152
|
export interface TestInitResponseData {
|
|
152
153
|
lexemePairs: ILexemePair[];
|
|
154
|
+
lexemeLearningInfo: ILexemeLearningInfo;
|
|
153
155
|
vocabCheckType: VocabCheckType;
|
|
154
156
|
}
|
|
155
157
|
export interface TestCompleteResponseData {
|
package/src/design/lexemes.ts
CHANGED
package/src/design/types.ts
CHANGED
|
@@ -57,6 +57,7 @@ export enum AppError {
|
|
|
57
57
|
REQUEST_INSERT_OR_UPDATE_LEXEME_PAIR_FAILED = 'Failed to insert or update lexeme pair',
|
|
58
58
|
REQUEST_TRANSLATION_FAILED = 'Failed to get translation',
|
|
59
59
|
REQUEST_TEST_COMPLETE_FAILED = 'Failed to complete test',
|
|
60
|
+
REQUEST_TEST_SKIP_FAILED = "Failed to skip to the next deck"
|
|
60
61
|
}
|
|
61
62
|
|
|
62
63
|
export enum Scenario {
|