revdev 0.233.0 → 0.235.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/exception.d.ts +2 -1
- package/lib/common/exception.js +1 -0
- package/lib/common/image.d.ts +5 -0
- package/lib/common/image.js +2 -0
- package/lib/common/index.d.ts +2 -0
- package/lib/common/index.js +2 -0
- package/lib/common/modifier.d.ts +12 -0
- package/lib/common/modifier.js +2 -0
- package/lib/common/request.d.ts +8 -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 +2 -13
- package/lib/front/word/entity.d.ts +1 -3
- package/lib/front/wordImage/entity.d.ts +3 -5
- 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/tests/array.test.d.ts +1 -0
- package/lib/tests/array.test.js +9 -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 {};
|
|
@@ -31,5 +31,6 @@ export declare enum ExceptionCodes {
|
|
|
31
31
|
ImageCannotUploadInDevelopmentFolder = "ImageCannotUploadInDevelopmentFolder",
|
|
32
32
|
CsvParsingValidation = "CsvParsingValidation",
|
|
33
33
|
EntryStatusCannotBeChangedForAdminEntity = "EntryStatusCannotBeChangedForAdminEntity",
|
|
34
|
-
MaxTranWordPinsExceeded = "MaxTranWordPinsExceeded"
|
|
34
|
+
MaxTranWordPinsExceeded = "MaxTranWordPinsExceeded",
|
|
35
|
+
MaxWordImagePinsExceeded = "MaxWordImagePinsExceeded"
|
|
35
36
|
}
|
package/lib/common/exception.js
CHANGED
|
@@ -39,4 +39,5 @@ var ExceptionCodes;
|
|
|
39
39
|
// entry status
|
|
40
40
|
ExceptionCodes["EntryStatusCannotBeChangedForAdminEntity"] = "EntryStatusCannotBeChangedForAdminEntity";
|
|
41
41
|
ExceptionCodes["MaxTranWordPinsExceeded"] = "MaxTranWordPinsExceeded";
|
|
42
|
+
ExceptionCodes["MaxWordImagePinsExceeded"] = "MaxWordImagePinsExceeded";
|
|
42
43
|
})(ExceptionCodes = exports.ExceptionCodes || (exports.ExceptionCodes = {}));
|
package/lib/common/index.d.ts
CHANGED
package/lib/common/index.js
CHANGED
|
@@ -20,3 +20,5 @@ __exportStar(require("./gen"), exports);
|
|
|
20
20
|
__exportStar(require("./link"), exports);
|
|
21
21
|
__exportStar(require("./feed"), exports);
|
|
22
22
|
__exportStar(require("./exception"), exports);
|
|
23
|
+
__exportStar(require("./modifier"), exports);
|
|
24
|
+
__exportStar(require("./image"), exports);
|
package/lib/common/request.d.ts
CHANGED
|
@@ -17,10 +17,18 @@ export interface WordIdsRequest {
|
|
|
17
17
|
}
|
|
18
18
|
export interface ReactionRequest {
|
|
19
19
|
reaction: UserReaction;
|
|
20
|
+
id: string;
|
|
20
21
|
}
|
|
21
22
|
export interface PinRequest {
|
|
22
23
|
pin: boolean;
|
|
24
|
+
id: string;
|
|
23
25
|
}
|
|
24
26
|
export interface TokenRequest {
|
|
25
27
|
token: string;
|
|
26
28
|
}
|
|
29
|
+
export interface OptionRequest {
|
|
30
|
+
search?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface LangOptionRequest extends OptionRequest {
|
|
33
|
+
langCode: string;
|
|
34
|
+
}
|
|
@@ -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,15 +1,4 @@
|
|
|
1
|
-
import { PinRequest
|
|
2
|
-
export interface FeTranWordPinRequest extends PinRequest {
|
|
1
|
+
import { PinRequest } from "../../common";
|
|
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 ReactionRequest {
|
|
10
|
-
tranId: string;
|
|
11
|
-
}
|
|
12
|
-
export interface FeTranReactionModifier extends FeTranReactionRequest {
|
|
13
|
-
rate: number;
|
|
14
|
-
id: string;
|
|
15
|
-
}
|
|
@@ -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,13 +1,11 @@
|
|
|
1
|
-
import {
|
|
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;
|
|
11
9
|
pinned: boolean;
|
|
12
|
-
contrib:
|
|
10
|
+
contrib: ContribGen;
|
|
13
11
|
}
|
|
@@ -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 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var utils_1 = require("../utils");
|
|
4
|
+
describe("ArrayUtil Test", function () {
|
|
5
|
+
test("true", function () {
|
|
6
|
+
expect(utils_1.ArrayUtil.toArray(1)).toMatchObject([1]);
|
|
7
|
+
expect(utils_1.ArrayUtil.toArray("text")).toMatchObject(["text"]);
|
|
8
|
+
});
|
|
9
|
+
});
|
|
@@ -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
|
+
});
|