@coorpacademy/app-review 0.10.3 → 0.10.4

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.
Files changed (92) hide show
  1. package/es/actions/api/fetch-correction.d.ts +2 -1
  2. package/es/actions/api/fetch-rank.d.ts +2 -1
  3. package/es/actions/api/fetch-skill.d.ts +2 -1
  4. package/es/actions/api/fetch-skills.d.ts +2 -1
  5. package/es/actions/api/fetch-slide.d.ts +2 -1
  6. package/es/actions/api/fetch-slides-to-review-by-skill-ref.d.ts +2 -1
  7. package/es/actions/api/post-answer.d.ts +2 -1
  8. package/es/actions/api/post-progression.d.ts +2 -1
  9. package/es/actions/ui/navigation.d.ts +1 -1
  10. package/es/actions/ui/slides.d.ts +1 -1
  11. package/es/common/index.d.ts +1 -1
  12. package/es/configure-store.d.ts +1 -1
  13. package/es/configure-store.js +1 -1
  14. package/es/reducers/data/corrections.d.ts +1 -1
  15. package/es/reducers/data/current-skill.d.ts +1 -1
  16. package/es/reducers/data/progression.d.ts +1 -1
  17. package/es/reducers/data/skills.d.ts +1 -1
  18. package/es/reducers/data/slides.d.ts +1 -1
  19. package/es/types/common.d.ts +10 -186
  20. package/es/views/skills/index.d.ts +1 -1
  21. package/es/views/slides/index.d.ts +1 -1
  22. package/es/views/slides/map-api-slide-to-ui.d.ts +2 -1
  23. package/es/views/slides/map-api-slide-to-ui.js +1 -1
  24. package/lib/actions/api/fetch-correction.d.ts +2 -1
  25. package/lib/actions/api/fetch-rank.d.ts +2 -1
  26. package/lib/actions/api/fetch-skill.d.ts +2 -1
  27. package/lib/actions/api/fetch-skills.d.ts +2 -1
  28. package/lib/actions/api/fetch-slide.d.ts +2 -1
  29. package/lib/actions/api/fetch-slides-to-review-by-skill-ref.d.ts +2 -1
  30. package/lib/actions/api/post-answer.d.ts +2 -1
  31. package/lib/actions/api/post-progression.d.ts +2 -1
  32. package/lib/actions/ui/navigation.d.ts +1 -1
  33. package/lib/actions/ui/slides.d.ts +1 -1
  34. package/lib/common/index.d.ts +1 -1
  35. package/lib/configure-store.d.ts +1 -1
  36. package/lib/configure-store.js +2 -2
  37. package/lib/reducers/data/corrections.d.ts +1 -1
  38. package/lib/reducers/data/current-skill.d.ts +1 -1
  39. package/lib/reducers/data/progression.d.ts +1 -1
  40. package/lib/reducers/data/skills.d.ts +1 -1
  41. package/lib/reducers/data/slides.d.ts +1 -1
  42. package/lib/types/common.d.ts +10 -186
  43. package/lib/views/skills/index.d.ts +1 -1
  44. package/lib/views/slides/index.d.ts +1 -1
  45. package/lib/views/slides/map-api-slide-to-ui.d.ts +2 -1
  46. package/lib/views/slides/map-api-slide-to-ui.js +1 -1
  47. package/package.json +5 -3
  48. package/es/services/fetch-correction.d.ts +0 -2
  49. package/es/services/fetch-correction.js +0 -14
  50. package/es/services/fetch-rank.d.ts +0 -2
  51. package/es/services/fetch-rank.js +0 -10
  52. package/es/services/fetch-skill.d.ts +0 -2
  53. package/es/services/fetch-skill.js +0 -11
  54. package/es/services/fetch-skills.d.ts +0 -2
  55. package/es/services/fetch-skills.js +0 -10
  56. package/es/services/fetch-slide.d.ts +0 -2
  57. package/es/services/fetch-slide.js +0 -10
  58. package/es/services/fetch-slides-to-review-by-skill-ref.d.ts +0 -2
  59. package/es/services/fetch-slides-to-review-by-skill-ref.js +0 -10
  60. package/es/services/index.d.ts +0 -2
  61. package/es/services/index.js +0 -18
  62. package/es/services/post-answer.d.ts +0 -2
  63. package/es/services/post-answer.js +0 -20
  64. package/es/services/post-progression.d.ts +0 -2
  65. package/es/services/post-progression.js +0 -21
  66. package/es/services/tools/fetch-responses.d.ts +0 -7
  67. package/es/services/tools/fetch-responses.js +0 -33
  68. package/es/services/tools/sleep.d.ts +0 -1
  69. package/es/services/tools/sleep.js +0 -3
  70. package/lib/services/fetch-correction.d.ts +0 -2
  71. package/lib/services/fetch-correction.js +0 -21
  72. package/lib/services/fetch-rank.d.ts +0 -2
  73. package/lib/services/fetch-rank.js +0 -17
  74. package/lib/services/fetch-skill.d.ts +0 -2
  75. package/lib/services/fetch-skill.js +0 -18
  76. package/lib/services/fetch-skills.d.ts +0 -2
  77. package/lib/services/fetch-skills.js +0 -17
  78. package/lib/services/fetch-slide.d.ts +0 -2
  79. package/lib/services/fetch-slide.js +0 -17
  80. package/lib/services/fetch-slides-to-review-by-skill-ref.d.ts +0 -2
  81. package/lib/services/fetch-slides-to-review-by-skill-ref.js +0 -17
  82. package/lib/services/index.d.ts +0 -2
  83. package/lib/services/index.js +0 -22
  84. package/lib/services/post-answer.d.ts +0 -2
  85. package/lib/services/post-answer.js +0 -27
  86. package/lib/services/post-progression.d.ts +0 -2
  87. package/lib/services/post-progression.js +0 -28
  88. package/lib/services/tools/fetch-responses.d.ts +0 -7
  89. package/lib/services/tools/fetch-responses.js +0 -40
  90. package/lib/services/tools/sleep.d.ts +0 -1
  91. package/lib/services/tools/sleep.js +0 -7
  92. package/locales/.mtslconfig.json +0 -1
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getServices = void 0;
4
- const fetch_correction_1 = require("./fetch-correction");
5
- const fetch_rank_1 = require("./fetch-rank");
6
- const fetch_skills_1 = require("./fetch-skills");
7
- const fetch_slide_1 = require("./fetch-slide");
8
- const fetch_slides_to_review_by_skill_ref_1 = require("./fetch-slides-to-review-by-skill-ref");
9
- const post_answer_1 = require("./post-answer");
10
- const post_progression_1 = require("./post-progression");
11
- const fetch_skill_1 = require("./fetch-skill");
12
- const getServices = () => ({
13
- fetchCorrection: fetch_correction_1.fetchCorrection,
14
- fetchRank: fetch_rank_1.fetchRank,
15
- fetchSkill: fetch_skill_1.fetchSkill,
16
- fetchSkills: fetch_skills_1.fetchSkills,
17
- fetchSlide: fetch_slide_1.fetchSlide,
18
- fetchSlidesToReviewBySkillRef: fetch_slides_to_review_by_skill_ref_1.fetchSlidesToReviewBySkillRef,
19
- postAnswer: post_answer_1.postAnswer,
20
- postProgression: post_progression_1.postProgression
21
- });
22
- exports.getServices = getServices;
@@ -1,2 +0,0 @@
1
- import { ProgressionFromAPI } from '../types/common';
2
- export declare const postAnswer: (progression: ProgressionFromAPI, token: string, answer: string[]) => Promise<ProgressionFromAPI>;
@@ -1,27 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.postAnswer = void 0;
7
- const cross_fetch_1 = __importDefault(require("cross-fetch"));
8
- const jwt_decode_1 = __importDefault(require("jwt-decode"));
9
- const fetch_responses_1 = require("./tools/fetch-responses");
10
- const postAnswer = async (progression, token, answer) => {
11
- const progressionId = progression._id;
12
- const slideRef = progression.state.nextContent.ref;
13
- const { host } = (0, jwt_decode_1.default)(token);
14
- const response = await (0, cross_fetch_1.default)(`${host}/api/v2/progressions/${progressionId}/answers`, {
15
- method: 'post',
16
- headers: { authorization: token, 'content-type': 'application/json' },
17
- body: JSON.stringify({
18
- content: {
19
- ref: slideRef,
20
- type: 'slide'
21
- },
22
- answer
23
- })
24
- });
25
- return (0, fetch_responses_1.toJSON)(response);
26
- };
27
- exports.postAnswer = postAnswer;
@@ -1,2 +0,0 @@
1
- import { ProgressionFromAPI } from '../types/common';
2
- export declare const postProgression: (skillRef: string, token: string) => Promise<ProgressionFromAPI>;
@@ -1,28 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.postProgression = void 0;
7
- const cross_fetch_1 = __importDefault(require("cross-fetch"));
8
- const jwt_decode_1 = __importDefault(require("jwt-decode"));
9
- const fetch_responses_1 = require("./tools/fetch-responses");
10
- const postProgression = async (skillRef, token) => {
11
- const { host } = (0, jwt_decode_1.default)(token);
12
- const response = await (0, cross_fetch_1.default)(`${host}/api/v2/progressions`, {
13
- method: 'post',
14
- headers: { authorization: token, 'content-type': 'application/json' },
15
- body: JSON.stringify({
16
- content: {
17
- ref: skillRef,
18
- type: 'skill'
19
- },
20
- engine: {
21
- ref: 'review',
22
- version: '1'
23
- }
24
- })
25
- });
26
- return (0, fetch_responses_1.toJSON)(response);
27
- };
28
- exports.postProgression = postProgression;
@@ -1,7 +0,0 @@
1
- export declare class ResponseError extends Error {
2
- statusCode: number;
3
- constructor(statusCode: number, statusText: string, body?: string);
4
- }
5
- export declare const toJSON: <T = unknown>(response: Response) => Promise<T>;
6
- export declare const toText: (response: Response) => Promise<string>;
7
- export declare const toVoid: (response: Response) => Promise<void>;
@@ -1,40 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toVoid = exports.toText = exports.toJSON = exports.ResponseError = void 0;
4
- class ResponseError extends Error {
5
- constructor(statusCode, statusText, body = '') {
6
- super(`${statusText} ${body}`.trim());
7
- this.name = 'ResponseError';
8
- this.statusCode = statusCode;
9
- }
10
- }
11
- exports.ResponseError = ResponseError;
12
- const toJSON = async (response) => {
13
- if (!response.ok) {
14
- const body = await response.text();
15
- throw new ResponseError(response.status, response.statusText, body);
16
- }
17
- try {
18
- return await response.json();
19
- }
20
- catch (err) {
21
- throw new ResponseError(response.status, response.statusText);
22
- }
23
- };
24
- exports.toJSON = toJSON;
25
- const toText = async (response) => {
26
- const body = await response.text();
27
- if (!response.ok) {
28
- throw new ResponseError(response.status, response.statusText, body);
29
- }
30
- return body;
31
- };
32
- exports.toText = toText;
33
- const toVoid = async (response) => {
34
- if (!response.ok) {
35
- const body = await response.text();
36
- throw new ResponseError(response.status, response.statusText, body);
37
- }
38
- return;
39
- };
40
- exports.toVoid = toVoid;
@@ -1 +0,0 @@
1
- export declare const sleep: (msToSleep: number) => Promise<void>;
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.sleep = void 0;
4
- const sleep = (msToSleep) => new Promise(resolve => {
5
- setTimeout(resolve, msToSleep);
6
- });
7
- exports.sleep = sleep;
@@ -1 +0,0 @@
1
- {"ignore_dirs":[]}