czapp-shared 1.0.11 → 1.0.13

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
@@ -6,11 +6,6 @@
6
6
  * @returns MySQLDate in the format "2021-01-01 07:41:23" or undefined if the input date is invalid
7
7
  */
8
8
  declare const getMysqlDateIgnoreTZ: (date: Date) => MySQLDate | undefined;
9
- /**
10
- * @name getMysqlDateAllowingForTZ
11
- * @param date
12
- */
13
- declare const getMysqlDateAllowingForTZ: (date: Date) => MySQLDate;
14
9
  /**
15
10
  * @name convertJSDateStringToMySQLDate
16
11
  * @description Converts a JavaScript Date object to a MySQL date string
@@ -237,6 +232,7 @@ declare enum ApiPath {
237
232
  LEXEME_PAIR = "/lexemePair/:czId/:enId",
238
233
  LEXEME_PAIRS_BY_TEXT = "/lexemePairsByText/:inputText/:inputLang",
239
234
  LEXEME_PAIR_FAMILIARITY = "/lexemePair/:czId/:enId/:familiarity",
235
+ LEXEME_PAIR_COUNT = "/lexemePairCount",
240
236
  SIGN_IN = "/signIn",
241
237
  SIGN_OUT = "/signOut",
242
238
  TEST_COMPLETE = "/test/complete",
@@ -247,6 +243,11 @@ declare enum ApiPath {
247
243
  USER = "/user",
248
244
  USER_RESET_TEST = "/user/test/reset/:flashcardReviewCompletedCount/:currentStreakEnd"
249
245
  }
246
+ declare enum ClientPlatform {
247
+ IOS = "ios",
248
+ ANDROID = "android",
249
+ WEB = "web"
250
+ }
250
251
  /**
251
252
  * Request payloads
252
253
  */
@@ -363,4 +364,4 @@ type DeeplTranslation = {
363
364
  }>;
364
365
  };
365
366
 
366
- 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 };
367
+ 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, 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 };
package/dist/index.d.ts CHANGED
@@ -6,11 +6,6 @@
6
6
  * @returns MySQLDate in the format "2021-01-01 07:41:23" or undefined if the input date is invalid
7
7
  */
8
8
  declare const getMysqlDateIgnoreTZ: (date: Date) => MySQLDate | undefined;
9
- /**
10
- * @name getMysqlDateAllowingForTZ
11
- * @param date
12
- */
13
- declare const getMysqlDateAllowingForTZ: (date: Date) => MySQLDate;
14
9
  /**
15
10
  * @name convertJSDateStringToMySQLDate
16
11
  * @description Converts a JavaScript Date object to a MySQL date string
@@ -237,6 +232,7 @@ declare enum ApiPath {
237
232
  LEXEME_PAIR = "/lexemePair/:czId/:enId",
238
233
  LEXEME_PAIRS_BY_TEXT = "/lexemePairsByText/:inputText/:inputLang",
239
234
  LEXEME_PAIR_FAMILIARITY = "/lexemePair/:czId/:enId/:familiarity",
235
+ LEXEME_PAIR_COUNT = "/lexemePairCount",
240
236
  SIGN_IN = "/signIn",
241
237
  SIGN_OUT = "/signOut",
242
238
  TEST_COMPLETE = "/test/complete",
@@ -247,6 +243,11 @@ declare enum ApiPath {
247
243
  USER = "/user",
248
244
  USER_RESET_TEST = "/user/test/reset/:flashcardReviewCompletedCount/:currentStreakEnd"
249
245
  }
246
+ declare enum ClientPlatform {
247
+ IOS = "ios",
248
+ ANDROID = "android",
249
+ WEB = "web"
250
+ }
250
251
  /**
251
252
  * Request payloads
252
253
  */
@@ -363,4 +364,4 @@ type DeeplTranslation = {
363
364
  }>;
364
365
  };
365
366
 
366
- 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 };
367
+ 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, 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 };
package/dist/index.js CHANGED
@@ -22,6 +22,7 @@ __export(src_exports, {
22
22
  ApiMethod: () => ApiMethod,
23
23
  ApiPath: () => ApiPath,
24
24
  AppError: () => AppError,
25
+ ClientPlatform: () => ClientPlatform,
25
26
  Familiarity: () => Familiarity,
26
27
  HttpStatusCode: () => HttpStatusCode,
27
28
  Language: () => Language,
@@ -35,7 +36,6 @@ __export(src_exports, {
35
36
  convertJSDateStringToMySQLDate: () => convertJSDateStringToMySQLDate,
36
37
  dateDifferenceInDays: () => dateDifferenceInDays,
37
38
  getFormattedDate: () => getFormattedDate,
38
- getMysqlDateAllowingForTZ: () => getMysqlDateAllowingForTZ,
39
39
  getMysqlDateIgnoreTZ: () => getMysqlDateIgnoreTZ,
40
40
  isClientDateTooFarFromServerDate: () => isClientDateTooFarFromServerDate,
41
41
  isStringContainingInteger: () => isStringContainingInteger,
@@ -61,12 +61,6 @@ var getMysqlDateIgnoreTZ = (date) => {
61
61
  return dateStr;
62
62
  }
63
63
  };
64
- var getMysqlDateAllowingForTZ = (date) => {
65
- const zeroPad = (num) => {
66
- return num < 10 ? `0${num}` : num.toString();
67
- };
68
- return `${date.getFullYear()}-${zeroPad(date.getMonth() + 1)}-${zeroPad(date.getDate())} ${zeroPad(date.getHours())}:${zeroPad(date.getMinutes())}:${zeroPad(date.getSeconds())}`;
69
- };
70
64
  var convertJSDateStringToMySQLDate = (date) => {
71
65
  let dateStr;
72
66
  try {
@@ -248,6 +242,7 @@ var ApiPath = /* @__PURE__ */ ((ApiPath2) => {
248
242
  ApiPath2["LEXEME_PAIR"] = "/lexemePair/:czId/:enId";
249
243
  ApiPath2["LEXEME_PAIRS_BY_TEXT"] = "/lexemePairsByText/:inputText/:inputLang";
250
244
  ApiPath2["LEXEME_PAIR_FAMILIARITY"] = "/lexemePair/:czId/:enId/:familiarity";
245
+ ApiPath2["LEXEME_PAIR_COUNT"] = "/lexemePairCount";
251
246
  ApiPath2["SIGN_IN"] = "/signIn";
252
247
  ApiPath2["SIGN_OUT"] = "/signOut";
253
248
  ApiPath2["TEST_COMPLETE"] = "/test/complete";
@@ -259,11 +254,18 @@ var ApiPath = /* @__PURE__ */ ((ApiPath2) => {
259
254
  ApiPath2["USER_RESET_TEST"] = "/user/test/reset/:flashcardReviewCompletedCount/:currentStreakEnd";
260
255
  return ApiPath2;
261
256
  })(ApiPath || {});
257
+ var ClientPlatform = /* @__PURE__ */ ((ClientPlatform2) => {
258
+ ClientPlatform2["IOS"] = "ios";
259
+ ClientPlatform2["ANDROID"] = "android";
260
+ ClientPlatform2["WEB"] = "web";
261
+ return ClientPlatform2;
262
+ })(ClientPlatform || {});
262
263
  // Annotate the CommonJS export names for ESM import in node:
263
264
  0 && (module.exports = {
264
265
  ApiMethod,
265
266
  ApiPath,
266
267
  AppError,
268
+ ClientPlatform,
267
269
  Familiarity,
268
270
  HttpStatusCode,
269
271
  Language,
@@ -277,7 +279,6 @@ var ApiPath = /* @__PURE__ */ ((ApiPath2) => {
277
279
  convertJSDateStringToMySQLDate,
278
280
  dateDifferenceInDays,
279
281
  getFormattedDate,
280
- getMysqlDateAllowingForTZ,
281
282
  getMysqlDateIgnoreTZ,
282
283
  isClientDateTooFarFromServerDate,
283
284
  isStringContainingInteger,
package/dist/index.mjs CHANGED
@@ -12,12 +12,6 @@ var getMysqlDateIgnoreTZ = (date) => {
12
12
  return dateStr;
13
13
  }
14
14
  };
15
- var getMysqlDateAllowingForTZ = (date) => {
16
- const zeroPad = (num) => {
17
- return num < 10 ? `0${num}` : num.toString();
18
- };
19
- return `${date.getFullYear()}-${zeroPad(date.getMonth() + 1)}-${zeroPad(date.getDate())} ${zeroPad(date.getHours())}:${zeroPad(date.getMinutes())}:${zeroPad(date.getSeconds())}`;
20
- };
21
15
  var convertJSDateStringToMySQLDate = (date) => {
22
16
  let dateStr;
23
17
  try {
@@ -199,6 +193,7 @@ var ApiPath = /* @__PURE__ */ ((ApiPath2) => {
199
193
  ApiPath2["LEXEME_PAIR"] = "/lexemePair/:czId/:enId";
200
194
  ApiPath2["LEXEME_PAIRS_BY_TEXT"] = "/lexemePairsByText/:inputText/:inputLang";
201
195
  ApiPath2["LEXEME_PAIR_FAMILIARITY"] = "/lexemePair/:czId/:enId/:familiarity";
196
+ ApiPath2["LEXEME_PAIR_COUNT"] = "/lexemePairCount";
202
197
  ApiPath2["SIGN_IN"] = "/signIn";
203
198
  ApiPath2["SIGN_OUT"] = "/signOut";
204
199
  ApiPath2["TEST_COMPLETE"] = "/test/complete";
@@ -210,10 +205,17 @@ var ApiPath = /* @__PURE__ */ ((ApiPath2) => {
210
205
  ApiPath2["USER_RESET_TEST"] = "/user/test/reset/:flashcardReviewCompletedCount/:currentStreakEnd";
211
206
  return ApiPath2;
212
207
  })(ApiPath || {});
208
+ var ClientPlatform = /* @__PURE__ */ ((ClientPlatform2) => {
209
+ ClientPlatform2["IOS"] = "ios";
210
+ ClientPlatform2["ANDROID"] = "android";
211
+ ClientPlatform2["WEB"] = "web";
212
+ return ClientPlatform2;
213
+ })(ClientPlatform || {});
213
214
  export {
214
215
  ApiMethod,
215
216
  ApiPath,
216
217
  AppError,
218
+ ClientPlatform,
217
219
  Familiarity,
218
220
  HttpStatusCode,
219
221
  Language,
@@ -227,7 +229,6 @@ export {
227
229
  convertJSDateStringToMySQLDate,
228
230
  dateDifferenceInDays,
229
231
  getFormattedDate,
230
- getMysqlDateAllowingForTZ,
231
232
  getMysqlDateIgnoreTZ,
232
233
  isClientDateTooFarFromServerDate,
233
234
  isStringContainingInteger,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "czapp-shared",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
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
@@ -30,6 +30,7 @@ export enum ApiPath {
30
30
  LEXEME_PAIR = '/lexemePair/:czId/:enId',
31
31
  LEXEME_PAIRS_BY_TEXT = '/lexemePairsByText/:inputText/:inputLang',
32
32
  LEXEME_PAIR_FAMILIARITY = '/lexemePair/:czId/:enId/:familiarity',
33
+ LEXEME_PAIR_COUNT = '/lexemePairCount',
33
34
  SIGN_IN = '/signIn',
34
35
  SIGN_OUT = '/signOut',
35
36
  TEST_COMPLETE = '/test/complete',
@@ -41,6 +42,11 @@ export enum ApiPath {
41
42
  USER_RESET_TEST = '/user/test/reset/:flashcardReviewCompletedCount/:currentStreakEnd',
42
43
  }
43
44
 
45
+ export enum ClientPlatform {
46
+ IOS = 'ios',
47
+ ANDROID = 'android',
48
+ WEB = 'web'
49
+ }
44
50
 
45
51
  /**
46
52
  * Request payloads