czapp-shared 1.0.11 → 1.0.12

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
@@ -247,6 +242,11 @@ declare enum ApiPath {
247
242
  USER = "/user",
248
243
  USER_RESET_TEST = "/user/test/reset/:flashcardReviewCompletedCount/:currentStreakEnd"
249
244
  }
245
+ declare enum ClientPlatform {
246
+ IOS = "ios",
247
+ ANDROID = "android",
248
+ WEB = "web"
249
+ }
250
250
  /**
251
251
  * Request payloads
252
252
  */
@@ -363,4 +363,4 @@ type DeeplTranslation = {
363
363
  }>;
364
364
  };
365
365
 
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 };
366
+ 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
@@ -247,6 +242,11 @@ declare enum ApiPath {
247
242
  USER = "/user",
248
243
  USER_RESET_TEST = "/user/test/reset/:flashcardReviewCompletedCount/:currentStreakEnd"
249
244
  }
245
+ declare enum ClientPlatform {
246
+ IOS = "ios",
247
+ ANDROID = "android",
248
+ WEB = "web"
249
+ }
250
250
  /**
251
251
  * Request payloads
252
252
  */
@@ -363,4 +363,4 @@ type DeeplTranslation = {
363
363
  }>;
364
364
  };
365
365
 
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 };
366
+ 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 {
@@ -259,11 +253,18 @@ var ApiPath = /* @__PURE__ */ ((ApiPath2) => {
259
253
  ApiPath2["USER_RESET_TEST"] = "/user/test/reset/:flashcardReviewCompletedCount/:currentStreakEnd";
260
254
  return ApiPath2;
261
255
  })(ApiPath || {});
256
+ var ClientPlatform = /* @__PURE__ */ ((ClientPlatform2) => {
257
+ ClientPlatform2["IOS"] = "ios";
258
+ ClientPlatform2["ANDROID"] = "android";
259
+ ClientPlatform2["WEB"] = "web";
260
+ return ClientPlatform2;
261
+ })(ClientPlatform || {});
262
262
  // Annotate the CommonJS export names for ESM import in node:
263
263
  0 && (module.exports = {
264
264
  ApiMethod,
265
265
  ApiPath,
266
266
  AppError,
267
+ ClientPlatform,
267
268
  Familiarity,
268
269
  HttpStatusCode,
269
270
  Language,
@@ -277,7 +278,6 @@ var ApiPath = /* @__PURE__ */ ((ApiPath2) => {
277
278
  convertJSDateStringToMySQLDate,
278
279
  dateDifferenceInDays,
279
280
  getFormattedDate,
280
- getMysqlDateAllowingForTZ,
281
281
  getMysqlDateIgnoreTZ,
282
282
  isClientDateTooFarFromServerDate,
283
283
  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 {
@@ -210,10 +204,17 @@ var ApiPath = /* @__PURE__ */ ((ApiPath2) => {
210
204
  ApiPath2["USER_RESET_TEST"] = "/user/test/reset/:flashcardReviewCompletedCount/:currentStreakEnd";
211
205
  return ApiPath2;
212
206
  })(ApiPath || {});
207
+ var ClientPlatform = /* @__PURE__ */ ((ClientPlatform2) => {
208
+ ClientPlatform2["IOS"] = "ios";
209
+ ClientPlatform2["ANDROID"] = "android";
210
+ ClientPlatform2["WEB"] = "web";
211
+ return ClientPlatform2;
212
+ })(ClientPlatform || {});
213
213
  export {
214
214
  ApiMethod,
215
215
  ApiPath,
216
216
  AppError,
217
+ ClientPlatform,
217
218
  Familiarity,
218
219
  HttpStatusCode,
219
220
  Language,
@@ -227,7 +228,6 @@ export {
227
228
  convertJSDateStringToMySQLDate,
228
229
  dateDifferenceInDays,
229
230
  getFormattedDate,
230
- getMysqlDateAllowingForTZ,
231
231
  getMysqlDateIgnoreTZ,
232
232
  isClientDateTooFarFromServerDate,
233
233
  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.12",
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
@@ -41,6 +41,11 @@ export enum ApiPath {
41
41
  USER_RESET_TEST = '/user/test/reset/:flashcardReviewCompletedCount/:currentStreakEnd',
42
42
  }
43
43
 
44
+ export enum ClientPlatform {
45
+ IOS = 'ios',
46
+ ANDROID = 'android',
47
+ WEB = 'web'
48
+ }
44
49
 
45
50
  /**
46
51
  * Request payloads