@coorpacademy/app-review 0.6.0 → 0.6.1-alpha.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.
Files changed (379) hide show
  1. package/lib/actions/api/fetch-correction.js +25 -0
  2. package/lib/actions/api/fetch-rank.js +43 -0
  3. package/lib/actions/api/fetch-skills.js +23 -0
  4. package/lib/actions/api/fetch-slide.js +38 -0
  5. package/lib/actions/api/post-answer.js +43 -0
  6. package/lib/actions/api/post-progression.js +27 -0
  7. package/lib/actions/data/token.js +9 -0
  8. package/lib/actions/ui/answers.js +61 -0
  9. package/lib/actions/ui/navigation.js +31 -0
  10. package/lib/actions/ui/next-slide.js +28 -0
  11. package/lib/actions/ui/quit-popin.js +11 -0
  12. package/lib/actions/ui/slides.js +9 -0
  13. package/lib/common/index.js +17 -0
  14. package/lib/configure-store.js +27 -0
  15. package/lib/helpers/css-register.js +7 -0
  16. package/lib/index.js +101 -0
  17. package/lib/reducers/data/corrections.js +26 -0
  18. package/lib/reducers/data/index.js +13 -0
  19. package/lib/reducers/data/progression.js +18 -0
  20. package/lib/reducers/data/rank.js +32 -0
  21. package/lib/reducers/data/skills.js +13 -0
  22. package/lib/reducers/data/slides.js +25 -0
  23. package/lib/reducers/data/token.js +13 -0
  24. package/lib/reducers/index.js +12 -0
  25. package/lib/reducers/ui/answers.js +27 -0
  26. package/lib/reducers/ui/current-slide-ref.js +18 -0
  27. package/lib/reducers/ui/index.js +22 -0
  28. package/lib/reducers/ui/navigation.js +20 -0
  29. package/lib/reducers/ui/positions.js +32 -0
  30. package/lib/reducers/ui/quit-popin.js +18 -0
  31. package/lib/reducers/ui/show-congrats.js +22 -0
  32. package/lib/reducers/ui/slide.js +53 -0
  33. package/lib/services/fetch-correction.js +21 -0
  34. package/lib/services/fetch-rank.js +17 -0
  35. package/lib/services/fetch-skills.js +17 -0
  36. package/lib/services/fetch-slide.js +17 -0
  37. package/lib/services/fetch-slides-to-review-by-skill-ref.js +15 -0
  38. package/lib/services/index.js +20 -0
  39. package/lib/services/post-answer.js +27 -0
  40. package/lib/services/post-progression.js +28 -0
  41. package/lib/services/tools/fetch-responses.js +40 -0
  42. package/lib/services/tools/sleep.js +7 -0
  43. package/lib/types/common.js +2 -0
  44. package/lib/types/slides.js +2 -0
  45. package/lib/{src/views → views}/skills/index.js +8 -4
  46. package/lib/views/slides/index.js +325 -0
  47. package/lib/views/slides/map-api-slide-to-ui.js +177 -0
  48. package/package.json +5 -13
  49. package/es/sandbox/index.d.ts +0 -9
  50. package/es/sandbox/index.js +0 -41
  51. package/es/src/actions/test/create-test-store.d.ts +0 -5
  52. package/es/src/actions/test/create-test-store.js +0 -16
  53. package/es/src/test/index.test.d.ts +0 -1
  54. package/es/src/test/index.test.js +0 -66
  55. package/es/src/test/util/services.mock.d.ts +0 -7
  56. package/es/src/test/util/services.mock.js +0 -444
  57. package/es/src/views/slides/test/fixtures/free-text.d.ts +0 -4
  58. package/es/src/views/slides/test/fixtures/free-text.js +0 -38
  59. package/es/src/views/slides/test/fixtures/qcm-drag.d.ts +0 -4
  60. package/es/src/views/slides/test/fixtures/qcm-drag.js +0 -108
  61. package/es/src/views/slides/test/fixtures/qcm-graphic.d.ts +0 -4
  62. package/es/src/views/slides/test/fixtures/qcm-graphic.js +0 -252
  63. package/es/src/views/slides/test/fixtures/qcm.d.ts +0 -4
  64. package/es/src/views/slides/test/fixtures/qcm.js +0 -109
  65. package/es/src/views/slides/test/fixtures/slider.d.ts +0 -4
  66. package/es/src/views/slides/test/fixtures/slider.js +0 -37
  67. package/es/src/views/slides/test/fixtures/template.d.ts +0 -4
  68. package/es/src/views/slides/test/fixtures/template.js +0 -170
  69. package/lib/sandbox/index.d.ts +0 -9
  70. package/lib/sandbox/index.js +0 -43
  71. package/lib/src/actions/api/fetch-correction.js +0 -19
  72. package/lib/src/actions/api/fetch-rank.js +0 -38
  73. package/lib/src/actions/api/fetch-skills.js +0 -17
  74. package/lib/src/actions/api/fetch-slide.js +0 -81
  75. package/lib/src/actions/api/post-answer.js +0 -92
  76. package/lib/src/actions/api/post-progression.js +0 -72
  77. package/lib/src/actions/data/token.js +0 -5
  78. package/lib/src/actions/test/create-test-store.d.ts +0 -5
  79. package/lib/src/actions/test/create-test-store.js +0 -18
  80. package/lib/src/actions/ui/answers.js +0 -65
  81. package/lib/src/actions/ui/navigation.js +0 -86
  82. package/lib/src/actions/ui/next-slide.js +0 -21
  83. package/lib/src/actions/ui/quit-popin.js +0 -8
  84. package/lib/src/actions/ui/slides.js +0 -5
  85. package/lib/src/common/index.js +0 -10
  86. package/lib/src/configure-store.js +0 -21
  87. package/lib/src/helpers/css-register.js +0 -2
  88. package/lib/src/index.js +0 -86
  89. package/lib/src/reducers/data/corrections.js +0 -22
  90. package/lib/src/reducers/data/index.js +0 -8
  91. package/lib/src/reducers/data/progression.js +0 -17
  92. package/lib/src/reducers/data/rank.js +0 -28
  93. package/lib/src/reducers/data/skills.js +0 -12
  94. package/lib/src/reducers/data/slides.js +0 -20
  95. package/lib/src/reducers/data/token.js +0 -12
  96. package/lib/src/reducers/index.js +0 -7
  97. package/lib/src/reducers/ui/answers.js +0 -25
  98. package/lib/src/reducers/ui/current-slide-ref.js +0 -17
  99. package/lib/src/reducers/ui/index.js +0 -17
  100. package/lib/src/reducers/ui/navigation.js +0 -28
  101. package/lib/src/reducers/ui/positions.js +0 -28
  102. package/lib/src/reducers/ui/quit-popin.js +0 -17
  103. package/lib/src/reducers/ui/show-congrats.js +0 -21
  104. package/lib/src/reducers/ui/slide.js +0 -48
  105. package/lib/src/services/fetch-correction.js +0 -58
  106. package/lib/src/services/fetch-rank.js +0 -54
  107. package/lib/src/services/fetch-skills.js +0 -54
  108. package/lib/src/services/fetch-slide.js +0 -54
  109. package/lib/src/services/fetch-slides-to-review-by-skill-ref.js +0 -52
  110. package/lib/src/services/index.js +0 -16
  111. package/lib/src/services/post-answer.js +0 -64
  112. package/lib/src/services/post-progression.js +0 -65
  113. package/lib/src/services/tools/fetch-responses.js +0 -112
  114. package/lib/src/services/tools/sleep.js +0 -5
  115. package/lib/src/test/index.test.d.ts +0 -1
  116. package/lib/src/test/index.test.js +0 -170
  117. package/lib/src/test/util/services.mock.d.ts +0 -7
  118. package/lib/src/test/util/services.mock.js +0 -448
  119. package/lib/src/types/common.js +0 -1
  120. package/lib/src/types/slides.js +0 -1
  121. package/lib/src/views/slides/index.js +0 -315
  122. package/lib/src/views/slides/map-api-slide-to-ui.js +0 -188
  123. package/lib/src/views/slides/test/fixtures/free-text.d.ts +0 -4
  124. package/lib/src/views/slides/test/fixtures/free-text.js +0 -38
  125. package/lib/src/views/slides/test/fixtures/qcm-drag.d.ts +0 -4
  126. package/lib/src/views/slides/test/fixtures/qcm-drag.js +0 -108
  127. package/lib/src/views/slides/test/fixtures/qcm-graphic.d.ts +0 -4
  128. package/lib/src/views/slides/test/fixtures/qcm-graphic.js +0 -252
  129. package/lib/src/views/slides/test/fixtures/qcm.d.ts +0 -4
  130. package/lib/src/views/slides/test/fixtures/qcm.js +0 -109
  131. package/lib/src/views/slides/test/fixtures/slider.d.ts +0 -4
  132. package/lib/src/views/slides/test/fixtures/slider.js +0 -37
  133. package/lib/src/views/slides/test/fixtures/template.d.ts +0 -4
  134. package/lib/src/views/slides/test/fixtures/template.js +0 -170
  135. package/src/actions/api/fetch-correction.ts +0 -39
  136. package/src/actions/api/fetch-rank.ts +0 -91
  137. package/src/actions/api/fetch-skills.ts +0 -31
  138. package/src/actions/api/fetch-slide.ts +0 -54
  139. package/src/actions/api/post-answer.ts +0 -55
  140. package/src/actions/api/post-progression.ts +0 -37
  141. package/src/actions/api/test/fetch-correction.test.ts +0 -119
  142. package/src/actions/api/test/fetch-rank.test.ts +0 -138
  143. package/src/actions/api/test/fetch-skills.test.ts +0 -78
  144. package/src/actions/api/test/fetch-slide.test.ts +0 -85
  145. package/src/actions/api/test/post-answer.test.ts +0 -266
  146. package/src/actions/api/test/post-progression.test.ts +0 -127
  147. package/src/actions/data/test/token.test.ts +0 -32
  148. package/src/actions/data/token.ts +0 -11
  149. package/src/actions/test/create-test-store.ts +0 -25
  150. package/src/actions/ui/answers.ts +0 -77
  151. package/src/actions/ui/navigation.ts +0 -62
  152. package/src/actions/ui/next-slide.ts +0 -44
  153. package/src/actions/ui/quit-popin.ts +0 -10
  154. package/src/actions/ui/slides.ts +0 -26
  155. package/src/actions/ui/test/answers.test.ts +0 -174
  156. package/src/actions/ui/test/navigation.test.ts +0 -95
  157. package/src/actions/ui/test/next-slide.test.ts +0 -87
  158. package/src/actions/ui/test/quit-popin.test.ts +0 -39
  159. package/src/actions/ui/test/slides.test.ts +0 -33
  160. package/src/common/index.ts +0 -15
  161. package/src/common/test/get-progression-slide-ref.test.ts +0 -35
  162. package/src/configure-store.ts +0 -28
  163. package/src/helpers/css-modules-require-hook.d.ts +0 -4
  164. package/src/helpers/css-register.ts +0 -3
  165. package/src/index.tsx +0 -107
  166. package/src/reducers/data/corrections.ts +0 -36
  167. package/src/reducers/data/index.ts +0 -19
  168. package/src/reducers/data/progression.ts +0 -23
  169. package/src/reducers/data/rank.ts +0 -44
  170. package/src/reducers/data/skills.ts +0 -16
  171. package/src/reducers/data/slides.ts +0 -31
  172. package/src/reducers/data/test/corrections.test.ts +0 -36
  173. package/src/reducers/data/test/progression.test.ts +0 -28
  174. package/src/reducers/data/test/rank.test.ts +0 -59
  175. package/src/reducers/data/test/skills.test.ts +0 -14
  176. package/src/reducers/data/test/slides.test.ts +0 -27
  177. package/src/reducers/data/test/token.test.ts +0 -13
  178. package/src/reducers/data/token.ts +0 -15
  179. package/src/reducers/index.ts +0 -14
  180. package/src/reducers/ui/answers.ts +0 -41
  181. package/src/reducers/ui/current-slide-ref.ts +0 -22
  182. package/src/reducers/ui/index.ts +0 -29
  183. package/src/reducers/ui/navigation.ts +0 -29
  184. package/src/reducers/ui/positions.ts +0 -34
  185. package/src/reducers/ui/quit-popin.ts +0 -22
  186. package/src/reducers/ui/show-congrats.ts +0 -26
  187. package/src/reducers/ui/slide.ts +0 -87
  188. package/src/reducers/ui/test/answers.test.ts +0 -105
  189. package/src/reducers/ui/test/current-slide-ref.test.ts +0 -14
  190. package/src/reducers/ui/test/navigation.test.ts +0 -19
  191. package/src/reducers/ui/test/positions.test.ts +0 -82
  192. package/src/reducers/ui/test/quit-popin.test.ts +0 -24
  193. package/src/reducers/ui/test/show-congrats.test.ts +0 -40
  194. package/src/reducers/ui/test/slide.test.ts +0 -110
  195. package/src/services/fetch-correction.ts +0 -26
  196. package/src/services/fetch-rank.ts +0 -14
  197. package/src/services/fetch-skills.ts +0 -14
  198. package/src/services/fetch-slide.ts +0 -14
  199. package/src/services/fetch-slides-to-review-by-skill-ref.ts +0 -18
  200. package/src/services/index.ts +0 -18
  201. package/src/services/post-answer.ts +0 -28
  202. package/src/services/post-progression.ts +0 -28
  203. package/src/services/test/fetch-correction.test.ts +0 -55
  204. package/src/services/test/fetch-rank.test.ts +0 -34
  205. package/src/services/test/fetch-skills.test.ts +0 -39
  206. package/src/services/test/fetch-slide.test.ts +0 -30
  207. package/src/services/test/fetch-slides-to-review-by-skill-ref.test.ts +0 -51
  208. package/src/services/test/post-answer.test.ts +0 -100
  209. package/src/services/test/post-progression.test.ts +0 -66
  210. package/src/services/tools/fetch-responses.ts +0 -40
  211. package/src/services/tools/sleep.ts +0 -4
  212. package/src/test/index.test.tsx +0 -99
  213. package/src/test/util/services.mock.ts +0 -465
  214. package/src/types/common.ts +0 -207
  215. package/src/types/globals.d.ts +0 -4
  216. package/src/types/slides.ts +0 -98
  217. package/src/views/skills/index.ts +0 -48
  218. package/src/views/skills/test/skills.test.ts +0 -104
  219. package/src/views/slides/index.ts +0 -398
  220. package/src/views/slides/map-api-slide-to-ui.ts +0 -287
  221. package/src/views/slides/test/fixtures/free-text.ts +0 -44
  222. package/src/views/slides/test/fixtures/qcm-drag.ts +0 -112
  223. package/src/views/slides/test/fixtures/qcm-graphic.ts +0 -264
  224. package/src/views/slides/test/fixtures/qcm.ts +0 -120
  225. package/src/views/slides/test/fixtures/slider.ts +0 -43
  226. package/src/views/slides/test/fixtures/template.ts +0 -177
  227. package/src/views/slides/test/header.on-click.test.ts +0 -46
  228. package/src/views/slides/test/index.test.ts +0 -1515
  229. package/src/views/slides/test/map-api-slide-to-ui.test.ts +0 -52
  230. package/src/views/slides/test/on-quit-popin.on-click.test.ts +0 -66
  231. package/src/views/slides/test/slide.free-text.on-change.test.ts +0 -116
  232. package/src/views/slides/test/slide.next-slide.on-click.test.ts +0 -178
  233. package/src/views/slides/test/slide.qcm-drag.on-click.test.ts +0 -90
  234. package/src/views/slides/test/slide.qcm-graphic.on-click.test.ts +0 -90
  235. package/src/views/slides/test/slide.qcm.on-click.test.ts +0 -92
  236. package/src/views/slides/test/slide.slider.on-change.test.ts +0 -92
  237. package/src/views/slides/test/slide.slider.on-slider-change.test.ts +0 -91
  238. package/src/views/slides/test/slide.template.on-change.test.ts +0 -126
  239. /package/es/{src/actions → actions}/api/fetch-correction.d.ts +0 -0
  240. /package/es/{src/actions → actions}/api/fetch-correction.js +0 -0
  241. /package/es/{src/actions → actions}/api/fetch-rank.d.ts +0 -0
  242. /package/es/{src/actions → actions}/api/fetch-rank.js +0 -0
  243. /package/es/{src/actions → actions}/api/fetch-skills.d.ts +0 -0
  244. /package/es/{src/actions → actions}/api/fetch-skills.js +0 -0
  245. /package/es/{src/actions → actions}/api/fetch-slide.d.ts +0 -0
  246. /package/es/{src/actions → actions}/api/fetch-slide.js +0 -0
  247. /package/es/{src/actions → actions}/api/post-answer.d.ts +0 -0
  248. /package/es/{src/actions → actions}/api/post-answer.js +0 -0
  249. /package/es/{src/actions → actions}/api/post-progression.d.ts +0 -0
  250. /package/es/{src/actions → actions}/api/post-progression.js +0 -0
  251. /package/es/{src/actions → actions}/data/token.d.ts +0 -0
  252. /package/es/{src/actions → actions}/data/token.js +0 -0
  253. /package/es/{src/actions → actions}/ui/answers.d.ts +0 -0
  254. /package/es/{src/actions → actions}/ui/answers.js +0 -0
  255. /package/es/{src/actions → actions}/ui/navigation.d.ts +0 -0
  256. /package/es/{src/actions → actions}/ui/navigation.js +0 -0
  257. /package/es/{src/actions → actions}/ui/next-slide.d.ts +0 -0
  258. /package/es/{src/actions → actions}/ui/next-slide.js +0 -0
  259. /package/es/{src/actions → actions}/ui/quit-popin.d.ts +0 -0
  260. /package/es/{src/actions → actions}/ui/quit-popin.js +0 -0
  261. /package/es/{src/actions → actions}/ui/slides.d.ts +0 -0
  262. /package/es/{src/actions → actions}/ui/slides.js +0 -0
  263. /package/es/{src/common → common}/index.d.ts +0 -0
  264. /package/es/{src/common → common}/index.js +0 -0
  265. /package/es/{src/configure-store.d.ts → configure-store.d.ts} +0 -0
  266. /package/es/{src/configure-store.js → configure-store.js} +0 -0
  267. /package/es/{src/helpers → helpers}/css-register.d.ts +0 -0
  268. /package/es/{src/helpers → helpers}/css-register.js +0 -0
  269. /package/es/{src/index.d.ts → index.d.ts} +0 -0
  270. /package/es/{src/index.js → index.js} +0 -0
  271. /package/es/{src/reducers → reducers}/data/corrections.d.ts +0 -0
  272. /package/es/{src/reducers → reducers}/data/corrections.js +0 -0
  273. /package/es/{src/reducers → reducers}/data/index.d.ts +0 -0
  274. /package/es/{src/reducers → reducers}/data/index.js +0 -0
  275. /package/es/{src/reducers → reducers}/data/progression.d.ts +0 -0
  276. /package/es/{src/reducers → reducers}/data/progression.js +0 -0
  277. /package/es/{src/reducers → reducers}/data/rank.d.ts +0 -0
  278. /package/es/{src/reducers → reducers}/data/rank.js +0 -0
  279. /package/es/{src/reducers → reducers}/data/skills.d.ts +0 -0
  280. /package/es/{src/reducers → reducers}/data/skills.js +0 -0
  281. /package/es/{src/reducers → reducers}/data/slides.d.ts +0 -0
  282. /package/es/{src/reducers → reducers}/data/slides.js +0 -0
  283. /package/es/{src/reducers → reducers}/data/token.d.ts +0 -0
  284. /package/es/{src/reducers → reducers}/data/token.js +0 -0
  285. /package/es/{src/reducers → reducers}/index.d.ts +0 -0
  286. /package/es/{src/reducers → reducers}/index.js +0 -0
  287. /package/es/{src/reducers → reducers}/ui/answers.d.ts +0 -0
  288. /package/es/{src/reducers → reducers}/ui/answers.js +0 -0
  289. /package/es/{src/reducers → reducers}/ui/current-slide-ref.d.ts +0 -0
  290. /package/es/{src/reducers → reducers}/ui/current-slide-ref.js +0 -0
  291. /package/es/{src/reducers → reducers}/ui/index.d.ts +0 -0
  292. /package/es/{src/reducers → reducers}/ui/index.js +0 -0
  293. /package/es/{src/reducers → reducers}/ui/navigation.d.ts +0 -0
  294. /package/es/{src/reducers → reducers}/ui/navigation.js +0 -0
  295. /package/es/{src/reducers → reducers}/ui/positions.d.ts +0 -0
  296. /package/es/{src/reducers → reducers}/ui/positions.js +0 -0
  297. /package/es/{src/reducers → reducers}/ui/quit-popin.d.ts +0 -0
  298. /package/es/{src/reducers → reducers}/ui/quit-popin.js +0 -0
  299. /package/es/{src/reducers → reducers}/ui/show-congrats.d.ts +0 -0
  300. /package/es/{src/reducers → reducers}/ui/show-congrats.js +0 -0
  301. /package/es/{src/reducers → reducers}/ui/slide.d.ts +0 -0
  302. /package/es/{src/reducers → reducers}/ui/slide.js +0 -0
  303. /package/es/{src/services → services}/fetch-correction.d.ts +0 -0
  304. /package/es/{src/services → services}/fetch-correction.js +0 -0
  305. /package/es/{src/services → services}/fetch-rank.d.ts +0 -0
  306. /package/es/{src/services → services}/fetch-rank.js +0 -0
  307. /package/es/{src/services → services}/fetch-skills.d.ts +0 -0
  308. /package/es/{src/services → services}/fetch-skills.js +0 -0
  309. /package/es/{src/services → services}/fetch-slide.d.ts +0 -0
  310. /package/es/{src/services → services}/fetch-slide.js +0 -0
  311. /package/es/{src/services → services}/fetch-slides-to-review-by-skill-ref.d.ts +0 -0
  312. /package/es/{src/services → services}/fetch-slides-to-review-by-skill-ref.js +0 -0
  313. /package/es/{src/services → services}/index.d.ts +0 -0
  314. /package/es/{src/services → services}/index.js +0 -0
  315. /package/es/{src/services → services}/post-answer.d.ts +0 -0
  316. /package/es/{src/services → services}/post-answer.js +0 -0
  317. /package/es/{src/services → services}/post-progression.d.ts +0 -0
  318. /package/es/{src/services → services}/post-progression.js +0 -0
  319. /package/es/{src/services → services}/tools/fetch-responses.d.ts +0 -0
  320. /package/es/{src/services → services}/tools/fetch-responses.js +0 -0
  321. /package/es/{src/services → services}/tools/sleep.d.ts +0 -0
  322. /package/es/{src/services → services}/tools/sleep.js +0 -0
  323. /package/es/{src/types → types}/common.d.ts +0 -0
  324. /package/es/{src/types → types}/common.js +0 -0
  325. /package/es/{src/types → types}/slides.d.ts +0 -0
  326. /package/es/{src/types → types}/slides.js +0 -0
  327. /package/es/{src/views → views}/skills/index.d.ts +0 -0
  328. /package/es/{src/views → views}/skills/index.js +0 -0
  329. /package/es/{src/views → views}/slides/index.d.ts +0 -0
  330. /package/es/{src/views → views}/slides/index.js +0 -0
  331. /package/es/{src/views → views}/slides/map-api-slide-to-ui.d.ts +0 -0
  332. /package/es/{src/views → views}/slides/map-api-slide-to-ui.js +0 -0
  333. /package/lib/{src/actions → actions}/api/fetch-correction.d.ts +0 -0
  334. /package/lib/{src/actions → actions}/api/fetch-rank.d.ts +0 -0
  335. /package/lib/{src/actions → actions}/api/fetch-skills.d.ts +0 -0
  336. /package/lib/{src/actions → actions}/api/fetch-slide.d.ts +0 -0
  337. /package/lib/{src/actions → actions}/api/post-answer.d.ts +0 -0
  338. /package/lib/{src/actions → actions}/api/post-progression.d.ts +0 -0
  339. /package/lib/{src/actions → actions}/data/token.d.ts +0 -0
  340. /package/lib/{src/actions → actions}/ui/answers.d.ts +0 -0
  341. /package/lib/{src/actions → actions}/ui/navigation.d.ts +0 -0
  342. /package/lib/{src/actions → actions}/ui/next-slide.d.ts +0 -0
  343. /package/lib/{src/actions → actions}/ui/quit-popin.d.ts +0 -0
  344. /package/lib/{src/actions → actions}/ui/slides.d.ts +0 -0
  345. /package/lib/{src/common → common}/index.d.ts +0 -0
  346. /package/lib/{src/configure-store.d.ts → configure-store.d.ts} +0 -0
  347. /package/lib/{src/helpers → helpers}/css-register.d.ts +0 -0
  348. /package/lib/{src/index.d.ts → index.d.ts} +0 -0
  349. /package/lib/{src/reducers → reducers}/data/corrections.d.ts +0 -0
  350. /package/lib/{src/reducers → reducers}/data/index.d.ts +0 -0
  351. /package/lib/{src/reducers → reducers}/data/progression.d.ts +0 -0
  352. /package/lib/{src/reducers → reducers}/data/rank.d.ts +0 -0
  353. /package/lib/{src/reducers → reducers}/data/skills.d.ts +0 -0
  354. /package/lib/{src/reducers → reducers}/data/slides.d.ts +0 -0
  355. /package/lib/{src/reducers → reducers}/data/token.d.ts +0 -0
  356. /package/lib/{src/reducers → reducers}/index.d.ts +0 -0
  357. /package/lib/{src/reducers → reducers}/ui/answers.d.ts +0 -0
  358. /package/lib/{src/reducers → reducers}/ui/current-slide-ref.d.ts +0 -0
  359. /package/lib/{src/reducers → reducers}/ui/index.d.ts +0 -0
  360. /package/lib/{src/reducers → reducers}/ui/navigation.d.ts +0 -0
  361. /package/lib/{src/reducers → reducers}/ui/positions.d.ts +0 -0
  362. /package/lib/{src/reducers → reducers}/ui/quit-popin.d.ts +0 -0
  363. /package/lib/{src/reducers → reducers}/ui/show-congrats.d.ts +0 -0
  364. /package/lib/{src/reducers → reducers}/ui/slide.d.ts +0 -0
  365. /package/lib/{src/services → services}/fetch-correction.d.ts +0 -0
  366. /package/lib/{src/services → services}/fetch-rank.d.ts +0 -0
  367. /package/lib/{src/services → services}/fetch-skills.d.ts +0 -0
  368. /package/lib/{src/services → services}/fetch-slide.d.ts +0 -0
  369. /package/lib/{src/services → services}/fetch-slides-to-review-by-skill-ref.d.ts +0 -0
  370. /package/lib/{src/services → services}/index.d.ts +0 -0
  371. /package/lib/{src/services → services}/post-answer.d.ts +0 -0
  372. /package/lib/{src/services → services}/post-progression.d.ts +0 -0
  373. /package/lib/{src/services → services}/tools/fetch-responses.d.ts +0 -0
  374. /package/lib/{src/services → services}/tools/sleep.d.ts +0 -0
  375. /package/lib/{src/types → types}/common.d.ts +0 -0
  376. /package/lib/{src/types → types}/slides.d.ts +0 -0
  377. /package/lib/{src/views → views}/skills/index.d.ts +0 -0
  378. /package/lib/{src/views → views}/slides/index.d.ts +0 -0
  379. /package/lib/{src/views → views}/slides/map-api-slide-to-ui.d.ts +0 -0
@@ -1,22 +0,0 @@
1
- import set from 'lodash/fp/set';
2
- import { CORRECTION_FETCH_SUCCESS, CORRECTION_FETCH_REQUEST } from '../../actions/api/fetch-correction';
3
- var initialState = {};
4
- var reducer = function (
5
- // eslint-disable-next-line default-param-last
6
- state, action) {
7
- if (state === void 0) { state = initialState; }
8
- switch (action.type) {
9
- case CORRECTION_FETCH_REQUEST: {
10
- var meta = action.meta;
11
- return set([meta.slideRef], null, state);
12
- }
13
- case CORRECTION_FETCH_SUCCESS: {
14
- var meta = action.meta;
15
- var correction = action.payload;
16
- return set([meta.slideRef], correction, state);
17
- }
18
- default:
19
- return state;
20
- }
21
- };
22
- export default reducer;
@@ -1,8 +0,0 @@
1
- import { combineReducers } from 'redux';
2
- import corrections from './corrections';
3
- import progression from './progression';
4
- import skills from './skills';
5
- import slides from './slides';
6
- import token from './token';
7
- import rank from './rank';
8
- export default combineReducers({ corrections: corrections, progression: progression, skills: skills, slides: slides, token: token, rank: rank });
@@ -1,17 +0,0 @@
1
- import { POST_ANSWER_SUCCESS } from '../../actions/api/post-answer';
2
- import { POST_PROGRESSION_SUCCESS } from '../../actions/api/post-progression';
3
- var reducer = function (
4
- // eslint-disable-next-line default-param-last
5
- state, action) {
6
- if (state === void 0) { state = null; }
7
- switch (action.type) {
8
- case POST_ANSWER_SUCCESS:
9
- case POST_PROGRESSION_SUCCESS: {
10
- var progression = action.payload;
11
- return progression;
12
- }
13
- default:
14
- return state;
15
- }
16
- };
17
- export default reducer;
@@ -1,28 +0,0 @@
1
- import set from 'lodash/fp/set';
2
- import { POST_PROGRESSION_SUCCESS } from '../../actions/api/post-progression';
3
- import { RANK_FETCH_START_SUCCESS, RANK_FETCH_END_SUCCESS } from '../../actions/api/fetch-rank';
4
- var initialState = {
5
- start: Number.NaN,
6
- end: Number.NaN
7
- };
8
- var reducer = function (
9
- // eslint-disable-next-line default-param-last
10
- state, action) {
11
- if (state === void 0) { state = initialState; }
12
- switch (action.type) {
13
- case POST_PROGRESSION_SUCCESS: {
14
- return initialState;
15
- }
16
- case RANK_FETCH_START_SUCCESS: {
17
- var payload = action.payload;
18
- return set('start', payload.rank, state);
19
- }
20
- case RANK_FETCH_END_SUCCESS: {
21
- var payload = action.payload;
22
- return set('end', payload.rank, state);
23
- }
24
- default:
25
- return state;
26
- }
27
- };
28
- export default reducer;
@@ -1,12 +0,0 @@
1
- import { SKILLS_FETCH_SUCCESS } from '../../actions/api/fetch-skills';
2
- // eslint-disable-next-line default-param-last
3
- var reducer = function (state, action) {
4
- if (state === void 0) { state = []; }
5
- switch (action.type) {
6
- case SKILLS_FETCH_SUCCESS:
7
- return action.payload;
8
- default:
9
- return state;
10
- }
11
- };
12
- export default reducer;
@@ -1,20 +0,0 @@
1
- import set from 'lodash/fp/set';
2
- import { SLIDE_FETCH_REQUEST, SLIDE_FETCH_SUCCESS } from '../../actions/api/fetch-slide';
3
- export var initialState = {};
4
- // eslint-disable-next-line default-param-last
5
- var reducer = function (state, action) {
6
- if (state === void 0) { state = initialState; }
7
- switch (action.type) {
8
- case SLIDE_FETCH_REQUEST: {
9
- var meta = action.meta;
10
- return set([meta.slideRef], null, state);
11
- }
12
- case SLIDE_FETCH_SUCCESS: {
13
- var slide = action.payload;
14
- return set([slide._id], slide, state);
15
- }
16
- default:
17
- return state;
18
- }
19
- };
20
- export default reducer;
@@ -1,12 +0,0 @@
1
- import { STORE_TOKEN } from '../../actions/data/token';
2
- // eslint-disable-next-line default-param-last
3
- var reducer = function (state, action) {
4
- if (state === void 0) { state = ''; }
5
- switch (action.type) {
6
- case STORE_TOKEN:
7
- return action.payload;
8
- default:
9
- return state;
10
- }
11
- };
12
- export default reducer;
@@ -1,7 +0,0 @@
1
- import { combineReducers } from 'redux';
2
- import data from './data';
3
- import ui from './ui';
4
- export default combineReducers({
5
- data: data,
6
- ui: ui
7
- });
@@ -1,25 +0,0 @@
1
- import { set } from 'lodash/fp';
2
- import { EDIT_BASIC, EDIT_QCM, EDIT_QCM_DRAG, EDIT_QCM_GRAPHIC, EDIT_SLIDER, EDIT_TEMPLATE } from '../../actions/ui/answers';
3
- import { NEXT_SLIDE } from '../../actions/ui/next-slide';
4
- export var initialState = {};
5
- var reducer = function (
6
- // eslint-disable-next-line default-param-last
7
- state, action) {
8
- if (state === void 0) { state = initialState; }
9
- switch (action.type) {
10
- case EDIT_QCM:
11
- case EDIT_QCM_GRAPHIC:
12
- case EDIT_QCM_DRAG:
13
- case EDIT_TEMPLATE:
14
- case EDIT_BASIC:
15
- case EDIT_SLIDER: {
16
- return set([action.meta.slideRef], action.payload, initialState);
17
- }
18
- case NEXT_SLIDE: {
19
- return set([action.payload.nextSlideRef], [], state);
20
- }
21
- default:
22
- return state;
23
- }
24
- };
25
- export default reducer;
@@ -1,17 +0,0 @@
1
- import { NEXT_SLIDE } from '../../actions/ui/next-slide';
2
- import { SET_CURRENT_SLIDE } from '../../actions/ui/slides';
3
- var reducer = function (
4
- // eslint-disable-next-line default-param-last
5
- state, action) {
6
- if (state === void 0) { state = ''; }
7
- switch (action.type) {
8
- case NEXT_SLIDE:
9
- return action.payload.nextSlideRef;
10
- case SET_CURRENT_SLIDE: {
11
- return action.payload._id;
12
- }
13
- default:
14
- return state;
15
- }
16
- };
17
- export default reducer;
@@ -1,17 +0,0 @@
1
- import { combineReducers } from 'redux';
2
- import currentSlideRef from './current-slide-ref';
3
- import navigation from './navigation';
4
- import answers from './answers';
5
- import positions from './positions';
6
- import slide from './slide';
7
- import showQuitPopin from './quit-popin';
8
- import showCongrats from './show-congrats';
9
- export default combineReducers({
10
- currentSlideRef: currentSlideRef,
11
- navigation: navigation,
12
- answers: answers,
13
- slide: slide,
14
- positions: positions,
15
- showQuitPopin: showQuitPopin,
16
- showCongrats: showCongrats
17
- });
@@ -1,28 +0,0 @@
1
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
2
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
3
- if (ar || !(i in from)) {
4
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
5
- ar[i] = from[i];
6
- }
7
- }
8
- return to.concat(ar || Array.prototype.slice.call(from));
9
- };
10
- import { NAVIGATE_TO, NAVIGATE_BACK } from '../../actions/ui/navigation';
11
- var reducer = function (
12
- // eslint-disable-next-line default-param-last
13
- state, action) {
14
- if (state === void 0) { state = []; }
15
- switch (action.type) {
16
- case NAVIGATE_TO: {
17
- return __spreadArray(__spreadArray([], state, true), [action.payload], false);
18
- }
19
- case NAVIGATE_BACK: {
20
- var newState = __spreadArray([], state, true);
21
- newState.pop();
22
- return newState;
23
- }
24
- default:
25
- return state;
26
- }
27
- };
28
- export default reducer;
@@ -1,28 +0,0 @@
1
- import findIndex from 'lodash/fp/findIndex';
2
- import map from 'lodash/fp/map';
3
- import set from 'lodash/fp/set';
4
- import { POST_PROGRESSION_SUCCESS } from '../../actions/api/post-progression';
5
- import { NEXT_SLIDE } from '../../actions/ui/next-slide';
6
- var initialState = [0, 1, 2, 3, 4];
7
- var reducer = function (
8
- // eslint-disable-next-line default-param-last
9
- state, action) {
10
- if (state === void 0) { state = initialState; }
11
- switch (action.type) {
12
- case POST_PROGRESSION_SUCCESS: {
13
- return initialState;
14
- }
15
- case NEXT_SLIDE: {
16
- var _a = action.payload, totalCorrectAnswers = _a.totalCorrectAnswers, answeredSlides = _a.answeredSlides, currentSlideRef_1 = _a.currentSlideRef, animationType = _a.animationType, nextSlideRef = _a.nextSlideRef;
17
- if (nextSlideRef === 'successExitNode')
18
- return state;
19
- var nextCurrentSlidePosition = animationType === 'unstack' ? -1 : 4 - totalCorrectAnswers;
20
- var currentSlideIndex = findIndex(function (ref) { return ref === currentSlideRef_1; }, answeredSlides);
21
- var newState = map(function (position) { return (position === -1 ? position : position - 1); }, state);
22
- return set(["".concat(currentSlideIndex)], nextCurrentSlidePosition)(newState);
23
- }
24
- default:
25
- return state;
26
- }
27
- };
28
- export default reducer;
@@ -1,17 +0,0 @@
1
- import { CLOSE_POPIN, OPEN_POPIN } from '../../actions/ui/quit-popin';
2
- var reducer = function (
3
- // eslint-disable-next-line default-param-last
4
- state, action) {
5
- if (state === void 0) { state = false; }
6
- switch (action.type) {
7
- case OPEN_POPIN: {
8
- return true;
9
- }
10
- case CLOSE_POPIN: {
11
- return false;
12
- }
13
- default:
14
- return state;
15
- }
16
- };
17
- export default reducer;
@@ -1,21 +0,0 @@
1
- import { NEXT_SLIDE } from '../../actions/ui/next-slide';
2
- import { POST_PROGRESSION_SUCCESS } from '../../actions/api/post-progression';
3
- var reducer = function (
4
- // eslint-disable-next-line default-param-last
5
- state, action) {
6
- if (state === void 0) { state = false; }
7
- switch (action.type) {
8
- case POST_PROGRESSION_SUCCESS: {
9
- return false;
10
- }
11
- case NEXT_SLIDE: {
12
- var nextSlideRef = action.payload.nextSlideRef;
13
- if (nextSlideRef === 'successExitNode')
14
- return true;
15
- return false;
16
- }
17
- default:
18
- return state;
19
- }
20
- };
21
- export default reducer;
@@ -1,48 +0,0 @@
1
- import compact from 'lodash/fp/compact';
2
- import isEmpty from 'lodash/fp/isEmpty';
3
- import pipe from 'lodash/fp/pipe';
4
- import set from 'lodash/fp/set';
5
- import unset from 'lodash/fp/unset';
6
- import { EDIT_BASIC, EDIT_QCM, EDIT_QCM_DRAG, EDIT_QCM_GRAPHIC, EDIT_SLIDER, EDIT_TEMPLATE } from '../../actions/ui/answers';
7
- import { POST_ANSWER_REQUEST } from '../../actions/api/post-answer';
8
- import { CORRECTION_FETCH_SUCCESS } from '../../actions/api/fetch-correction';
9
- import { SLIDE_FETCH_REQUEST } from '../../actions/api/fetch-slide';
10
- import { NEXT_SLIDE } from '../../actions/ui/next-slide';
11
- export var initialState = {};
12
- var reducer = function (
13
- // eslint-disable-next-line default-param-last
14
- state, action) {
15
- if (state === void 0) { state = initialState; }
16
- switch (action.type) {
17
- case SLIDE_FETCH_REQUEST: {
18
- return pipe(unset([action.meta.slideRef, 'animationType']), set([action.meta.slideRef], {
19
- validateButton: false,
20
- animateCorrectionPopin: false,
21
- showCorrectionPopin: false
22
- }))(state);
23
- }
24
- case EDIT_QCM:
25
- case EDIT_QCM_GRAPHIC:
26
- case EDIT_QCM_DRAG:
27
- case EDIT_TEMPLATE:
28
- case EDIT_BASIC:
29
- case EDIT_SLIDER: {
30
- return set([action.meta.slideRef, 'validateButton'], !pipe(compact, isEmpty)(action.payload), state);
31
- }
32
- case POST_ANSWER_REQUEST: {
33
- return set([action.meta.slideRef, 'validateButton'], false, state);
34
- }
35
- case CORRECTION_FETCH_SUCCESS: {
36
- return pipe(set([action.meta.slideRef, 'animateCorrectionPopin'], true), set([action.meta.slideRef, 'showCorrectionPopin'], true))(state);
37
- }
38
- case NEXT_SLIDE: {
39
- var _a = action.payload, currentSlideRef = _a.currentSlideRef, nextSlideRef = _a.nextSlideRef;
40
- if (nextSlideRef === 'successExitNode')
41
- return state;
42
- return pipe(set([currentSlideRef, 'animateCorrectionPopin'], false), set([currentSlideRef, 'animationType'], action.payload.animationType))(state);
43
- }
44
- default:
45
- return state;
46
- }
47
- };
48
- export default reducer;
@@ -1,58 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- var __generator = (this && this.__generator) || function (thisArg, body) {
11
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
12
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
- function verb(n) { return function (v) { return step([n, v]); }; }
14
- function step(op) {
15
- if (f) throw new TypeError("Generator is already executing.");
16
- while (_) try {
17
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
18
- if (y = 0, t) op = [op[0] & 2, t.value];
19
- switch (op[0]) {
20
- case 0: case 1: t = op; break;
21
- case 4: _.label++; return { value: op[1], done: false };
22
- case 5: _.label++; y = op[1]; op = [0]; continue;
23
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
- default:
25
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
- if (t[2]) _.ops.pop();
30
- _.trys.pop(); continue;
31
- }
32
- op = body.call(thisArg, _);
33
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
- }
36
- };
37
- import crossFetch from 'cross-fetch';
38
- import decode from 'jwt-decode';
39
- import { toJSON } from './tools/fetch-responses';
40
- export var fetchCorrection = function (slideRef, token, progressionId, answer) { return __awaiter(void 0, void 0, void 0, function () {
41
- var host, response;
42
- return __generator(this, function (_a) {
43
- switch (_a.label) {
44
- case 0:
45
- host = decode(token).host;
46
- return [4 /*yield*/, crossFetch("".concat(host, "/api/v2/progressions/").concat(progressionId, "/answers/").concat(slideRef), {
47
- method: 'post',
48
- headers: { authorization: token },
49
- body: JSON.stringify({
50
- answer: answer
51
- })
52
- })];
53
- case 1:
54
- response = _a.sent();
55
- return [2 /*return*/, toJSON(response)];
56
- }
57
- });
58
- }); };
@@ -1,54 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- var __generator = (this && this.__generator) || function (thisArg, body) {
11
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
12
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
- function verb(n) { return function (v) { return step([n, v]); }; }
14
- function step(op) {
15
- if (f) throw new TypeError("Generator is already executing.");
16
- while (_) try {
17
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
18
- if (y = 0, t) op = [op[0] & 2, t.value];
19
- switch (op[0]) {
20
- case 0: case 1: t = op; break;
21
- case 4: _.label++; return { value: op[1], done: false };
22
- case 5: _.label++; y = op[1]; op = [0]; continue;
23
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
- default:
25
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
- if (t[2]) _.ops.pop();
30
- _.trys.pop(); continue;
31
- }
32
- op = body.call(thisArg, _);
33
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
- }
36
- };
37
- import crossFetch from 'cross-fetch';
38
- import decode from 'jwt-decode';
39
- import { toJSON } from './tools/fetch-responses';
40
- export var fetchRank = function (token) { return __awaiter(void 0, void 0, void 0, function () {
41
- var _a, userId, host, response;
42
- return __generator(this, function (_b) {
43
- switch (_b.label) {
44
- case 0:
45
- _a = decode(token), userId = _a.user, host = _a.host;
46
- return [4 /*yield*/, crossFetch("".concat(host, "/api/v1/leaderboard/rank/").concat(userId, "?group=ALL"), {
47
- headers: { authorization: token }
48
- })];
49
- case 1:
50
- response = _b.sent();
51
- return [2 /*return*/, toJSON(response)];
52
- }
53
- });
54
- }); };
@@ -1,54 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- var __generator = (this && this.__generator) || function (thisArg, body) {
11
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
12
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
- function verb(n) { return function (v) { return step([n, v]); }; }
14
- function step(op) {
15
- if (f) throw new TypeError("Generator is already executing.");
16
- while (_) try {
17
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
18
- if (y = 0, t) op = [op[0] & 2, t.value];
19
- switch (op[0]) {
20
- case 0: case 1: t = op; break;
21
- case 4: _.label++; return { value: op[1], done: false };
22
- case 5: _.label++; y = op[1]; op = [0]; continue;
23
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
- default:
25
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
- if (t[2]) _.ops.pop();
30
- _.trys.pop(); continue;
31
- }
32
- op = body.call(thisArg, _);
33
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
- }
36
- };
37
- import crossFetch from 'cross-fetch';
38
- import decode from 'jwt-decode';
39
- import { toJSON } from './tools/fetch-responses';
40
- export var fetchSkills = function (token) { return __awaiter(void 0, void 0, void 0, function () {
41
- var _a, userId, host, response;
42
- return __generator(this, function (_b) {
43
- switch (_b.label) {
44
- case 0:
45
- _a = decode(token), userId = _a.user, host = _a.host;
46
- return [4 /*yield*/, crossFetch("".concat(host, "/api/v2/skills/review/user/").concat(userId), {
47
- headers: { authorization: token }
48
- })];
49
- case 1:
50
- response = _b.sent();
51
- return [2 /*return*/, toJSON(response)];
52
- }
53
- });
54
- }); };
@@ -1,54 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- var __generator = (this && this.__generator) || function (thisArg, body) {
11
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
12
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
- function verb(n) { return function (v) { return step([n, v]); }; }
14
- function step(op) {
15
- if (f) throw new TypeError("Generator is already executing.");
16
- while (_) try {
17
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
18
- if (y = 0, t) op = [op[0] & 2, t.value];
19
- switch (op[0]) {
20
- case 0: case 1: t = op; break;
21
- case 4: _.label++; return { value: op[1], done: false };
22
- case 5: _.label++; y = op[1]; op = [0]; continue;
23
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
- default:
25
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
- if (t[2]) _.ops.pop();
30
- _.trys.pop(); continue;
31
- }
32
- op = body.call(thisArg, _);
33
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
- }
36
- };
37
- import crossFetch from 'cross-fetch';
38
- import decode from 'jwt-decode';
39
- import { toJSON } from './tools/fetch-responses';
40
- export var fetchSlide = function (slideRef, token) { return __awaiter(void 0, void 0, void 0, function () {
41
- var host, response;
42
- return __generator(this, function (_a) {
43
- switch (_a.label) {
44
- case 0:
45
- host = decode(token).host;
46
- return [4 /*yield*/, crossFetch("".concat(host, "/api/v1/slides/").concat(slideRef, "/parentContentTitle"), {
47
- headers: { authorization: token }
48
- })];
49
- case 1:
50
- response = _a.sent();
51
- return [2 /*return*/, toJSON(response)];
52
- }
53
- });
54
- }); };
@@ -1,52 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- var __generator = (this && this.__generator) || function (thisArg, body) {
11
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
12
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
- function verb(n) { return function (v) { return step([n, v]); }; }
14
- function step(op) {
15
- if (f) throw new TypeError("Generator is already executing.");
16
- while (_) try {
17
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
18
- if (y = 0, t) op = [op[0] & 2, t.value];
19
- switch (op[0]) {
20
- case 0: case 1: t = op; break;
21
- case 4: _.label++; return { value: op[1], done: false };
22
- case 5: _.label++; y = op[1]; op = [0]; continue;
23
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
- default:
25
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
- if (t[2]) _.ops.pop();
30
- _.trys.pop(); continue;
31
- }
32
- op = body.call(thisArg, _);
33
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
- }
36
- };
37
- import crossFetch from 'cross-fetch';
38
- import decode from 'jwt-decode';
39
- import { toJSON } from './tools/fetch-responses';
40
- export var fetchSlidesToReviewBySkillRef = function (url, token, skillRef) { return __awaiter(void 0, void 0, void 0, function () {
41
- var userId, response;
42
- return __generator(this, function (_a) {
43
- switch (_a.label) {
44
- case 0:
45
- userId = decode(token).user;
46
- return [4 /*yield*/, crossFetch("".concat(url, "/api/v1/review/users/").concat(userId, "/skills/").concat(skillRef, "/slide?limit=5&offset=0"))];
47
- case 1:
48
- response = _a.sent();
49
- return [2 /*return*/, toJSON(response)];
50
- }
51
- });
52
- }); };
@@ -1,16 +0,0 @@
1
- import { fetchCorrection } from './fetch-correction';
2
- import { fetchRank } from './fetch-rank';
3
- import { fetchSkills } from './fetch-skills';
4
- import { fetchSlide } from './fetch-slide';
5
- import { fetchSlidesToReviewBySkillRef } from './fetch-slides-to-review-by-skill-ref';
6
- import { postAnswer } from './post-answer';
7
- import { postProgression } from './post-progression';
8
- export var getServices = function () { return ({
9
- fetchCorrection: fetchCorrection,
10
- fetchRank: fetchRank,
11
- fetchSkills: fetchSkills,
12
- fetchSlide: fetchSlide,
13
- fetchSlidesToReviewBySkillRef: fetchSlidesToReviewBySkillRef,
14
- postAnswer: postAnswer,
15
- postProgression: postProgression
16
- }); };