revdev 0.241.0 → 0.245.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.
@@ -1,6 +1,3 @@
1
- export interface BoAuthResponse {
2
- token: string;
3
- }
4
1
  export interface BoLoginRequest {
5
2
  username: string;
6
3
  password: string;
@@ -13,6 +13,8 @@ export interface IdMultiRequest {
13
13
  }
14
14
  export interface WordIdsRequest {
15
15
  wordIds: string[];
16
+ }
17
+ export interface WordSetFeedRequest extends WordIdsRequest {
16
18
  skip: number;
17
19
  }
18
20
  export interface ReactionRequest {
@@ -1,7 +1,11 @@
1
1
  import { SocialProvider } from "../../common";
2
+ import { AuthResponse } from "../../shared";
2
3
  export interface FeSocialAuthData {
3
4
  token: string;
4
5
  email: string;
5
6
  name: string;
6
7
  provider: SocialProvider;
7
8
  }
9
+ export interface FeAuthResponse extends AuthResponse {
10
+ locale: string;
11
+ }
@@ -0,0 +1,24 @@
1
+ import { ImageGen, Knowing } from "../../common";
2
+ import { WordUserGen } from "../../shared";
3
+ export interface FeWordImageProveRecord {
4
+ wordId: string;
5
+ image: ImageGen;
6
+ rate: number;
7
+ listTotal: string;
8
+ }
9
+ export interface FeWordTranProveRecord {
10
+ wordId: string;
11
+ tran: WordUserGen;
12
+ rate: number;
13
+ listTotal: string;
14
+ }
15
+ export interface FeProveWordMatch {
16
+ listTotal: string;
17
+ }
18
+ export interface FeWordKnowingResult {
19
+ changed: boolean;
20
+ wordId: string;
21
+ knowing?: Knowing;
22
+ images?: [string, ImageGen, FeProveWordMatch][];
23
+ trans?: [string, WordUserGen, FeProveWordMatch][];
24
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./entity";
2
+ export * from "./request";
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./entity"), exports);
14
+ __exportStar(require("./request"), exports);
@@ -0,0 +1,17 @@
1
+ import { Knowing } from "../../common";
2
+ export interface FeWordProveRequest {
3
+ wordId: string;
4
+ }
5
+ export interface FeWordTranProveRequest extends FeWordProveRequest {
6
+ tranLangCode: string;
7
+ }
8
+ export interface FeWordKnowingRequest {
9
+ wordId: string;
10
+ knowing: Knowing;
11
+ proved?: boolean;
12
+ tranLangCode?: string;
13
+ }
14
+ export interface FeWordKnowingManyRequest {
15
+ wordIds: string[] | string;
16
+ knowing: Knowing;
17
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -13,3 +13,4 @@ export * from "./user";
13
13
  export * from "./quiz";
14
14
  export * from "./progress";
15
15
  export * from "./wordImage";
16
+ export * from "./explorer";
@@ -25,3 +25,4 @@ __exportStar(require("./user"), exports);
25
25
  __exportStar(require("./quiz"), exports);
26
26
  __exportStar(require("./progress"), exports);
27
27
  __exportStar(require("./wordImage"), exports);
28
+ __exportStar(require("./explorer"), exports);
@@ -1,16 +1,14 @@
1
1
  import { QuizMode } from "../../common";
2
- import { WordGen } from "../../shared";
3
- import { FeTranRecord } from "../tran";
2
+ import { TranRecord, WordGen, WordImageRecord } from "../../shared";
4
3
  import { WordDataGen } from "../word";
5
- import { FeWordImageRecord } from "../wordImage";
6
4
  export interface FeQuizEntity {
7
5
  mode: QuizMode;
8
6
  pairs: FeQuizPair[];
9
7
  }
10
8
  export interface FeQuizPair {
11
9
  word: WordGen;
12
- trans?: FeTranRecord[];
13
- images?: FeWordImageRecord[];
10
+ trans?: TranRecord[];
11
+ images?: WordImageRecord[];
14
12
  cellWords?: WordGen[];
15
13
  }
16
14
  export interface FeQuizRack {
@@ -5,4 +5,5 @@ export interface FeProfileEntity {
5
5
  native?: string;
6
6
  learn?: string;
7
7
  tran?: string;
8
+ locale?: string;
8
9
  }
@@ -1,13 +1,4 @@
1
- import { ContribGen, PinModifier, UserReaction } from "../../common";
2
- import { TranRecord } from "../../shared";
3
- import { WordDataGen } from "../word";
4
- export interface FeTranRecord extends Omit<TranRecord, "dest"> {
5
- dest: WordDataGen;
6
- reaction?: UserReaction;
7
- tranWordId: string;
8
- pinned: boolean;
9
- contrib?: ContribGen;
10
- }
1
+ import { PinModifier } from "../../common";
11
2
  export interface FeTranWordPinModifier extends PinModifier {
12
3
  tranId: string;
13
4
  }
@@ -1,14 +1,12 @@
1
1
  import { Feed } from "../../feed";
2
- import { QuizCode, QuizMode, DualContribGen, AccessGen, ContribGen } from "../../common";
3
- import { FeTranRecord } from "../tran";
4
- import { WordUserGen } from "../../shared";
5
- import { FeWordImageRecord } from "../wordImage";
2
+ import { DualContribGen, AccessGen, ContribGen } from "../../common";
3
+ import { TranRecord, WordAttemptRecord, WordImageRecord, WordUserGen } from "../../shared";
6
4
  export interface WordDataGen extends WordUserGen {
7
- attempts?: FeWordAttempt[];
8
- images?: FeWordImageRecord[];
5
+ attempts?: WordAttemptRecord[];
6
+ images?: WordImageRecord[];
9
7
  audios?: FeWordAudio[];
10
8
  tags?: FeWordTag[];
11
- trans?: FeTranRecord[];
9
+ trans?: TranRecord[];
12
10
  tranLangCode?: string;
13
11
  }
14
12
  export interface FeWordTag {
@@ -16,15 +14,6 @@ export interface FeWordTag {
16
14
  tagCode: string;
17
15
  contrib: ContribGen;
18
16
  }
19
- export interface FeWordAttempt {
20
- id: string;
21
- wordId: string;
22
- quizCode: QuizCode;
23
- quizMode: QuizMode;
24
- isCorrect: boolean;
25
- tranLangCode: string;
26
- contrib: ContribGen;
27
- }
28
17
  export interface FeWordAudio {
29
18
  id: string;
30
19
  wordId: string;
@@ -34,7 +23,7 @@ export interface FeWordAudio {
34
23
  }
35
24
  export interface FeWordSpeechPart {
36
25
  speechPartId?: string;
37
- tranFeed: Feed<FeTranRecord>;
26
+ tranFeed: Feed<TranRecord>;
38
27
  }
39
28
  export interface FeWordTranCode {
40
29
  langCode: string;
@@ -44,9 +33,9 @@ export interface FeWordEntity extends WordUserGen {
44
33
  mode?: string;
45
34
  contrib?: DualContribGen;
46
35
  access?: AccessGen;
47
- attempts?: FeWordAttempt[];
36
+ attempts?: WordAttemptRecord[];
48
37
  speechParts?: FeWordSpeechPart[];
49
- imageFeed?: Feed<FeWordImageRecord>;
38
+ imageFeed?: Feed<WordImageRecord>;
50
39
  audioFeed?: Feed<FeWordAudio>;
51
40
  tagFeed?: Feed<FeWordTag>;
52
41
  tranLangCode: string;
@@ -1,4 +1,4 @@
1
- import { IdRequest, Knowing } from "../../common";
1
+ import { IdRequest } from "../../common";
2
2
  import { WordFeedExtension, FeedRequest, ShortFeedRequest } from "../../feed";
3
3
  import { CreateWordRequest } from "../../shared";
4
4
  interface BaseWordEntityRequest {
@@ -39,13 +39,6 @@ export interface FeWordOptionRequest {
39
39
  }
40
40
  export interface FeCreateWordRequest extends CreateWordRequest {
41
41
  }
42
- export interface FeWordsRequest {
43
- wordIds: string[];
44
- }
45
- export interface FeWordKnowingRequest {
46
- wordIds: string[];
47
- knowing: Knowing;
48
- }
49
42
  export interface FeWordTranRecordRequest extends IdRequest {
50
43
  tranLangCode: string;
51
44
  }
@@ -1,2 +1 @@
1
1
  export * from "./request";
2
- export * from "./entity";
@@ -11,4 +11,3 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  __exportStar(require("./request"), exports);
14
- __exportStar(require("./entity"), exports);
@@ -0,0 +1,3 @@
1
+ export interface AuthResponse {
2
+ token: string;
3
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export * from "./entity";
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./entity"), exports);
@@ -28,4 +28,6 @@ export interface AppSettings {
28
28
  readonly maxTranWordPins: number;
29
29
  readonly maxWordImagePins: number;
30
30
  readonly optionCount: number;
31
+ readonly proveImages: number;
32
+ readonly proveTrans: number;
31
33
  }
@@ -5,3 +5,4 @@ export * from "./tag";
5
5
  export * from "./tran";
6
6
  export * from "./general";
7
7
  export * from "./wordImage";
8
+ export * from "./auth";
@@ -17,3 +17,4 @@ __exportStar(require("./tag"), exports);
17
17
  __exportStar(require("./tran"), exports);
18
18
  __exportStar(require("./general"), exports);
19
19
  __exportStar(require("./wordImage"), exports);
20
+ __exportStar(require("./auth"), exports);
@@ -1,8 +1,21 @@
1
+ import { ContribGen, UserReaction } from "../../common";
2
+ import { WordDataGen } from "../../front";
1
3
  import { WordGen } from "../word";
2
- export interface TranRecord {
4
+ export interface TranModifier {
3
5
  id: string;
4
6
  wordId: string;
5
7
  dest: WordGen;
6
8
  speechPartId?: string;
7
9
  rate: number;
8
10
  }
11
+ export interface TranRecord {
12
+ id: string;
13
+ wordId: string;
14
+ dest: WordDataGen;
15
+ speechPartId?: string;
16
+ tranWordId: string;
17
+ rate: number;
18
+ reaction?: UserReaction;
19
+ pinned?: boolean;
20
+ contrib: ContribGen;
21
+ }
@@ -1,4 +1,4 @@
1
- import { Knowing } from "../../common";
1
+ import { ContribGen, Knowing, QuizCode, QuizMode } from "../../common";
2
2
  export interface WordGen {
3
3
  id: string;
4
4
  text: string;
@@ -17,3 +17,12 @@ export interface PotentialWord {
17
17
  text: string;
18
18
  }
19
19
  export declare type LiteralWord = string | string[] | PotentialWord | PotentialWord[];
20
+ export interface WordAttemptRecord {
21
+ id: string;
22
+ wordId: string;
23
+ quizCode: QuizCode;
24
+ quizMode: QuizMode;
25
+ isCorrect: boolean;
26
+ tranLangCode: string;
27
+ contrib: ContribGen;
28
+ }
@@ -1,4 +1,4 @@
1
- import { EntryStatus } from "../../common";
1
+ import { ContribGen, EntryStatus, ImageGen, UserReaction } from "../../common";
2
2
  export interface WordImageModifier {
3
3
  id: string;
4
4
  wordId: string;
@@ -9,3 +9,13 @@ export interface WordImageModifier {
9
9
  status?: EntryStatus;
10
10
  rate: number;
11
11
  }
12
+ export interface WordImageRecord {
13
+ id: string;
14
+ wordId: string;
15
+ image: ImageGen;
16
+ active: boolean;
17
+ rate: number;
18
+ reaction?: UserReaction;
19
+ pinned?: boolean;
20
+ contrib: ContribGen;
21
+ }
@@ -1,3 +1,4 @@
1
1
  export declare class ArrayUtil {
2
2
  static toArray<T>(item: T | T[]): T[];
3
+ static shuffle<T>(array: T[]): void;
3
4
  }
@@ -7,6 +7,18 @@ var ArrayUtil = /** @class */ (function () {
7
7
  ArrayUtil.toArray = function (item) {
8
8
  return Array.isArray(item) ? item : [item];
9
9
  };
10
+ ArrayUtil.shuffle = function (array) {
11
+ var _a;
12
+ var currentIndex = array.length;
13
+ // While there remain elements to shuffle...
14
+ while (currentIndex != 0) {
15
+ // Pick a remaining element...
16
+ var randomIndex = Math.floor(Math.random() * currentIndex);
17
+ currentIndex--;
18
+ // And swap it with the current element.
19
+ _a = [array[randomIndex], array[currentIndex]], array[currentIndex] = _a[0], array[randomIndex] = _a[1];
20
+ }
21
+ };
10
22
  return ArrayUtil;
11
23
  }());
12
24
  exports.ArrayUtil = ArrayUtil;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "revdev",
3
- "version": "0.241.0",
3
+ "version": "0.245.0",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -1,11 +0,0 @@
1
- import { ContribGen, ImageGen, UserReaction } from "../../common";
2
- export interface FeWordImageRecord {
3
- id: string;
4
- wordId: string;
5
- image: ImageGen;
6
- active: boolean;
7
- rate: number;
8
- reaction: UserReaction;
9
- pinned: boolean;
10
- contrib: ContribGen;
11
- }
File without changes