czapp-shared 1.0.16 → 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 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",
@@ -187,6 +188,19 @@ declare class LexemePair implements ILexemePair {
187
188
  declare const isStringContainingInteger: (str: any) => boolean;
188
189
  declare const parameterReplace: (path: string, params?: string[]) => string;
189
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
+
190
204
  interface IUserData {
191
205
  currentStreakEnd: MySQLDate | undefined;
192
206
  currentStreakLength: number;
@@ -225,6 +239,7 @@ declare enum ApiMethod {
225
239
  }
226
240
  declare enum ApiPath {
227
241
  AUTOLOGIN = "/autologin",
242
+ DATA_HEATMAP = "/data/heatmap/:weekCount/:endDate",
228
243
  HEALTH = "/health",
229
244
  LEXEMES = "/lexemes",
230
245
  LEXEMES_ALL = "/lexemes/all",
@@ -335,6 +350,10 @@ interface ResetTestUserParams {
335
350
  flashcardReviewCompletedCount: number;
336
351
  currentStreakEnd: MySQLDate;
337
352
  }
353
+ interface HeatMapParams {
354
+ weekCount: number;
355
+ endDate: DateString;
356
+ }
338
357
  /**
339
358
  * Response payloads
340
359
  */
@@ -368,6 +387,11 @@ interface TestCompleteResponseData {
368
387
  testResultIds: number[];
369
388
  rewardPointsDelta: number;
370
389
  }
390
+ interface HeatMapResponseData {
391
+ added: IAddedData[];
392
+ tested: ITestedData[];
393
+ reviewed: IReviewedData[];
394
+ }
371
395
  type DeeplTranslation = {
372
396
  detectedSourceLanguage: Language;
373
397
  translations: Array<{
@@ -375,4 +399,4 @@ type DeeplTranslation = {
375
399
  }>;
376
400
  };
377
401
 
378
- 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 UpdateOnboardingStatusRequestBody, 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",
@@ -187,6 +188,19 @@ declare class LexemePair implements ILexemePair {
187
188
  declare const isStringContainingInteger: (str: any) => boolean;
188
189
  declare const parameterReplace: (path: string, params?: string[]) => string;
189
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
+
190
204
  interface IUserData {
191
205
  currentStreakEnd: MySQLDate | undefined;
192
206
  currentStreakLength: number;
@@ -225,6 +239,7 @@ declare enum ApiMethod {
225
239
  }
226
240
  declare enum ApiPath {
227
241
  AUTOLOGIN = "/autologin",
242
+ DATA_HEATMAP = "/data/heatmap/:weekCount/:endDate",
228
243
  HEALTH = "/health",
229
244
  LEXEMES = "/lexemes",
230
245
  LEXEMES_ALL = "/lexemes/all",
@@ -335,6 +350,10 @@ interface ResetTestUserParams {
335
350
  flashcardReviewCompletedCount: number;
336
351
  currentStreakEnd: MySQLDate;
337
352
  }
353
+ interface HeatMapParams {
354
+ weekCount: number;
355
+ endDate: DateString;
356
+ }
338
357
  /**
339
358
  * Response payloads
340
359
  */
@@ -368,6 +387,11 @@ interface TestCompleteResponseData {
368
387
  testResultIds: number[];
369
388
  rewardPointsDelta: number;
370
389
  }
390
+ interface HeatMapResponseData {
391
+ added: IAddedData[];
392
+ tested: ITestedData[];
393
+ reviewed: IReviewedData[];
394
+ }
371
395
  type DeeplTranslation = {
372
396
  detectedSourceLanguage: Language;
373
397
  translations: Array<{
@@ -375,4 +399,4 @@ type DeeplTranslation = {
375
399
  }>;
376
400
  };
377
401
 
378
- 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 UpdateOnboardingStatusRequestBody, 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
@@ -234,6 +234,7 @@ var ApiMethod = /* @__PURE__ */ ((ApiMethod2) => {
234
234
  })(ApiMethod || {});
235
235
  var ApiPath = /* @__PURE__ */ ((ApiPath2) => {
236
236
  ApiPath2["AUTOLOGIN"] = "/autologin";
237
+ ApiPath2["DATA_HEATMAP"] = "/data/heatmap/:weekCount/:endDate";
237
238
  ApiPath2["HEALTH"] = "/health";
238
239
  ApiPath2["LEXEMES"] = "/lexemes";
239
240
  ApiPath2["LEXEMES_ALL"] = "/lexemes/all";
package/dist/index.mjs CHANGED
@@ -185,6 +185,7 @@ var ApiMethod = /* @__PURE__ */ ((ApiMethod2) => {
185
185
  })(ApiMethod || {});
186
186
  var ApiPath = /* @__PURE__ */ ((ApiPath2) => {
187
187
  ApiPath2["AUTOLOGIN"] = "/autologin";
188
+ ApiPath2["DATA_HEATMAP"] = "/data/heatmap/:weekCount/:endDate";
188
189
  ApiPath2["HEALTH"] = "/health";
189
190
  ApiPath2["LEXEMES"] = "/lexemes";
190
191
  ApiPath2["LEXEMES_ALL"] = "/lexemes/all";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "czapp-shared",
3
- "version": "1.0.16",
3
+ "version": "1.0.17",
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
@@ -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',
@@ -135,7 +137,10 @@ export interface ResetTestUserParams {
135
137
  flashcardReviewCompletedCount: number;
136
138
  currentStreakEnd: MySQLDate;
137
139
  }
138
-
140
+ export interface HeatMapParams {
141
+ weekCount: number;
142
+ endDate: DateString;
143
+ }
139
144
 
140
145
 
141
146
  /**
@@ -177,6 +182,12 @@ export interface TestCompleteResponseData {
177
182
  rewardPointsDelta: number;
178
183
  }
179
184
 
185
+ export interface HeatMapResponseData {
186
+ added: IAddedData[];
187
+ tested: ITestedData[];
188
+ reviewed: IReviewedData[];
189
+ }
190
+
180
191
  // other
181
192
  export type DeeplTranslation = {
182
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
+
@@ -41,6 +41,3 @@ export interface ILexemeLearningInfo {
41
41
  learningCount: number;
42
42
  retiredCount: number;
43
43
  }
44
-
45
-
46
-
@@ -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",
package/src/index.ts CHANGED
@@ -6,3 +6,4 @@ export * from './design/api';
6
6
  export * from './design/lexemes';
7
7
  export * from './design/types';
8
8
  export * from './design/user';
9
+ export * from './design/data';