czapp-shared 1.0.23 → 1.0.25
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/README.md +2 -1
- package/dist/index.d.mts +9 -4
- package/dist/index.d.ts +9 -4
- package/dist/index.js +1 -0
- package/dist/index.mjs +1 -0
- package/package.json +2 -1
- package/src/design/api.ts +3 -1
- package/src/design/lexemes.ts +5 -0
- package/src/design/user.ts +1 -3
package/README.md
CHANGED
|
@@ -48,7 +48,8 @@ To run the project in watch mode:
|
|
|
48
48
|
npm run watch
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
TODO - make yalc republish after every change. At the moment it is manual. Run `yalc
|
|
51
|
+
TODO - make yalc republish after every change. At the moment it is manual. Run `yalc push` after every change. Note that
|
|
52
|
+
`yalc publish` is not enough to force the dependent packages to update. `yalc push` is the way!
|
|
52
53
|
|
|
53
54
|
### Build
|
|
54
55
|
To build the project (generate the artifacts):
|
package/dist/index.d.mts
CHANGED
|
@@ -158,6 +158,10 @@ interface ILexemeIdPair {
|
|
|
158
158
|
czId: number;
|
|
159
159
|
enId: number;
|
|
160
160
|
}
|
|
161
|
+
interface ILexemePairTexts {
|
|
162
|
+
czText: string;
|
|
163
|
+
enText: string;
|
|
164
|
+
}
|
|
161
165
|
type LexemePairWithLang = {
|
|
162
166
|
czechLexeme: ILexeme;
|
|
163
167
|
englishLexeme: ILexeme;
|
|
@@ -203,17 +207,15 @@ interface IActivityCount {
|
|
|
203
207
|
}
|
|
204
208
|
|
|
205
209
|
interface IUserData {
|
|
210
|
+
googleSub: string;
|
|
206
211
|
currentStreakEnd: MySQLDate | undefined;
|
|
207
212
|
currentStreakLength: number;
|
|
208
213
|
email: string;
|
|
209
214
|
flashcardReviewCompletedCount: number;
|
|
210
|
-
googleSub: string;
|
|
211
215
|
highStreakEnd: MySQLDate | undefined;
|
|
212
216
|
highStreakLength: number;
|
|
213
217
|
lastModified: MySQLDate;
|
|
214
|
-
lastWordAdded: string;
|
|
215
218
|
learningLanguage: Language;
|
|
216
|
-
lexemePairCount: number;
|
|
217
219
|
name: string;
|
|
218
220
|
phone: string;
|
|
219
221
|
rewardPoints: number;
|
|
@@ -242,6 +244,7 @@ declare enum ApiPath {
|
|
|
242
244
|
AUTOLOGIN = "/autologin",
|
|
243
245
|
DATA_HEATMAP = "/data/heatmap/:weekCount/:endDate",
|
|
244
246
|
HEALTH = "/health",
|
|
247
|
+
LAST_WORDS_ADDED = "/lastWordsAdded",
|
|
245
248
|
LEXEMES = "/lexemes",
|
|
246
249
|
LEXEMES_ALL = "/lexemes/all",
|
|
247
250
|
LEXEMES_COUNT = "/lexemes/count/:language",
|
|
@@ -273,6 +276,7 @@ declare enum ClientPlatform {
|
|
|
273
276
|
*/
|
|
274
277
|
interface TestInitRequestBody {
|
|
275
278
|
vocabCheckType: VocabCheckType;
|
|
279
|
+
maxFlashcardDeckCount: number | null;
|
|
276
280
|
}
|
|
277
281
|
interface TestCompleteRequestBody {
|
|
278
282
|
clientDate: MySQLDate;
|
|
@@ -383,6 +387,7 @@ interface TestInitResponseData {
|
|
|
383
387
|
lexemePairs: ILexemePair[];
|
|
384
388
|
lexemeLearningInfo: ILexemeLearningInfo;
|
|
385
389
|
vocabCheckType: VocabCheckType;
|
|
390
|
+
pushedFlashcardCount?: number;
|
|
386
391
|
}
|
|
387
392
|
interface TestCompleteResponseData {
|
|
388
393
|
user: IUserData;
|
|
@@ -401,4 +406,4 @@ type DeeplTranslation = {
|
|
|
401
406
|
}>;
|
|
402
407
|
};
|
|
403
408
|
|
|
404
|
-
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 ISession, 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 UpdateOnboardingStatusRequestBody, type UpdateUserRequestBody, VocabCheckType, convertJSDateStringToMySQLDate, dateDifferenceInDays, getFormattedDate, getMysqlDateIgnoreTZ, isClientDateTooFarFromServerDate, isExpired, isStringContainingInteger, isThePreviousDay, isTheSameDay, isValidJsDateString, isValidMysqlDateString, parameterReplace };
|
|
409
|
+
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 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, isExpired, isStringContainingInteger, isThePreviousDay, isTheSameDay, isValidJsDateString, isValidMysqlDateString, parameterReplace };
|
package/dist/index.d.ts
CHANGED
|
@@ -158,6 +158,10 @@ interface ILexemeIdPair {
|
|
|
158
158
|
czId: number;
|
|
159
159
|
enId: number;
|
|
160
160
|
}
|
|
161
|
+
interface ILexemePairTexts {
|
|
162
|
+
czText: string;
|
|
163
|
+
enText: string;
|
|
164
|
+
}
|
|
161
165
|
type LexemePairWithLang = {
|
|
162
166
|
czechLexeme: ILexeme;
|
|
163
167
|
englishLexeme: ILexeme;
|
|
@@ -203,17 +207,15 @@ interface IActivityCount {
|
|
|
203
207
|
}
|
|
204
208
|
|
|
205
209
|
interface IUserData {
|
|
210
|
+
googleSub: string;
|
|
206
211
|
currentStreakEnd: MySQLDate | undefined;
|
|
207
212
|
currentStreakLength: number;
|
|
208
213
|
email: string;
|
|
209
214
|
flashcardReviewCompletedCount: number;
|
|
210
|
-
googleSub: string;
|
|
211
215
|
highStreakEnd: MySQLDate | undefined;
|
|
212
216
|
highStreakLength: number;
|
|
213
217
|
lastModified: MySQLDate;
|
|
214
|
-
lastWordAdded: string;
|
|
215
218
|
learningLanguage: Language;
|
|
216
|
-
lexemePairCount: number;
|
|
217
219
|
name: string;
|
|
218
220
|
phone: string;
|
|
219
221
|
rewardPoints: number;
|
|
@@ -242,6 +244,7 @@ declare enum ApiPath {
|
|
|
242
244
|
AUTOLOGIN = "/autologin",
|
|
243
245
|
DATA_HEATMAP = "/data/heatmap/:weekCount/:endDate",
|
|
244
246
|
HEALTH = "/health",
|
|
247
|
+
LAST_WORDS_ADDED = "/lastWordsAdded",
|
|
245
248
|
LEXEMES = "/lexemes",
|
|
246
249
|
LEXEMES_ALL = "/lexemes/all",
|
|
247
250
|
LEXEMES_COUNT = "/lexemes/count/:language",
|
|
@@ -273,6 +276,7 @@ declare enum ClientPlatform {
|
|
|
273
276
|
*/
|
|
274
277
|
interface TestInitRequestBody {
|
|
275
278
|
vocabCheckType: VocabCheckType;
|
|
279
|
+
maxFlashcardDeckCount: number | null;
|
|
276
280
|
}
|
|
277
281
|
interface TestCompleteRequestBody {
|
|
278
282
|
clientDate: MySQLDate;
|
|
@@ -383,6 +387,7 @@ interface TestInitResponseData {
|
|
|
383
387
|
lexemePairs: ILexemePair[];
|
|
384
388
|
lexemeLearningInfo: ILexemeLearningInfo;
|
|
385
389
|
vocabCheckType: VocabCheckType;
|
|
390
|
+
pushedFlashcardCount?: number;
|
|
386
391
|
}
|
|
387
392
|
interface TestCompleteResponseData {
|
|
388
393
|
user: IUserData;
|
|
@@ -401,4 +406,4 @@ type DeeplTranslation = {
|
|
|
401
406
|
}>;
|
|
402
407
|
};
|
|
403
408
|
|
|
404
|
-
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 ISession, 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 UpdateOnboardingStatusRequestBody, type UpdateUserRequestBody, VocabCheckType, convertJSDateStringToMySQLDate, dateDifferenceInDays, getFormattedDate, getMysqlDateIgnoreTZ, isClientDateTooFarFromServerDate, isExpired, isStringContainingInteger, isThePreviousDay, isTheSameDay, isValidJsDateString, isValidMysqlDateString, parameterReplace };
|
|
409
|
+
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 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, isExpired, isStringContainingInteger, isThePreviousDay, isTheSameDay, isValidJsDateString, isValidMysqlDateString, parameterReplace };
|
package/dist/index.js
CHANGED
|
@@ -242,6 +242,7 @@ var ApiPath = /* @__PURE__ */ ((ApiPath2) => {
|
|
|
242
242
|
ApiPath2["AUTOLOGIN"] = "/autologin";
|
|
243
243
|
ApiPath2["DATA_HEATMAP"] = "/data/heatmap/:weekCount/:endDate";
|
|
244
244
|
ApiPath2["HEALTH"] = "/health";
|
|
245
|
+
ApiPath2["LAST_WORDS_ADDED"] = "/lastWordsAdded";
|
|
245
246
|
ApiPath2["LEXEMES"] = "/lexemes";
|
|
246
247
|
ApiPath2["LEXEMES_ALL"] = "/lexemes/all";
|
|
247
248
|
ApiPath2["LEXEMES_COUNT"] = "/lexemes/count/:language";
|
package/dist/index.mjs
CHANGED
|
@@ -192,6 +192,7 @@ var ApiPath = /* @__PURE__ */ ((ApiPath2) => {
|
|
|
192
192
|
ApiPath2["AUTOLOGIN"] = "/autologin";
|
|
193
193
|
ApiPath2["DATA_HEATMAP"] = "/data/heatmap/:weekCount/:endDate";
|
|
194
194
|
ApiPath2["HEALTH"] = "/health";
|
|
195
|
+
ApiPath2["LAST_WORDS_ADDED"] = "/lastWordsAdded";
|
|
195
196
|
ApiPath2["LEXEMES"] = "/lexemes";
|
|
196
197
|
ApiPath2["LEXEMES_ALL"] = "/lexemes/all";
|
|
197
198
|
ApiPath2["LEXEMES_COUNT"] = "/lexemes/count/:language";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "czapp-shared",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.25",
|
|
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",
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"build": "tsup src/index.ts --clean --format=cjs,esm --dts",
|
|
10
10
|
"watch": "npm run build -- --watch",
|
|
11
11
|
"test:unit": "mocha --require ts-node/register/transpile-only test/**/*.ts",
|
|
12
|
+
"yp": "yalc push",
|
|
12
13
|
"release:bump": "bumpp"
|
|
13
14
|
},
|
|
14
15
|
"repository": {
|
package/src/design/api.ts
CHANGED
|
@@ -24,6 +24,7 @@ export enum ApiPath {
|
|
|
24
24
|
AUTOLOGIN = '/autologin',
|
|
25
25
|
DATA_HEATMAP = '/data/heatmap/:weekCount/:endDate',
|
|
26
26
|
HEALTH = '/health',
|
|
27
|
+
LAST_WORDS_ADDED = '/lastWordsAdded',
|
|
27
28
|
LEXEMES = '/lexemes',
|
|
28
29
|
LEXEMES_ALL = '/lexemes/all',
|
|
29
30
|
LEXEMES_COUNT = '/lexemes/count/:language',
|
|
@@ -57,6 +58,7 @@ export enum ClientPlatform {
|
|
|
57
58
|
*/
|
|
58
59
|
export interface TestInitRequestBody {
|
|
59
60
|
vocabCheckType: VocabCheckType
|
|
61
|
+
maxFlashcardDeckCount: number | null
|
|
60
62
|
}
|
|
61
63
|
export interface TestCompleteRequestBody {
|
|
62
64
|
clientDate: MySQLDate
|
|
@@ -176,13 +178,13 @@ export interface TestInitResponseData {
|
|
|
176
178
|
lexemePairs: ILexemePair[];
|
|
177
179
|
lexemeLearningInfo: ILexemeLearningInfo;
|
|
178
180
|
vocabCheckType: VocabCheckType;
|
|
181
|
+
pushedFlashcardCount?: number;
|
|
179
182
|
}
|
|
180
183
|
export interface TestCompleteResponseData {
|
|
181
184
|
user: IUserData;
|
|
182
185
|
testResultIds: number[];
|
|
183
186
|
rewardPointsDelta: number;
|
|
184
187
|
}
|
|
185
|
-
|
|
186
188
|
export interface HeatMapResponseData {
|
|
187
189
|
added: IActivityCount[];
|
|
188
190
|
tested: IActivityCount[];
|
package/src/design/lexemes.ts
CHANGED
package/src/design/user.ts
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import { Language, MySQLDate } from './types';
|
|
2
2
|
|
|
3
3
|
export interface IUserData {
|
|
4
|
+
googleSub: string,
|
|
4
5
|
currentStreakEnd: MySQLDate | undefined,
|
|
5
6
|
currentStreakLength: number,
|
|
6
7
|
email: string,
|
|
7
8
|
flashcardReviewCompletedCount: number,
|
|
8
|
-
googleSub: string,
|
|
9
9
|
highStreakEnd: MySQLDate | undefined,
|
|
10
10
|
highStreakLength: number,
|
|
11
11
|
lastModified: MySQLDate,
|
|
12
|
-
lastWordAdded: string,
|
|
13
12
|
learningLanguage: Language,
|
|
14
|
-
lexemePairCount: number,
|
|
15
13
|
name: string,
|
|
16
14
|
phone: string,
|
|
17
15
|
rewardPoints: number,
|