czapp-shared 1.0.36 → 1.0.38
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 +20 -1
- package/dist/index.d.ts +20 -1
- package/dist/index.js +2 -0
- package/dist/index.mjs +2 -0
- package/package.json +1 -1
- package/src/design/api.ts +6 -0
- package/src/design/types.ts +15 -0
package/dist/index.d.mts
CHANGED
|
@@ -118,6 +118,18 @@ interface IProgressHistoryDay {
|
|
|
118
118
|
learningCount: number;
|
|
119
119
|
retiredCount: number;
|
|
120
120
|
}
|
|
121
|
+
/**
|
|
122
|
+
* One row of the reward points leaderboard. position is the user's 1-based rank across all users, ordered by
|
|
123
|
+
* rewardPoints, then highStreakLength, then sign-up order. name is the first name plus surname initial, never the
|
|
124
|
+
* full name.
|
|
125
|
+
*/
|
|
126
|
+
interface ILeaderboardEntry {
|
|
127
|
+
position: number;
|
|
128
|
+
name: string;
|
|
129
|
+
rewardPoints: number;
|
|
130
|
+
highStreakLength: number;
|
|
131
|
+
isCurrentUser: boolean;
|
|
132
|
+
}
|
|
121
133
|
type MySQLDate = `${number}-${number}-${number} ${number}:${number}:${number}`;
|
|
122
134
|
type DateString = `${number}-${string}-${string}`;
|
|
123
135
|
declare enum ReminderFrequency {
|
|
@@ -140,6 +152,7 @@ declare enum AppError {
|
|
|
140
152
|
REQUEST_RECYCLE_LEXEME_PAIR_FAILED = "Failed to recycle lexeme pair",
|
|
141
153
|
REQUEST_TRANSLATION_FAILED = "Failed to get translation",
|
|
142
154
|
REQUEST_TEST_COMPLETE_FAILED = "Failed to complete test",
|
|
155
|
+
REQUEST_TEST_COMPLETE_QUEUED = "Your results couldn't be saved right now. They're stored on this device and will be sent automatically once the connection is back.",
|
|
143
156
|
REQUEST_TEST_SKIP_FAILED = "Failed to skip to the next deck"
|
|
144
157
|
}
|
|
145
158
|
declare enum Scenario {
|
|
@@ -290,6 +303,7 @@ declare enum ApiPath {
|
|
|
290
303
|
DATA_HEATMAP = "/data/heatmap/:weekCount/:endDate",
|
|
291
304
|
HEALTH = "/health",
|
|
292
305
|
LAST_WORDS_ADDED = "/lastWordsAdded",
|
|
306
|
+
LEADERBOARD = "/leaderboard",
|
|
293
307
|
LEXEMES = "/lexemes",
|
|
294
308
|
LEXEMES_ALL = "/lexemes/all",
|
|
295
309
|
LEXEMES_COUNT = "/lexemes/count/:language",
|
|
@@ -331,6 +345,11 @@ interface TestCompleteRequestBody {
|
|
|
331
345
|
clientDate: MySQLDate;
|
|
332
346
|
results: ITestResult[];
|
|
333
347
|
vocabCheckType: VocabCheckType;
|
|
348
|
+
/**
|
|
349
|
+
* Client-generated idempotency key ([A-Za-z0-9-]{1,64}). Clients that re-send a failed completion send the same id
|
|
350
|
+
* each time so the server applies it only once. Optional - completions without one are never deduplicated.
|
|
351
|
+
*/
|
|
352
|
+
completionId?: string;
|
|
334
353
|
}
|
|
335
354
|
interface TranslationRequestBody {
|
|
336
355
|
q: string;
|
|
@@ -470,4 +489,4 @@ type DeeplTranslation = {
|
|
|
470
489
|
}>;
|
|
471
490
|
};
|
|
472
491
|
|
|
473
|
-
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 IProgressHistoryDay, type ISession, type ITestResult, type IUserData, type IVocabCheckActivity, type InsertOrUpdateRequestBody, type InsertOrUpdateResponseData, LEARNING_STAGES_IN_GROUP, Language, LearningStage, LearningStageGroup, Lexeme, LexemePair, type LexemePairRequestBody, type LexemePairWithLang, type MySQLDate, Progress, type RecycleLexemePairParams, type RegisterPushTokenRequestBody, ReminderFrequency, type ResetTestUserParams, type Result, Scenario, type SelectAllTranslationsParams, type SelectLexemeCountParams, type SelectLexemePairParams, type SelectLexemePairsByTextParams, type SelectLexemesParams, type SelectProgressHistoryParams, type SelectTestLexemesParams, type SelectVocabCheckActivityParams, type SignInRequestBody, type SignInResponseData, type Streaks, type TestCompleteRequestBody, type TestCompleteResponseData, type TestInitRequestBody, type TestInitResponseData, type TranslationRequestBody, type TranslationResponseData, type UpdateLexemePairFamiliarityParams, type UpdateOnboardingStatusRequestBody, type UpdateUserRequestBody, VocabCheckType, convertJSDateStringToMySQLDate, dateDifferenceInDays, deriveStreakFromVocabCheckActivity, getFormattedDate, getMysqlDateIgnoreTZ, isClientDateTooFarFromServerDate, isExpired, isFinalTest, isLearningStageGroup, isStringContainingInteger, isThePreviousDay, isTheSameDay, isValidJsDateString, isValidMysqlDateString, parameterReplace };
|
|
492
|
+
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 ILeaderboardEntry, type ILexeme, type ILexemeIdPair, type ILexemeLearningInfo, type ILexemePair, type ILexemePairTexts, type IProgressHistoryDay, type ISession, type ITestResult, type IUserData, type IVocabCheckActivity, type InsertOrUpdateRequestBody, type InsertOrUpdateResponseData, LEARNING_STAGES_IN_GROUP, Language, LearningStage, LearningStageGroup, Lexeme, LexemePair, type LexemePairRequestBody, type LexemePairWithLang, type MySQLDate, Progress, type RecycleLexemePairParams, type RegisterPushTokenRequestBody, ReminderFrequency, type ResetTestUserParams, type Result, Scenario, type SelectAllTranslationsParams, type SelectLexemeCountParams, type SelectLexemePairParams, type SelectLexemePairsByTextParams, type SelectLexemesParams, type SelectProgressHistoryParams, type SelectTestLexemesParams, type SelectVocabCheckActivityParams, type SignInRequestBody, type SignInResponseData, type Streaks, type TestCompleteRequestBody, type TestCompleteResponseData, type TestInitRequestBody, type TestInitResponseData, type TranslationRequestBody, type TranslationResponseData, type UpdateLexemePairFamiliarityParams, type UpdateOnboardingStatusRequestBody, type UpdateUserRequestBody, VocabCheckType, convertJSDateStringToMySQLDate, dateDifferenceInDays, deriveStreakFromVocabCheckActivity, getFormattedDate, getMysqlDateIgnoreTZ, isClientDateTooFarFromServerDate, isExpired, isFinalTest, isLearningStageGroup, isStringContainingInteger, isThePreviousDay, isTheSameDay, isValidJsDateString, isValidMysqlDateString, parameterReplace };
|
package/dist/index.d.ts
CHANGED
|
@@ -118,6 +118,18 @@ interface IProgressHistoryDay {
|
|
|
118
118
|
learningCount: number;
|
|
119
119
|
retiredCount: number;
|
|
120
120
|
}
|
|
121
|
+
/**
|
|
122
|
+
* One row of the reward points leaderboard. position is the user's 1-based rank across all users, ordered by
|
|
123
|
+
* rewardPoints, then highStreakLength, then sign-up order. name is the first name plus surname initial, never the
|
|
124
|
+
* full name.
|
|
125
|
+
*/
|
|
126
|
+
interface ILeaderboardEntry {
|
|
127
|
+
position: number;
|
|
128
|
+
name: string;
|
|
129
|
+
rewardPoints: number;
|
|
130
|
+
highStreakLength: number;
|
|
131
|
+
isCurrentUser: boolean;
|
|
132
|
+
}
|
|
121
133
|
type MySQLDate = `${number}-${number}-${number} ${number}:${number}:${number}`;
|
|
122
134
|
type DateString = `${number}-${string}-${string}`;
|
|
123
135
|
declare enum ReminderFrequency {
|
|
@@ -140,6 +152,7 @@ declare enum AppError {
|
|
|
140
152
|
REQUEST_RECYCLE_LEXEME_PAIR_FAILED = "Failed to recycle lexeme pair",
|
|
141
153
|
REQUEST_TRANSLATION_FAILED = "Failed to get translation",
|
|
142
154
|
REQUEST_TEST_COMPLETE_FAILED = "Failed to complete test",
|
|
155
|
+
REQUEST_TEST_COMPLETE_QUEUED = "Your results couldn't be saved right now. They're stored on this device and will be sent automatically once the connection is back.",
|
|
143
156
|
REQUEST_TEST_SKIP_FAILED = "Failed to skip to the next deck"
|
|
144
157
|
}
|
|
145
158
|
declare enum Scenario {
|
|
@@ -290,6 +303,7 @@ declare enum ApiPath {
|
|
|
290
303
|
DATA_HEATMAP = "/data/heatmap/:weekCount/:endDate",
|
|
291
304
|
HEALTH = "/health",
|
|
292
305
|
LAST_WORDS_ADDED = "/lastWordsAdded",
|
|
306
|
+
LEADERBOARD = "/leaderboard",
|
|
293
307
|
LEXEMES = "/lexemes",
|
|
294
308
|
LEXEMES_ALL = "/lexemes/all",
|
|
295
309
|
LEXEMES_COUNT = "/lexemes/count/:language",
|
|
@@ -331,6 +345,11 @@ interface TestCompleteRequestBody {
|
|
|
331
345
|
clientDate: MySQLDate;
|
|
332
346
|
results: ITestResult[];
|
|
333
347
|
vocabCheckType: VocabCheckType;
|
|
348
|
+
/**
|
|
349
|
+
* Client-generated idempotency key ([A-Za-z0-9-]{1,64}). Clients that re-send a failed completion send the same id
|
|
350
|
+
* each time so the server applies it only once. Optional - completions without one are never deduplicated.
|
|
351
|
+
*/
|
|
352
|
+
completionId?: string;
|
|
334
353
|
}
|
|
335
354
|
interface TranslationRequestBody {
|
|
336
355
|
q: string;
|
|
@@ -470,4 +489,4 @@ type DeeplTranslation = {
|
|
|
470
489
|
}>;
|
|
471
490
|
};
|
|
472
491
|
|
|
473
|
-
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 IProgressHistoryDay, type ISession, type ITestResult, type IUserData, type IVocabCheckActivity, type InsertOrUpdateRequestBody, type InsertOrUpdateResponseData, LEARNING_STAGES_IN_GROUP, Language, LearningStage, LearningStageGroup, Lexeme, LexemePair, type LexemePairRequestBody, type LexemePairWithLang, type MySQLDate, Progress, type RecycleLexemePairParams, type RegisterPushTokenRequestBody, ReminderFrequency, type ResetTestUserParams, type Result, Scenario, type SelectAllTranslationsParams, type SelectLexemeCountParams, type SelectLexemePairParams, type SelectLexemePairsByTextParams, type SelectLexemesParams, type SelectProgressHistoryParams, type SelectTestLexemesParams, type SelectVocabCheckActivityParams, type SignInRequestBody, type SignInResponseData, type Streaks, type TestCompleteRequestBody, type TestCompleteResponseData, type TestInitRequestBody, type TestInitResponseData, type TranslationRequestBody, type TranslationResponseData, type UpdateLexemePairFamiliarityParams, type UpdateOnboardingStatusRequestBody, type UpdateUserRequestBody, VocabCheckType, convertJSDateStringToMySQLDate, dateDifferenceInDays, deriveStreakFromVocabCheckActivity, getFormattedDate, getMysqlDateIgnoreTZ, isClientDateTooFarFromServerDate, isExpired, isFinalTest, isLearningStageGroup, isStringContainingInteger, isThePreviousDay, isTheSameDay, isValidJsDateString, isValidMysqlDateString, parameterReplace };
|
|
492
|
+
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 ILeaderboardEntry, type ILexeme, type ILexemeIdPair, type ILexemeLearningInfo, type ILexemePair, type ILexemePairTexts, type IProgressHistoryDay, type ISession, type ITestResult, type IUserData, type IVocabCheckActivity, type InsertOrUpdateRequestBody, type InsertOrUpdateResponseData, LEARNING_STAGES_IN_GROUP, Language, LearningStage, LearningStageGroup, Lexeme, LexemePair, type LexemePairRequestBody, type LexemePairWithLang, type MySQLDate, Progress, type RecycleLexemePairParams, type RegisterPushTokenRequestBody, ReminderFrequency, type ResetTestUserParams, type Result, Scenario, type SelectAllTranslationsParams, type SelectLexemeCountParams, type SelectLexemePairParams, type SelectLexemePairsByTextParams, type SelectLexemesParams, type SelectProgressHistoryParams, type SelectTestLexemesParams, type SelectVocabCheckActivityParams, type SignInRequestBody, type SignInResponseData, type Streaks, type TestCompleteRequestBody, type TestCompleteResponseData, type TestInitRequestBody, type TestInitResponseData, type TranslationRequestBody, type TranslationResponseData, type UpdateLexemePairFamiliarityParams, type UpdateOnboardingStatusRequestBody, type UpdateUserRequestBody, VocabCheckType, convertJSDateStringToMySQLDate, dateDifferenceInDays, deriveStreakFromVocabCheckActivity, getFormattedDate, getMysqlDateIgnoreTZ, isClientDateTooFarFromServerDate, isExpired, isFinalTest, isLearningStageGroup, isStringContainingInteger, isThePreviousDay, isTheSameDay, isValidJsDateString, isValidMysqlDateString, parameterReplace };
|
package/dist/index.js
CHANGED
|
@@ -180,6 +180,7 @@ var AppError = /* @__PURE__ */ ((AppError2) => {
|
|
|
180
180
|
AppError2["REQUEST_RECYCLE_LEXEME_PAIR_FAILED"] = "Failed to recycle lexeme pair";
|
|
181
181
|
AppError2["REQUEST_TRANSLATION_FAILED"] = "Failed to get translation";
|
|
182
182
|
AppError2["REQUEST_TEST_COMPLETE_FAILED"] = "Failed to complete test";
|
|
183
|
+
AppError2["REQUEST_TEST_COMPLETE_QUEUED"] = "Your results couldn't be saved right now. They're stored on this device and will be sent automatically once the connection is back.";
|
|
183
184
|
AppError2["REQUEST_TEST_SKIP_FAILED"] = "Failed to skip to the next deck";
|
|
184
185
|
return AppError2;
|
|
185
186
|
})(AppError || {});
|
|
@@ -310,6 +311,7 @@ var ApiPath = /* @__PURE__ */ ((ApiPath2) => {
|
|
|
310
311
|
ApiPath2["DATA_HEATMAP"] = "/data/heatmap/:weekCount/:endDate";
|
|
311
312
|
ApiPath2["HEALTH"] = "/health";
|
|
312
313
|
ApiPath2["LAST_WORDS_ADDED"] = "/lastWordsAdded";
|
|
314
|
+
ApiPath2["LEADERBOARD"] = "/leaderboard";
|
|
313
315
|
ApiPath2["LEXEMES"] = "/lexemes";
|
|
314
316
|
ApiPath2["LEXEMES_ALL"] = "/lexemes/all";
|
|
315
317
|
ApiPath2["LEXEMES_COUNT"] = "/lexemes/count/:language";
|
package/dist/index.mjs
CHANGED
|
@@ -125,6 +125,7 @@ var AppError = /* @__PURE__ */ ((AppError2) => {
|
|
|
125
125
|
AppError2["REQUEST_RECYCLE_LEXEME_PAIR_FAILED"] = "Failed to recycle lexeme pair";
|
|
126
126
|
AppError2["REQUEST_TRANSLATION_FAILED"] = "Failed to get translation";
|
|
127
127
|
AppError2["REQUEST_TEST_COMPLETE_FAILED"] = "Failed to complete test";
|
|
128
|
+
AppError2["REQUEST_TEST_COMPLETE_QUEUED"] = "Your results couldn't be saved right now. They're stored on this device and will be sent automatically once the connection is back.";
|
|
128
129
|
AppError2["REQUEST_TEST_SKIP_FAILED"] = "Failed to skip to the next deck";
|
|
129
130
|
return AppError2;
|
|
130
131
|
})(AppError || {});
|
|
@@ -255,6 +256,7 @@ var ApiPath = /* @__PURE__ */ ((ApiPath2) => {
|
|
|
255
256
|
ApiPath2["DATA_HEATMAP"] = "/data/heatmap/:weekCount/:endDate";
|
|
256
257
|
ApiPath2["HEALTH"] = "/health";
|
|
257
258
|
ApiPath2["LAST_WORDS_ADDED"] = "/lastWordsAdded";
|
|
259
|
+
ApiPath2["LEADERBOARD"] = "/leaderboard";
|
|
258
260
|
ApiPath2["LEXEMES"] = "/lexemes";
|
|
259
261
|
ApiPath2["LEXEMES_ALL"] = "/lexemes/all";
|
|
260
262
|
ApiPath2["LEXEMES_COUNT"] = "/lexemes/count/:language";
|
package/package.json
CHANGED
package/src/design/api.ts
CHANGED
|
@@ -35,6 +35,7 @@ export enum ApiPath {
|
|
|
35
35
|
DATA_HEATMAP = '/data/heatmap/:weekCount/:endDate',
|
|
36
36
|
HEALTH = '/health',
|
|
37
37
|
LAST_WORDS_ADDED = '/lastWordsAdded',
|
|
38
|
+
LEADERBOARD = '/leaderboard',
|
|
38
39
|
LEXEMES = '/lexemes',
|
|
39
40
|
LEXEMES_ALL = '/lexemes/all',
|
|
40
41
|
LEXEMES_COUNT = '/lexemes/count/:language',
|
|
@@ -78,6 +79,11 @@ export interface TestCompleteRequestBody {
|
|
|
78
79
|
clientDate: MySQLDate
|
|
79
80
|
results: ITestResult[]
|
|
80
81
|
vocabCheckType: VocabCheckType
|
|
82
|
+
/**
|
|
83
|
+
* Client-generated idempotency key ([A-Za-z0-9-]{1,64}). Clients that re-send a failed completion send the same id
|
|
84
|
+
* each time so the server applies it only once. Optional - completions without one are never deduplicated.
|
|
85
|
+
*/
|
|
86
|
+
completionId?: string
|
|
81
87
|
}
|
|
82
88
|
export interface TranslationRequestBody {
|
|
83
89
|
q: string;
|
package/src/design/types.ts
CHANGED
|
@@ -84,6 +84,19 @@ export interface IProgressHistoryDay {
|
|
|
84
84
|
retiredCount: number;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
+
/**
|
|
88
|
+
* One row of the reward points leaderboard. position is the user's 1-based rank across all users, ordered by
|
|
89
|
+
* rewardPoints, then highStreakLength, then sign-up order. name is the first name plus surname initial, never the
|
|
90
|
+
* full name.
|
|
91
|
+
*/
|
|
92
|
+
export interface ILeaderboardEntry {
|
|
93
|
+
position: number;
|
|
94
|
+
name: string;
|
|
95
|
+
rewardPoints: number;
|
|
96
|
+
highStreakLength: number;
|
|
97
|
+
isCurrentUser: boolean;
|
|
98
|
+
}
|
|
99
|
+
|
|
87
100
|
export type MySQLDate = `${number}-${number}-${number} ${number}:${number}:${number}`;
|
|
88
101
|
|
|
89
102
|
export type DateString = `${number}-${string}-${string}`;
|
|
@@ -109,6 +122,8 @@ export enum AppError {
|
|
|
109
122
|
REQUEST_RECYCLE_LEXEME_PAIR_FAILED = 'Failed to recycle lexeme pair',
|
|
110
123
|
REQUEST_TRANSLATION_FAILED = 'Failed to get translation',
|
|
111
124
|
REQUEST_TEST_COMPLETE_FAILED = 'Failed to complete test',
|
|
125
|
+
// The completion couldn't reach the server, but the client kept it and will re-send it - nothing is lost
|
|
126
|
+
REQUEST_TEST_COMPLETE_QUEUED = "Your results couldn't be saved right now. They're stored on this device and will be sent automatically once the connection is back.",
|
|
112
127
|
REQUEST_TEST_SKIP_FAILED = "Failed to skip to the next deck"
|
|
113
128
|
}
|
|
114
129
|
|