revdev 0.234.0 → 0.236.0
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/lib/back/common/entity.d.ts +4 -3
- package/lib/back/wordImage/entity.d.ts +16 -4
- package/lib/back/wordImage/request.d.ts +0 -5
- package/lib/common/modifier.d.ts +2 -0
- package/lib/common/request.d.ts +6 -0
- package/lib/front/general/entity.d.ts +2 -0
- package/lib/front/tran/entity.d.ts +4 -1
- package/lib/front/tran/request.d.ts +1 -11
- package/lib/front/word/entity.d.ts +1 -3
- package/lib/front/word/request.d.ts +4 -1
- package/lib/front/wordImage/entity.d.ts +2 -4
- package/lib/shared/general/entity.d.ts +20 -4
- package/lib/shared/wordImage/index.d.ts +1 -0
- package/lib/shared/wordImage/index.js +1 -0
- package/lib/shared/wordImage/request.d.ts +3 -0
- package/lib/shared/wordImage/request.js +2 -0
- package/lib/utils/fileName.d.ts +5 -0
- package/lib/utils/fileName.js +21 -0
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +1 -0
- package/lib/utils/tests/fileName.test.d.ts +1 -0
- package/lib/utils/tests/fileName.test.js +19 -0
- package/package.json +1 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { IdCodeOption } from "../../common";
|
|
1
|
+
import { IdCodeOption, StringOption } from "../../common";
|
|
2
|
+
import { AppSettings } from "../../shared";
|
|
2
3
|
export interface BoInitData {
|
|
3
|
-
|
|
4
|
+
langOptions: StringOption[];
|
|
4
5
|
speechPartOptions: IdCodeOption[];
|
|
5
6
|
quizCodes: string[];
|
|
6
7
|
localeCodes: string[];
|
|
7
|
-
|
|
8
|
+
settings: AppSettings;
|
|
8
9
|
}
|
|
@@ -1,14 +1,26 @@
|
|
|
1
|
-
import { DualContribGen, EntryStatus } from "../../common";
|
|
1
|
+
import { ContribGen, DualContribGen, EntryStatus, ImageGen, UserReaction } from "../../common";
|
|
2
2
|
import { WordGen } from "../../shared";
|
|
3
3
|
export interface BoWordImageRecord {
|
|
4
4
|
id: string;
|
|
5
5
|
word: WordGen;
|
|
6
|
-
|
|
7
|
-
fileName: string;
|
|
8
|
-
thumbnailFileName: string;
|
|
6
|
+
image: ImageGen;
|
|
9
7
|
contrib: DualContribGen;
|
|
10
8
|
wordTotal: number;
|
|
11
9
|
rate: number;
|
|
12
10
|
active: boolean;
|
|
13
11
|
status?: EntryStatus;
|
|
14
12
|
}
|
|
13
|
+
interface WordImageContainerRecord {
|
|
14
|
+
id: string;
|
|
15
|
+
wordImageId: string;
|
|
16
|
+
word: WordGen;
|
|
17
|
+
image: ImageGen;
|
|
18
|
+
rate: number;
|
|
19
|
+
contrib: ContribGen;
|
|
20
|
+
}
|
|
21
|
+
export interface BoWordImageReactionRecord extends WordImageContainerRecord {
|
|
22
|
+
reaction: UserReaction;
|
|
23
|
+
}
|
|
24
|
+
export interface BoWordImagePinRecord extends WordImageContainerRecord {
|
|
25
|
+
}
|
|
26
|
+
export {};
|
package/lib/common/modifier.d.ts
CHANGED
package/lib/common/request.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IdCodeOption } from "../../common";
|
|
2
|
+
import { AppSettings } from "../../shared";
|
|
2
3
|
import { FeLangRecord } from "../lang";
|
|
3
4
|
import { FeListRecord } from "../list";
|
|
4
5
|
import { FeTableRecord } from "../table";
|
|
@@ -8,6 +9,7 @@ export interface FeInitData {
|
|
|
8
9
|
speechPartOptions: IdCodeOption[];
|
|
9
10
|
quizCodes: string[];
|
|
10
11
|
localeCodes: string[];
|
|
12
|
+
settings: AppSettings;
|
|
11
13
|
}
|
|
12
14
|
export interface FeIntroductionData {
|
|
13
15
|
langs: FeLangRecord[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ContribGen, UserReaction } from "../../common";
|
|
1
|
+
import { ContribGen, PinModifier, UserReaction } from "../../common";
|
|
2
2
|
import { TranRecord } from "../../shared";
|
|
3
3
|
import { WordDataGen } from "../word";
|
|
4
4
|
export interface FeTranRecord extends Omit<TranRecord, "dest"> {
|
|
@@ -8,3 +8,6 @@ export interface FeTranRecord extends Omit<TranRecord, "dest"> {
|
|
|
8
8
|
pinned: boolean;
|
|
9
9
|
contrib?: ContribGen;
|
|
10
10
|
}
|
|
11
|
+
export interface FeTranWordPinModifier extends PinModifier {
|
|
12
|
+
tranId: string;
|
|
13
|
+
}
|
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
import { PinRequest
|
|
1
|
+
import { PinRequest } from "../../common";
|
|
2
2
|
export interface FeTranWordPinRequest extends Pick<PinRequest, "pin"> {
|
|
3
3
|
tranWordId: string;
|
|
4
4
|
}
|
|
5
|
-
export interface FeTranWordPinModifier extends FeTranWordPinRequest {
|
|
6
|
-
tranId: string;
|
|
7
|
-
id: string;
|
|
8
|
-
}
|
|
9
|
-
export interface FeTranReactionRequest extends Pick<ReactionRequest, "reaction"> {
|
|
10
|
-
tranId: string;
|
|
11
|
-
}
|
|
12
|
-
export interface FeTranReactionModifier extends ReactionModifier {
|
|
13
|
-
tranId: string;
|
|
14
|
-
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Feed } from "../../feed";
|
|
2
2
|
import { QuizCode, QuizMode, DualContribGen, AccessGen, ContribGen } from "../../common";
|
|
3
3
|
import { FeTranRecord } from "../tran";
|
|
4
|
-
import {
|
|
4
|
+
import { WordUserGen } from "../../shared";
|
|
5
5
|
import { FeWordImageRecord } from "../wordImage";
|
|
6
6
|
export interface WordDataGen extends WordUserGen {
|
|
7
7
|
attempts?: FeWordAttempt[];
|
|
@@ -13,7 +13,6 @@ export interface WordDataGen extends WordUserGen {
|
|
|
13
13
|
export interface FeWordTag {
|
|
14
14
|
wordId: string;
|
|
15
15
|
tagCode: string;
|
|
16
|
-
reaction: ReactionGen;
|
|
17
16
|
contrib: ContribGen;
|
|
18
17
|
}
|
|
19
18
|
export interface FeWordAttempt {
|
|
@@ -30,7 +29,6 @@ export interface FeWordAudio {
|
|
|
30
29
|
wordId: string;
|
|
31
30
|
audioId: string;
|
|
32
31
|
fileName: string;
|
|
33
|
-
reaction: ReactionGen;
|
|
34
32
|
contrib: ContribGen;
|
|
35
33
|
}
|
|
36
34
|
export interface FeWordSpeechPart {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Knowing } from "../../common";
|
|
1
|
+
import { IdRequest, Knowing } from "../../common";
|
|
2
2
|
import { WordFeedExtension, FeedRequest, ShortFeedRequest } from "../../feed";
|
|
3
3
|
import { CreateWordRequest } from "../../shared";
|
|
4
4
|
interface BaseWordEntityRequest {
|
|
@@ -46,4 +46,7 @@ export interface FeWordKnowingRequest {
|
|
|
46
46
|
wordIds: string[];
|
|
47
47
|
knowing: Knowing;
|
|
48
48
|
}
|
|
49
|
+
export interface FeWordTranRecordRequest extends IdRequest {
|
|
50
|
+
tranLangCode: string;
|
|
51
|
+
}
|
|
49
52
|
export {};
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { ContribGen, UserReaction } from "../../common";
|
|
1
|
+
import { ContribGen, ImageGen, UserReaction } from "../../common";
|
|
2
2
|
export interface FeWordImageRecord {
|
|
3
3
|
id: string;
|
|
4
4
|
wordId: string;
|
|
5
|
-
|
|
6
|
-
fileName: string;
|
|
7
|
-
thumbnailFileName: string;
|
|
5
|
+
image: ImageGen;
|
|
8
6
|
active: boolean;
|
|
9
7
|
rate: number;
|
|
10
8
|
reaction: UserReaction;
|
|
@@ -5,11 +5,27 @@ export interface WordKnowledge {
|
|
|
5
5
|
unknown: number;
|
|
6
6
|
}
|
|
7
7
|
export declare type UserWordKnowing = [number, number];
|
|
8
|
-
export interface ReactionGen {
|
|
9
|
-
rate: number;
|
|
10
|
-
userRate: number;
|
|
11
|
-
}
|
|
12
8
|
export interface UpdatedEntity {
|
|
13
9
|
id: string;
|
|
14
10
|
slug: string;
|
|
15
11
|
}
|
|
12
|
+
export interface AppSettings {
|
|
13
|
+
readonly maxQuizWords: number;
|
|
14
|
+
readonly feedTake: number;
|
|
15
|
+
readonly shortFeedTake: number;
|
|
16
|
+
readonly maxListWords: number;
|
|
17
|
+
readonly maxTableRows: number;
|
|
18
|
+
readonly maxTableColumns: number;
|
|
19
|
+
readonly maxTableCellWords: number;
|
|
20
|
+
readonly resetPasswordTokenLifeHours: number;
|
|
21
|
+
readonly proveKnowingWords: number;
|
|
22
|
+
readonly wordSetTake: number;
|
|
23
|
+
readonly wordAttemptTake: number;
|
|
24
|
+
readonly wordImageMinDimension: number;
|
|
25
|
+
readonly wordImageOptimalDimension: number;
|
|
26
|
+
readonly wordImageThumbnailSize: number;
|
|
27
|
+
readonly initRateRange: [number, number];
|
|
28
|
+
readonly maxTranWordPins: number;
|
|
29
|
+
readonly maxWordImagePins: number;
|
|
30
|
+
readonly optionCount: number;
|
|
31
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FileNameUtil = void 0;
|
|
4
|
+
var FileNameUtil = /** @class */ (function () {
|
|
5
|
+
function FileNameUtil() {
|
|
6
|
+
}
|
|
7
|
+
FileNameUtil.extension = function (fileName) {
|
|
8
|
+
return fileName === null || fileName === void 0 ? void 0 : fileName.split(".").pop();
|
|
9
|
+
};
|
|
10
|
+
FileNameUtil.parseAccept = function (accept) {
|
|
11
|
+
var extensions = (accept === null || accept === void 0 ? void 0 : accept.split(",").map(function (text) { return text.trim().replace(/^./, ""); })) || [];
|
|
12
|
+
return extensions;
|
|
13
|
+
};
|
|
14
|
+
FileNameUtil.extensionMatch = function (fileName, accept) {
|
|
15
|
+
var extension = FileNameUtil.extension(fileName);
|
|
16
|
+
var allowExtensions = FileNameUtil.parseAccept(accept);
|
|
17
|
+
return allowExtensions.includes(extension || "");
|
|
18
|
+
};
|
|
19
|
+
return FileNameUtil;
|
|
20
|
+
}());
|
|
21
|
+
exports.FileNameUtil = FileNameUtil;
|
package/lib/utils/index.d.ts
CHANGED
package/lib/utils/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var fileName_1 = require("../fileName");
|
|
4
|
+
describe("FileNameUtil", function () {
|
|
5
|
+
test("extension", function () {
|
|
6
|
+
expect(fileName_1.FileNameUtil.extension("file.txt")).toBe("txt");
|
|
7
|
+
expect(fileName_1.FileNameUtil.extension("first.file.txt")).toBe("txt");
|
|
8
|
+
expect(fileName_1.FileNameUtil.extension("file")).toBe("file");
|
|
9
|
+
expect(fileName_1.FileNameUtil.extension("")).toBe("");
|
|
10
|
+
expect(fileName_1.FileNameUtil.extension(undefined)).toBe(undefined);
|
|
11
|
+
});
|
|
12
|
+
test("parseAccept", function () {
|
|
13
|
+
expect(fileName_1.FileNameUtil.parseAccept(".jpg,.png")).toMatchObject(["jpg", "png"]);
|
|
14
|
+
expect(fileName_1.FileNameUtil.parseAccept(".jpg , .png")).toMatchObject(["jpg", "png"]);
|
|
15
|
+
});
|
|
16
|
+
test("extensionMatch", function () {
|
|
17
|
+
expect(fileName_1.FileNameUtil.extensionMatch("file.jpg", ".jpg,.png")).toBeTruthy();
|
|
18
|
+
});
|
|
19
|
+
});
|