@royalschedule/maps 3.3.16 → 4.0.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 (949) hide show
  1. package/README.md +1 -0
  2. package/dist/Additio/from/courses.js.map +1 -1
  3. package/dist/Additio/from/events.js.map +1 -1
  4. package/dist/Additio/from/groups.js.map +1 -1
  5. package/dist/Additio/from/index.js.map +1 -1
  6. package/dist/Additio/from/locations.js.map +1 -1
  7. package/dist/Additio/from/persons.js +1 -1
  8. package/dist/Additio/from/persons.js.map +1 -1
  9. package/dist/Additio/from/schedules.d.ts +32 -2
  10. package/dist/Additio/from/schedules.js.map +1 -1
  11. package/dist/Additio/from/teachers.js.map +1 -1
  12. package/dist/Additio/index.js.map +1 -1
  13. package/dist/Additio/to/index.d.ts +13 -13
  14. package/dist/Additio/to/index.js.map +1 -1
  15. package/dist/Additio/to/schedules.js +44 -46
  16. package/dist/Additio/to/schedules.js.map +1 -1
  17. package/dist/Additio/types/index.d.ts +2 -0
  18. package/dist/Additio/types/options.d.ts +8 -0
  19. package/dist/Additio/types/schedules.d.ts +1 -5
  20. package/dist/Admentum/from/courses.js.map +1 -1
  21. package/dist/Admentum/from/events.js.map +1 -1
  22. package/dist/Admentum/from/groups.js.map +1 -1
  23. package/dist/Admentum/from/index.js.map +1 -1
  24. package/dist/Admentum/from/locations.js.map +1 -1
  25. package/dist/Admentum/from/persons.js +1 -1
  26. package/dist/Admentum/from/persons.js.map +1 -1
  27. package/dist/Admentum/from/schedules.d.ts +32 -2
  28. package/dist/Admentum/from/schedules.js.map +1 -1
  29. package/dist/Admentum/from/teachers.js.map +1 -1
  30. package/dist/Admentum/index.js.map +1 -1
  31. package/dist/Admentum/to/index.d.ts +11 -10
  32. package/dist/Admentum/to/index.js.map +1 -1
  33. package/dist/Admentum/to/schedules.js +22 -25
  34. package/dist/Admentum/to/schedules.js.map +1 -1
  35. package/dist/Excel/index.d.ts +55 -4
  36. package/dist/Excel/index.js.map +1 -1
  37. package/dist/Excel/v1/from/index.js +7 -7
  38. package/dist/Excel/v1/from/index.js.map +1 -1
  39. package/dist/Excel/v1/index.d.ts +30 -2
  40. package/dist/Excel/v1/index.js.map +1 -1
  41. package/dist/Excel/v2/from/index.js +10 -10
  42. package/dist/Excel/v2/from/index.js.map +1 -1
  43. package/dist/Excel/v2/index.d.ts +53 -2
  44. package/dist/Excel/v2/index.js.map +1 -1
  45. package/dist/IdunSoft/from/courses.js +4 -3
  46. package/dist/IdunSoft/from/courses.js.map +1 -1
  47. package/dist/IdunSoft/from/events.js +43 -32
  48. package/dist/IdunSoft/from/events.js.map +1 -1
  49. package/dist/IdunSoft/from/groups.js +5 -4
  50. package/dist/IdunSoft/from/groups.js.map +1 -1
  51. package/dist/IdunSoft/from/index.js.map +1 -1
  52. package/dist/IdunSoft/from/locations.js +4 -3
  53. package/dist/IdunSoft/from/locations.js.map +1 -1
  54. package/dist/IdunSoft/from/schedules.d.ts +18 -3
  55. package/dist/IdunSoft/from/schedules.js +5 -10
  56. package/dist/IdunSoft/from/schedules.js.map +1 -1
  57. package/dist/IdunSoft/from/teachers.js +4 -3
  58. package/dist/IdunSoft/from/teachers.js.map +1 -1
  59. package/dist/IdunSoft/index.js.map +1 -1
  60. package/dist/IdunSoft/to/index.d.ts +2 -3
  61. package/dist/IdunSoft/to/index.js.map +1 -1
  62. package/dist/IdunSoft/to/schedules.js +22 -21
  63. package/dist/IdunSoft/to/schedules.js.map +1 -1
  64. package/dist/InfoMentor/index.js.map +1 -1
  65. package/dist/InfoMentor/to/index.d.ts +2 -2
  66. package/dist/InfoMentor/to/index.js.map +1 -1
  67. package/dist/InfoMentor/to/schedules.js +26 -27
  68. package/dist/InfoMentor/to/schedules.js.map +1 -1
  69. package/dist/PlanDigital/from/index.js.map +1 -1
  70. package/dist/PlanDigital/from/schedules.js +7 -6
  71. package/dist/PlanDigital/from/schedules.js.map +1 -1
  72. package/dist/PlanDigital/index.d.ts +106 -5
  73. package/dist/PlanDigital/index.js +0 -2
  74. package/dist/PlanDigital/index.js.map +1 -1
  75. package/dist/PlanDigital/types/index.d.ts +12 -11
  76. package/dist/Quiculum/file/to/index.d.ts +1 -1
  77. package/dist/Quiculum/file/to/schedules.js +11 -13
  78. package/dist/Quiculum/file/to/schedules.js.map +1 -1
  79. package/dist/RS/from/division.d.ts +7 -0
  80. package/dist/RS/from/division.js +14 -0
  81. package/dist/RS/from/division.js.map +1 -0
  82. package/dist/RS/from/index.js +12 -0
  83. package/dist/RS/from/index.js.map +1 -0
  84. package/dist/RS/from/schedules.d.ts +8 -0
  85. package/dist/RS/from/schedules.js +36 -0
  86. package/dist/RS/from/schedules.js.map +1 -0
  87. package/dist/RS/index.d.ts +11 -12
  88. package/dist/RS/index.js +4 -8
  89. package/dist/RS/index.js.map +1 -1
  90. package/dist/RS/make-connected.d.ts +24 -0
  91. package/dist/RS/make-connected.js +258 -0
  92. package/dist/RS/make-connected.js.map +1 -0
  93. package/dist/RS/to/index.js +8 -0
  94. package/dist/RS/to/index.js.map +1 -0
  95. package/dist/RS/to/initial-configuration.js +43 -0
  96. package/dist/RS/to/initial-configuration.js.map +1 -0
  97. package/dist/RS/to/input/collections.js +57 -0
  98. package/dist/RS/to/input/collections.js.map +1 -0
  99. package/dist/RS/{v3/to → to/input}/default.js +10 -18
  100. package/dist/RS/to/input/default.js.map +1 -0
  101. package/dist/RS/to/input/dependencies.js +32 -0
  102. package/dist/RS/to/input/dependencies.js.map +1 -0
  103. package/dist/RS/to/input/dynamic-locked-times.js +67 -0
  104. package/dist/RS/to/input/dynamic-locked-times.js.map +1 -0
  105. package/dist/RS/to/input/events.js +84 -0
  106. package/dist/RS/to/input/events.js.map +1 -0
  107. package/dist/RS/to/input/groups.js +36 -0
  108. package/dist/RS/to/input/groups.js.map +1 -0
  109. package/dist/RS/to/input/individuals.js +49 -0
  110. package/dist/RS/to/input/individuals.js.map +1 -0
  111. package/dist/RS/to/input/input.js +40 -0
  112. package/dist/RS/to/input/input.js.map +1 -0
  113. package/dist/RS/to/input/intervals.js +99 -0
  114. package/dist/RS/to/input/intervals.js.map +1 -0
  115. package/dist/RS/to/input/periods.js +44 -0
  116. package/dist/RS/to/input/periods.js.map +1 -0
  117. package/dist/RS/to/input/settings.js +17 -0
  118. package/dist/RS/to/input/settings.js.map +1 -0
  119. package/dist/RS/to/input/teachers.js +36 -0
  120. package/dist/RS/to/input/teachers.js.map +1 -0
  121. package/dist/RS/to/input/util/attach-locked-times.js +27 -0
  122. package/dist/RS/to/input/util/attach-locked-times.js.map +1 -0
  123. package/dist/RS/to/input/util/parse-days.js +10 -0
  124. package/dist/RS/to/input/util/parse-days.js.map +1 -0
  125. package/dist/RS/to/input/util/parse-group-references.js +58 -0
  126. package/dist/RS/to/input/util/parse-group-references.js.map +1 -0
  127. package/dist/RS/to/input/util/parse-intervals.js +55 -0
  128. package/dist/RS/to/input/util/parse-intervals.js.map +1 -0
  129. package/dist/RS/to/input/util/parse-location-references.js +31 -0
  130. package/dist/RS/to/input/util/parse-location-references.js.map +1 -0
  131. package/dist/RS/to/input/util/parse-max-working-hours.js +17 -0
  132. package/dist/RS/to/input/util/parse-max-working-hours.js.map +1 -0
  133. package/dist/RS/to/input/util/parse-minimum-break-length.js +19 -0
  134. package/dist/RS/to/input/util/parse-minimum-break-length.js.map +1 -0
  135. package/dist/RS/to/input/util/util.js +61 -0
  136. package/dist/RS/to/input/util/util.js.map +1 -0
  137. package/dist/RS/to/schedules.d.ts +7 -0
  138. package/dist/RS/to/schedules.js +40 -0
  139. package/dist/RS/to/schedules.js.map +1 -0
  140. package/dist/RS/{v3/types → types}/algorithm-parameters.d.ts +1 -1
  141. package/dist/RS/types/collections.d.ts +26 -0
  142. package/dist/RS/types/configurations.d.ts +10 -0
  143. package/dist/RS/{v3/types → types}/default.d.ts +4 -5
  144. package/dist/RS/types/dependencies.d.ts +16 -0
  145. package/dist/RS/types/event-configuration.d.ts +17 -0
  146. package/dist/RS/types/events.d.ts +27 -0
  147. package/dist/RS/{v2/types → types}/groups.d.ts +11 -12
  148. package/dist/RS/types/index.d.ts +45 -0
  149. package/dist/RS/types/individuals.d.ts +16 -0
  150. package/dist/RS/{v2/types → types}/locked-times.d.ts +2 -1
  151. package/dist/RS/types/root-intervals.d.ts +10 -0
  152. package/dist/RS/types/schedule-data.d.ts +16 -0
  153. package/dist/RS/{v2/types → types}/settings.d.ts +1 -1
  154. package/dist/RS/types/shared.d.ts +27 -0
  155. package/dist/RS/types/to.d.ts +44 -0
  156. package/dist/SchoolSoft/api/from/index.js.map +1 -1
  157. package/dist/SchoolSoft/api/from/schedules.js +31 -37
  158. package/dist/SchoolSoft/api/from/schedules.js.map +1 -1
  159. package/dist/SchoolSoft/api/index.d.ts +14 -2
  160. package/dist/SchoolSoft/api/index.js.map +1 -1
  161. package/dist/SchoolSoft/file/from/index.js.map +1 -1
  162. package/dist/SchoolSoft/file/from/schedules.js +36 -46
  163. package/dist/SchoolSoft/file/from/schedules.js.map +1 -1
  164. package/dist/SchoolSoft/file/index.d.ts +2 -3
  165. package/dist/SchoolSoft/file/index.js.map +1 -1
  166. package/dist/SchoolSoft/file/to/index.d.ts +6 -13
  167. package/dist/SchoolSoft/file/to/schedules.js +40 -42
  168. package/dist/SchoolSoft/file/to/schedules.js.map +1 -1
  169. package/dist/SchoolSoft/index.d.ts +2 -3
  170. package/dist/SchoolSoft/index.js.map +1 -1
  171. package/dist/Schoolity/txt/index.js.map +1 -1
  172. package/dist/Schoolity/txt/to/index.d.ts +3 -3
  173. package/dist/Schoolity/txt/to/index.js.map +1 -1
  174. package/dist/Schoolity/txt/to/schedules.js +78 -96
  175. package/dist/Schoolity/txt/to/schedules.js.map +1 -1
  176. package/dist/Skola24/index.js.map +1 -1
  177. package/dist/Skola24/mdb/from/course-and-events.js +36 -29
  178. package/dist/Skola24/mdb/from/course-and-events.js.map +1 -1
  179. package/dist/Skola24/mdb/from/groups.js.map +1 -1
  180. package/dist/Skola24/mdb/from/index.js.map +1 -1
  181. package/dist/Skola24/mdb/from/locations.js.map +1 -1
  182. package/dist/Skola24/mdb/from/schedule.d.ts +21 -3
  183. package/dist/Skola24/mdb/from/schedule.js +15 -17
  184. package/dist/Skola24/mdb/from/schedule.js.map +1 -1
  185. package/dist/Skola24/mdb/from/teachers.js.map +1 -1
  186. package/dist/Skola24/mdb/index.js.map +1 -1
  187. package/dist/Skola24/mdb/types/index.d.ts +7 -0
  188. package/dist/Skola24/txt/from/calendar-exceptions.js.map +1 -1
  189. package/dist/Skola24/txt/from/division.js.map +1 -1
  190. package/dist/Skola24/txt/from/index.js.map +1 -1
  191. package/dist/Skola24/txt/from/period.js.map +1 -1
  192. package/dist/Skola24/txt/from/schedules.d.ts +16 -0
  193. package/dist/Skola24/txt/from/schedules.js +90 -80
  194. package/dist/Skola24/txt/from/schedules.js.map +1 -1
  195. package/dist/Skola24/txt/index.d.ts +17 -5
  196. package/dist/Skola24/txt/index.js.map +1 -1
  197. package/dist/Skola24/txt/to/index.d.ts +3 -3
  198. package/dist/Skola24/txt/to/index.js.map +1 -1
  199. package/dist/Skola24/txt/to/schedules.js +76 -91
  200. package/dist/Skola24/txt/to/schedules.js.map +1 -1
  201. package/dist/Skola24/txt/types/index.d.ts +5 -2
  202. package/dist/common/constants.js +2 -2
  203. package/dist/common/constants.js.map +1 -1
  204. package/dist/common/functions.js +16 -21
  205. package/dist/common/functions.js.map +1 -1
  206. package/dist/common/get-date.js +5 -6
  207. package/dist/common/get-date.js.map +1 -1
  208. package/dist/common/make-chainable/index.js +36 -0
  209. package/dist/common/make-chainable/index.js.map +1 -0
  210. package/dist/common/types.d.ts +12 -0
  211. package/dist/core/from/courses.js +12 -0
  212. package/dist/core/from/courses.js.map +1 -0
  213. package/dist/core/from/events.js +13 -0
  214. package/dist/core/from/events.js.map +1 -0
  215. package/dist/core/from/exceptions.js +12 -0
  216. package/dist/core/from/exceptions.js.map +1 -0
  217. package/dist/core/from/groups.js +12 -0
  218. package/dist/core/from/groups.js.map +1 -0
  219. package/dist/core/{v2/from → from}/index.js +1 -1
  220. package/dist/core/from/index.js.map +1 -0
  221. package/dist/core/from/locations.js +12 -0
  222. package/dist/core/from/locations.js.map +1 -0
  223. package/dist/core/from/locked-times.js +12 -0
  224. package/dist/core/from/locked-times.js.map +1 -0
  225. package/dist/core/from/overlap-groups.js +12 -0
  226. package/dist/core/from/overlap-groups.js.map +1 -0
  227. package/dist/core/from/periods.js +12 -0
  228. package/dist/core/from/periods.js.map +1 -0
  229. package/dist/core/from/persons.js +12 -0
  230. package/dist/core/from/persons.js.map +1 -0
  231. package/dist/core/from/root-intervals.js +12 -0
  232. package/dist/core/from/root-intervals.js.map +1 -0
  233. package/dist/core/from/schedules.d.ts +7 -0
  234. package/dist/core/from/schedules.js +35 -0
  235. package/dist/core/from/schedules.js.map +1 -0
  236. package/dist/core/{v2/from → from}/syllabuses.js +1 -1
  237. package/dist/core/from/syllabuses.js.map +1 -0
  238. package/dist/core/from/teachers.js +12 -0
  239. package/dist/core/from/teachers.js.map +1 -0
  240. package/dist/core/index.d.ts +6 -12
  241. package/dist/core/index.js +4 -6
  242. package/dist/core/index.js.map +1 -1
  243. package/dist/core/to/courses.js +43 -0
  244. package/dist/core/to/courses.js.map +1 -0
  245. package/dist/core/to/division.js +10 -0
  246. package/dist/core/to/division.js.map +1 -0
  247. package/dist/core/to/events.js +43 -0
  248. package/dist/core/to/events.js.map +1 -0
  249. package/dist/core/to/exceptions.js +27 -0
  250. package/dist/core/to/exceptions.js.map +1 -0
  251. package/dist/core/to/groups.js +23 -0
  252. package/dist/core/to/groups.js.map +1 -0
  253. package/dist/core/{v1/to → to}/index.d.ts +1 -1
  254. package/dist/{RS/v3 → core}/to/index.js +1 -1
  255. package/dist/core/to/index.js.map +1 -0
  256. package/dist/core/to/locations.js +19 -0
  257. package/dist/core/to/locations.js.map +1 -0
  258. package/dist/core/to/locked-times.js +21 -0
  259. package/dist/core/to/locked-times.js.map +1 -0
  260. package/dist/core/to/overlap-groups.js +28 -0
  261. package/dist/core/to/overlap-groups.js.map +1 -0
  262. package/dist/core/to/periods.js +17 -0
  263. package/dist/core/to/periods.js.map +1 -0
  264. package/dist/core/to/persons.js +23 -0
  265. package/dist/core/to/persons.js.map +1 -0
  266. package/dist/core/to/root-intervals.js +17 -0
  267. package/dist/core/to/root-intervals.js.map +1 -0
  268. package/dist/core/to/schedules.d.ts +44 -0
  269. package/dist/core/to/schedules.js +40 -0
  270. package/dist/core/to/schedules.js.map +1 -0
  271. package/dist/core/to/settings.js +16 -0
  272. package/dist/core/to/settings.js.map +1 -0
  273. package/dist/core/to/syllabuses.js +17 -0
  274. package/dist/core/to/syllabuses.js.map +1 -0
  275. package/dist/core/to/teachers.js +24 -0
  276. package/dist/core/to/teachers.js.map +1 -0
  277. package/dist/core/to/util.d.ts +10 -0
  278. package/dist/core/to/util.js +22 -0
  279. package/dist/core/to/util.js.map +1 -0
  280. package/dist/core/types/areas.d.ts +10 -0
  281. package/dist/core/types/common/break-lengths.d.ts +5 -0
  282. package/dist/core/types/common/days.d.ts +8 -0
  283. package/dist/core/types/common/index.d.ts +44 -0
  284. package/dist/core/types/common/intervals.d.ts +14 -0
  285. package/dist/core/{v2/types → types}/common/maximum-schedule-span.d.ts +1 -1
  286. package/dist/core/{v2/types → types/common}/meta.d.ts +1 -1
  287. package/dist/core/types/common/planned-schedule-duration.d.ts +7 -0
  288. package/dist/core/types/common/tag.d.ts +9 -0
  289. package/dist/core/types/courses.d.ts +56 -0
  290. package/dist/core/{v2/types → types}/division-settings.d.ts +12 -19
  291. package/dist/core/types/divisions.d.ts +24 -0
  292. package/dist/core/types/events.d.ts +54 -0
  293. package/dist/core/{v2/types → types}/exceptions.d.ts +14 -23
  294. package/dist/core/types/groups.d.ts +39 -0
  295. package/dist/core/types/index.d.ts +117 -15
  296. package/dist/core/types/locations.d.ts +27 -0
  297. package/dist/core/types/locked-times.d.ts +33 -0
  298. package/dist/core/types/overlap-groups.d.ts +14 -0
  299. package/dist/core/types/periods.d.ts +14 -0
  300. package/dist/core/{v2/types → types}/persons.d.ts +13 -22
  301. package/dist/core/types/root-intervals.d.ts +13 -0
  302. package/dist/core/types/schedules.d.ts +44 -0
  303. package/dist/core/types/syllabus.d.ts +18 -0
  304. package/dist/core/{v2/types → types}/teachers.d.ts +18 -30
  305. package/dist/core/util.js +46 -0
  306. package/dist/core/util.js.map +1 -0
  307. package/dist/core/vertex-mapping.d.ts +56 -0
  308. package/dist/identify/constants/index.d.ts +14 -58
  309. package/dist/identify/constants/index.js +7 -72
  310. package/dist/identify/constants/index.js.map +1 -1
  311. package/dist/identify/index.d.ts +1 -1
  312. package/dist/identify/index.js +38 -29
  313. package/dist/identify/index.js.map +1 -1
  314. package/dist/index.d.ts +23 -29
  315. package/dist/index.js +6 -7
  316. package/dist/sdui/from/classes.js.map +1 -1
  317. package/dist/sdui/from/courses.js.map +1 -1
  318. package/dist/sdui/from/holidays.js.map +1 -1
  319. package/dist/sdui/from/hours.js.map +1 -1
  320. package/dist/sdui/from/lessons.js.map +1 -1
  321. package/dist/sdui/from/rooms.js.map +1 -1
  322. package/dist/sdui/from/schedules.d.ts +19 -0
  323. package/dist/sdui/from/schedules.js +3 -3
  324. package/dist/sdui/from/schedules.js.map +1 -1
  325. package/dist/sdui/from/school-years.js.map +1 -1
  326. package/dist/sdui/from/subjects.js.map +1 -1
  327. package/dist/sdui/from/substitution-plans.js.map +1 -1
  328. package/dist/sdui/from/teachers.js.map +1 -1
  329. package/dist/sdui/index.d.ts +19 -11
  330. package/dist/sdui/index.js.map +1 -1
  331. package/dist/sdui/to/classes.js +4 -2
  332. package/dist/sdui/to/classes.js.map +1 -1
  333. package/dist/sdui/to/courses.js +5 -5
  334. package/dist/sdui/to/courses.js.map +1 -1
  335. package/dist/sdui/to/holidays.js +3 -2
  336. package/dist/sdui/to/holidays.js.map +1 -1
  337. package/dist/sdui/to/hours.js +4 -2
  338. package/dist/sdui/to/hours.js.map +1 -1
  339. package/dist/sdui/to/index.d.ts +11 -12
  340. package/dist/sdui/to/lessons.js +10 -9
  341. package/dist/sdui/to/lessons.js.map +1 -1
  342. package/dist/sdui/to/rooms.js +4 -2
  343. package/dist/sdui/to/rooms.js.map +1 -1
  344. package/dist/sdui/to/schedules.js +9 -9
  345. package/dist/sdui/to/schedules.js.map +1 -1
  346. package/dist/sdui/to/school-years.js +4 -3
  347. package/dist/sdui/to/school-years.js.map +1 -1
  348. package/dist/sdui/to/subjects.js.map +1 -1
  349. package/dist/sdui/to/substitution-plans.js +12 -11
  350. package/dist/sdui/to/substitution-plans.js.map +1 -1
  351. package/dist/sdui/to/teachers.js +4 -4
  352. package/dist/sdui/to/teachers.js.map +1 -1
  353. package/dist/sdui/types/index.d.ts +2 -0
  354. package/dist/vKlass/from/index.js +1 -3
  355. package/dist/vKlass/from/index.js.map +1 -1
  356. package/dist/vKlass/from/schedule.d.ts +18 -3
  357. package/dist/vKlass/from/schedule.js +16 -19
  358. package/dist/vKlass/from/schedule.js.map +1 -1
  359. package/dist/vKlass/index.d.ts +6 -4
  360. package/dist/vKlass/index.js.map +1 -1
  361. package/dist/vKlass/to/schedules.d.ts +1 -1
  362. package/dist/vKlass/to/schedules.js +5 -12
  363. package/dist/vKlass/to/schedules.js.map +1 -1
  364. package/dist/vKlass/types/index.d.ts +5 -5
  365. package/package.json +38 -29
  366. package/dist/PlanDigital/to/index.d.ts +0 -10
  367. package/dist/PlanDigital/to/index.js +0 -10
  368. package/dist/PlanDigital/to/index.js.map +0 -1
  369. package/dist/PlanDigital/to/schedules.js +0 -15
  370. package/dist/PlanDigital/to/schedules.js.map +0 -1
  371. package/dist/RS/v0/from/available-dependencies.js +0 -38
  372. package/dist/RS/v0/from/available-dependencies.js.map +0 -1
  373. package/dist/RS/v0/from/break-lengths.js +0 -15
  374. package/dist/RS/v0/from/break-lengths.js.map +0 -1
  375. package/dist/RS/v0/from/course-events.js +0 -68
  376. package/dist/RS/v0/from/course-events.js.map +0 -1
  377. package/dist/RS/v0/from/courses.js +0 -53
  378. package/dist/RS/v0/from/courses.js.map +0 -1
  379. package/dist/RS/v0/from/days.js +0 -14
  380. package/dist/RS/v0/from/days.js.map +0 -1
  381. package/dist/RS/v0/from/dependencies.js +0 -29
  382. package/dist/RS/v0/from/dependencies.js.map +0 -1
  383. package/dist/RS/v0/from/groups.js +0 -32
  384. package/dist/RS/v0/from/groups.js.map +0 -1
  385. package/dist/RS/v0/from/index.js +0 -32
  386. package/dist/RS/v0/from/index.js.map +0 -1
  387. package/dist/RS/v0/from/intervals.js +0 -15
  388. package/dist/RS/v0/from/intervals.js.map +0 -1
  389. package/dist/RS/v0/from/locked-times.js +0 -23
  390. package/dist/RS/v0/from/locked-times.js.map +0 -1
  391. package/dist/RS/v0/from/placements.js +0 -20
  392. package/dist/RS/v0/from/placements.js.map +0 -1
  393. package/dist/RS/v0/from/schedules.js +0 -44
  394. package/dist/RS/v0/from/schedules.js.map +0 -1
  395. package/dist/RS/v0/from/settings.js +0 -24
  396. package/dist/RS/v0/from/settings.js.map +0 -1
  397. package/dist/RS/v0/from/teachers.js +0 -31
  398. package/dist/RS/v0/from/teachers.js.map +0 -1
  399. package/dist/RS/v0/index.d.ts +0 -43
  400. package/dist/RS/v0/index.js +0 -12
  401. package/dist/RS/v0/index.js.map +0 -1
  402. package/dist/RS/v0/to/available-dependencies.js +0 -17
  403. package/dist/RS/v0/to/available-dependencies.js.map +0 -1
  404. package/dist/RS/v0/to/configurations.js +0 -22
  405. package/dist/RS/v0/to/configurations.js.map +0 -1
  406. package/dist/RS/v0/to/constraints.js +0 -34
  407. package/dist/RS/v0/to/constraints.js.map +0 -1
  408. package/dist/RS/v0/to/course-events/days.js +0 -13
  409. package/dist/RS/v0/to/course-events/days.js.map +0 -1
  410. package/dist/RS/v0/to/course-events/dependencies.js +0 -18
  411. package/dist/RS/v0/to/course-events/dependencies.js.map +0 -1
  412. package/dist/RS/v0/to/course-events/groups.js +0 -39
  413. package/dist/RS/v0/to/course-events/groups.js.map +0 -1
  414. package/dist/RS/v0/to/course-events/in-locations.js +0 -17
  415. package/dist/RS/v0/to/course-events/in-locations.js.map +0 -1
  416. package/dist/RS/v0/to/course-events/index.js +0 -52
  417. package/dist/RS/v0/to/course-events/index.js.map +0 -1
  418. package/dist/RS/v0/to/course-events/intervals.js +0 -12
  419. package/dist/RS/v0/to/course-events/intervals.js.map +0 -1
  420. package/dist/RS/v0/to/course-events/meta.js +0 -21
  421. package/dist/RS/v0/to/course-events/meta.js.map +0 -1
  422. package/dist/RS/v0/to/courses.js +0 -56
  423. package/dist/RS/v0/to/courses.js.map +0 -1
  424. package/dist/RS/v0/to/days.js +0 -11
  425. package/dist/RS/v0/to/days.js.map +0 -1
  426. package/dist/RS/v0/to/dependencies.js +0 -26
  427. package/dist/RS/v0/to/dependencies.js.map +0 -1
  428. package/dist/RS/v0/to/groups.js +0 -32
  429. package/dist/RS/v0/to/groups.js.map +0 -1
  430. package/dist/RS/v0/to/index.d.ts +0 -46
  431. package/dist/RS/v0/to/index.js +0 -34
  432. package/dist/RS/v0/to/index.js.map +0 -1
  433. package/dist/RS/v0/to/intervals.js +0 -17
  434. package/dist/RS/v0/to/intervals.js.map +0 -1
  435. package/dist/RS/v0/to/locked-times.js +0 -43
  436. package/dist/RS/v0/to/locked-times.js.map +0 -1
  437. package/dist/RS/v0/to/schedules.js +0 -16
  438. package/dist/RS/v0/to/schedules.js.map +0 -1
  439. package/dist/RS/v0/to/settings.js +0 -28
  440. package/dist/RS/v0/to/settings.js.map +0 -1
  441. package/dist/RS/v0/to/teachers.js +0 -30
  442. package/dist/RS/v0/to/teachers.js.map +0 -1
  443. package/dist/RS/v0/types/areas.d.ts +0 -8
  444. package/dist/RS/v0/types/available-dependencies.d.ts +0 -8
  445. package/dist/RS/v0/types/break-lengths.d.ts +0 -9
  446. package/dist/RS/v0/types/configurations.d.ts +0 -7
  447. package/dist/RS/v0/types/constraints.d.ts +0 -17
  448. package/dist/RS/v0/types/course-events.d.ts +0 -26
  449. package/dist/RS/v0/types/courses.d.ts +0 -27
  450. package/dist/RS/v0/types/days.d.ts +0 -8
  451. package/dist/RS/v0/types/dependencies.d.ts +0 -17
  452. package/dist/RS/v0/types/groups.d.ts +0 -25
  453. package/dist/RS/v0/types/index.d.ts +0 -31
  454. package/dist/RS/v0/types/intervals.d.ts +0 -8
  455. package/dist/RS/v0/types/locked-times.d.ts +0 -11
  456. package/dist/RS/v0/types/out-options.d.ts +0 -13
  457. package/dist/RS/v0/types/placements.d.ts +0 -12
  458. package/dist/RS/v0/types/schedules.d.ts +0 -15
  459. package/dist/RS/v0/types/settings.d.ts +0 -26
  460. package/dist/RS/v1/from/available-dependencies.js +0 -38
  461. package/dist/RS/v1/from/available-dependencies.js.map +0 -1
  462. package/dist/RS/v1/from/break-lengths.js +0 -15
  463. package/dist/RS/v1/from/break-lengths.js.map +0 -1
  464. package/dist/RS/v1/from/collections.js +0 -55
  465. package/dist/RS/v1/from/collections.js.map +0 -1
  466. package/dist/RS/v1/from/course-events.js +0 -65
  467. package/dist/RS/v1/from/course-events.js.map +0 -1
  468. package/dist/RS/v1/from/days.js +0 -14
  469. package/dist/RS/v1/from/days.js.map +0 -1
  470. package/dist/RS/v1/from/dependencies.js +0 -31
  471. package/dist/RS/v1/from/dependencies.js.map +0 -1
  472. package/dist/RS/v1/from/groups.js +0 -34
  473. package/dist/RS/v1/from/groups.js.map +0 -1
  474. package/dist/RS/v1/from/index.js +0 -32
  475. package/dist/RS/v1/from/index.js.map +0 -1
  476. package/dist/RS/v1/from/intervals.js +0 -18
  477. package/dist/RS/v1/from/intervals.js.map +0 -1
  478. package/dist/RS/v1/from/locked-times.js +0 -21
  479. package/dist/RS/v1/from/locked-times.js.map +0 -1
  480. package/dist/RS/v1/from/placements.js +0 -21
  481. package/dist/RS/v1/from/placements.js.map +0 -1
  482. package/dist/RS/v1/from/schedules.js +0 -44
  483. package/dist/RS/v1/from/schedules.js.map +0 -1
  484. package/dist/RS/v1/from/settings.js +0 -25
  485. package/dist/RS/v1/from/settings.js.map +0 -1
  486. package/dist/RS/v1/from/teachers.js +0 -33
  487. package/dist/RS/v1/from/teachers.js.map +0 -1
  488. package/dist/RS/v1/index.d.ts +0 -45
  489. package/dist/RS/v1/index.js +0 -12
  490. package/dist/RS/v1/index.js.map +0 -1
  491. package/dist/RS/v1/to/available-dependencies.js +0 -25
  492. package/dist/RS/v1/to/available-dependencies.js.map +0 -1
  493. package/dist/RS/v1/to/break-lengths.js +0 -19
  494. package/dist/RS/v1/to/break-lengths.js.map +0 -1
  495. package/dist/RS/v1/to/collections.js +0 -51
  496. package/dist/RS/v1/to/collections.js.map +0 -1
  497. package/dist/RS/v1/to/configurations.js +0 -22
  498. package/dist/RS/v1/to/configurations.js.map +0 -1
  499. package/dist/RS/v1/to/constraints.js +0 -26
  500. package/dist/RS/v1/to/constraints.js.map +0 -1
  501. package/dist/RS/v1/to/course-events/days.js +0 -12
  502. package/dist/RS/v1/to/course-events/days.js.map +0 -1
  503. package/dist/RS/v1/to/course-events/dependencies.js +0 -15
  504. package/dist/RS/v1/to/course-events/dependencies.js.map +0 -1
  505. package/dist/RS/v1/to/course-events/groups.js +0 -30
  506. package/dist/RS/v1/to/course-events/groups.js.map +0 -1
  507. package/dist/RS/v1/to/course-events/in-locations.js +0 -17
  508. package/dist/RS/v1/to/course-events/in-locations.js.map +0 -1
  509. package/dist/RS/v1/to/course-events/index.js +0 -47
  510. package/dist/RS/v1/to/course-events/index.js.map +0 -1
  511. package/dist/RS/v1/to/course-events/intervals.js +0 -11
  512. package/dist/RS/v1/to/course-events/intervals.js.map +0 -1
  513. package/dist/RS/v1/to/course-events/meta.js +0 -21
  514. package/dist/RS/v1/to/course-events/meta.js.map +0 -1
  515. package/dist/RS/v1/to/days.js +0 -11
  516. package/dist/RS/v1/to/days.js.map +0 -1
  517. package/dist/RS/v1/to/dependencies.js +0 -28
  518. package/dist/RS/v1/to/dependencies.js.map +0 -1
  519. package/dist/RS/v1/to/groups.js +0 -34
  520. package/dist/RS/v1/to/groups.js.map +0 -1
  521. package/dist/RS/v1/to/index.d.ts +0 -46
  522. package/dist/RS/v1/to/index.js +0 -34
  523. package/dist/RS/v1/to/index.js.map +0 -1
  524. package/dist/RS/v1/to/intervals.js +0 -17
  525. package/dist/RS/v1/to/intervals.js.map +0 -1
  526. package/dist/RS/v1/to/locked-times.js +0 -49
  527. package/dist/RS/v1/to/locked-times.js.map +0 -1
  528. package/dist/RS/v1/to/schedules.js +0 -16
  529. package/dist/RS/v1/to/schedules.js.map +0 -1
  530. package/dist/RS/v1/to/settings.js +0 -34
  531. package/dist/RS/v1/to/settings.js.map +0 -1
  532. package/dist/RS/v1/to/teachers.js +0 -34
  533. package/dist/RS/v1/to/teachers.js.map +0 -1
  534. package/dist/RS/v1/types/areas.d.ts +0 -8
  535. package/dist/RS/v1/types/available-dependencies.d.ts +0 -8
  536. package/dist/RS/v1/types/break-lengths.d.ts +0 -9
  537. package/dist/RS/v1/types/collections.d.ts +0 -27
  538. package/dist/RS/v1/types/configurations.d.ts +0 -10
  539. package/dist/RS/v1/types/constraints.d.ts +0 -17
  540. package/dist/RS/v1/types/course-events.d.ts +0 -26
  541. package/dist/RS/v1/types/days.d.ts +0 -8
  542. package/dist/RS/v1/types/dependencies.d.ts +0 -17
  543. package/dist/RS/v1/types/groups.d.ts +0 -25
  544. package/dist/RS/v1/types/index.d.ts +0 -31
  545. package/dist/RS/v1/types/intervals.d.ts +0 -8
  546. package/dist/RS/v1/types/locked-times.d.ts +0 -11
  547. package/dist/RS/v1/types/out-options.d.ts +0 -11
  548. package/dist/RS/v1/types/placements.d.ts +0 -12
  549. package/dist/RS/v1/types/schedules.d.ts +0 -16
  550. package/dist/RS/v1/types/settings.d.ts +0 -31
  551. package/dist/RS/v2/from/available-dependencies.js +0 -38
  552. package/dist/RS/v2/from/available-dependencies.js.map +0 -1
  553. package/dist/RS/v2/from/break-lengths.js +0 -15
  554. package/dist/RS/v2/from/break-lengths.js.map +0 -1
  555. package/dist/RS/v2/from/collections.js +0 -57
  556. package/dist/RS/v2/from/collections.js.map +0 -1
  557. package/dist/RS/v2/from/course-events.d.ts +0 -12
  558. package/dist/RS/v2/from/course-events.js +0 -67
  559. package/dist/RS/v2/from/course-events.js.map +0 -1
  560. package/dist/RS/v2/from/days.js +0 -14
  561. package/dist/RS/v2/from/days.js.map +0 -1
  562. package/dist/RS/v2/from/dependencies.js +0 -31
  563. package/dist/RS/v2/from/dependencies.js.map +0 -1
  564. package/dist/RS/v2/from/groups.js +0 -35
  565. package/dist/RS/v2/from/groups.js.map +0 -1
  566. package/dist/RS/v2/from/index.js +0 -32
  567. package/dist/RS/v2/from/index.js.map +0 -1
  568. package/dist/RS/v2/from/intervals.js +0 -18
  569. package/dist/RS/v2/from/intervals.js.map +0 -1
  570. package/dist/RS/v2/from/locked-times.js +0 -21
  571. package/dist/RS/v2/from/locked-times.js.map +0 -1
  572. package/dist/RS/v2/from/placements.js +0 -32
  573. package/dist/RS/v2/from/placements.js.map +0 -1
  574. package/dist/RS/v2/from/schedules.js +0 -78
  575. package/dist/RS/v2/from/schedules.js.map +0 -1
  576. package/dist/RS/v2/from/settings.js +0 -31
  577. package/dist/RS/v2/from/settings.js.map +0 -1
  578. package/dist/RS/v2/from/teachers.js +0 -33
  579. package/dist/RS/v2/from/teachers.js.map +0 -1
  580. package/dist/RS/v2/index.d.ts +0 -63
  581. package/dist/RS/v2/index.js +0 -12
  582. package/dist/RS/v2/index.js.map +0 -1
  583. package/dist/RS/v2/to/available-dependencies.js +0 -25
  584. package/dist/RS/v2/to/available-dependencies.js.map +0 -1
  585. package/dist/RS/v2/to/break-lengths.js +0 -19
  586. package/dist/RS/v2/to/break-lengths.js.map +0 -1
  587. package/dist/RS/v2/to/collections.js +0 -60
  588. package/dist/RS/v2/to/collections.js.map +0 -1
  589. package/dist/RS/v2/to/configurations.js +0 -23
  590. package/dist/RS/v2/to/configurations.js.map +0 -1
  591. package/dist/RS/v2/to/constraints.js +0 -88
  592. package/dist/RS/v2/to/constraints.js.map +0 -1
  593. package/dist/RS/v2/to/course-events/days.js +0 -12
  594. package/dist/RS/v2/to/course-events/days.js.map +0 -1
  595. package/dist/RS/v2/to/course-events/dependencies.js +0 -14
  596. package/dist/RS/v2/to/course-events/dependencies.js.map +0 -1
  597. package/dist/RS/v2/to/course-events/groups.js +0 -38
  598. package/dist/RS/v2/to/course-events/groups.js.map +0 -1
  599. package/dist/RS/v2/to/course-events/in-locations.js +0 -18
  600. package/dist/RS/v2/to/course-events/in-locations.js.map +0 -1
  601. package/dist/RS/v2/to/course-events/index.js +0 -56
  602. package/dist/RS/v2/to/course-events/index.js.map +0 -1
  603. package/dist/RS/v2/to/course-events/intervals.js +0 -11
  604. package/dist/RS/v2/to/course-events/intervals.js.map +0 -1
  605. package/dist/RS/v2/to/course-events/meta.js +0 -21
  606. package/dist/RS/v2/to/course-events/meta.js.map +0 -1
  607. package/dist/RS/v2/to/days.js +0 -11
  608. package/dist/RS/v2/to/days.js.map +0 -1
  609. package/dist/RS/v2/to/default.js +0 -36
  610. package/dist/RS/v2/to/default.js.map +0 -1
  611. package/dist/RS/v2/to/dependencies.js +0 -28
  612. package/dist/RS/v2/to/dependencies.js.map +0 -1
  613. package/dist/RS/v2/to/destructure.js +0 -40
  614. package/dist/RS/v2/to/destructure.js.map +0 -1
  615. package/dist/RS/v2/to/dynamic-locked-times.js +0 -57
  616. package/dist/RS/v2/to/dynamic-locked-times.js.map +0 -1
  617. package/dist/RS/v2/to/groups.js +0 -37
  618. package/dist/RS/v2/to/groups.js.map +0 -1
  619. package/dist/RS/v2/to/index.d.ts +0 -44
  620. package/dist/RS/v2/to/index.js +0 -36
  621. package/dist/RS/v2/to/index.js.map +0 -1
  622. package/dist/RS/v2/to/intervals.js +0 -32
  623. package/dist/RS/v2/to/intervals.js.map +0 -1
  624. package/dist/RS/v2/to/locked-times.js +0 -49
  625. package/dist/RS/v2/to/locked-times.js.map +0 -1
  626. package/dist/RS/v2/to/periods.js +0 -48
  627. package/dist/RS/v2/to/periods.js.map +0 -1
  628. package/dist/RS/v2/to/persons.js +0 -23
  629. package/dist/RS/v2/to/persons.js.map +0 -1
  630. package/dist/RS/v2/to/schedules.js +0 -19
  631. package/dist/RS/v2/to/schedules.js.map +0 -1
  632. package/dist/RS/v2/to/settings.js +0 -18
  633. package/dist/RS/v2/to/settings.js.map +0 -1
  634. package/dist/RS/v2/to/teachers.js +0 -37
  635. package/dist/RS/v2/to/teachers.js.map +0 -1
  636. package/dist/RS/v2/types/areas.d.ts +0 -8
  637. package/dist/RS/v2/types/available-dependencies.d.ts +0 -8
  638. package/dist/RS/v2/types/break-lengths.d.ts +0 -9
  639. package/dist/RS/v2/types/collections.d.ts +0 -29
  640. package/dist/RS/v2/types/configurations.d.ts +0 -10
  641. package/dist/RS/v2/types/constraints.d.ts +0 -21
  642. package/dist/RS/v2/types/course-events.d.ts +0 -30
  643. package/dist/RS/v2/types/days.d.ts +0 -8
  644. package/dist/RS/v2/types/default.d.ts +0 -25
  645. package/dist/RS/v2/types/dependencies.d.ts +0 -17
  646. package/dist/RS/v2/types/index.d.ts +0 -33
  647. package/dist/RS/v2/types/intervals.d.ts +0 -9
  648. package/dist/RS/v2/types/out-options.d.ts +0 -11
  649. package/dist/RS/v2/types/placements.d.ts +0 -12
  650. package/dist/RS/v2/types/schedules.d.ts +0 -18
  651. package/dist/RS/v3/from/division.js +0 -14
  652. package/dist/RS/v3/from/division.js.map +0 -1
  653. package/dist/RS/v3/from/index.js +0 -12
  654. package/dist/RS/v3/from/index.js.map +0 -1
  655. package/dist/RS/v3/from/schedules.js +0 -34
  656. package/dist/RS/v3/from/schedules.js.map +0 -1
  657. package/dist/RS/v3/index.d.ts +0 -21
  658. package/dist/RS/v3/index.js +0 -12
  659. package/dist/RS/v3/index.js.map +0 -1
  660. package/dist/RS/v3/to/available-dependencies.js +0 -26
  661. package/dist/RS/v3/to/available-dependencies.js.map +0 -1
  662. package/dist/RS/v3/to/break-lengths.js +0 -19
  663. package/dist/RS/v3/to/break-lengths.js.map +0 -1
  664. package/dist/RS/v3/to/collections.js +0 -56
  665. package/dist/RS/v3/to/collections.js.map +0 -1
  666. package/dist/RS/v3/to/configurations.js +0 -23
  667. package/dist/RS/v3/to/configurations.js.map +0 -1
  668. package/dist/RS/v3/to/constraints.js +0 -77
  669. package/dist/RS/v3/to/constraints.js.map +0 -1
  670. package/dist/RS/v3/to/course-events/days.js +0 -12
  671. package/dist/RS/v3/to/course-events/days.js.map +0 -1
  672. package/dist/RS/v3/to/course-events/dependencies.js +0 -14
  673. package/dist/RS/v3/to/course-events/dependencies.js.map +0 -1
  674. package/dist/RS/v3/to/course-events/groups.js +0 -44
  675. package/dist/RS/v3/to/course-events/groups.js.map +0 -1
  676. package/dist/RS/v3/to/course-events/in-locations.js +0 -18
  677. package/dist/RS/v3/to/course-events/in-locations.js.map +0 -1
  678. package/dist/RS/v3/to/course-events/index.js +0 -84
  679. package/dist/RS/v3/to/course-events/index.js.map +0 -1
  680. package/dist/RS/v3/to/course-events/intervals.js +0 -11
  681. package/dist/RS/v3/to/course-events/intervals.js.map +0 -1
  682. package/dist/RS/v3/to/course-events/meta.js +0 -21
  683. package/dist/RS/v3/to/course-events/meta.js.map +0 -1
  684. package/dist/RS/v3/to/days.js +0 -11
  685. package/dist/RS/v3/to/days.js.map +0 -1
  686. package/dist/RS/v3/to/default.js.map +0 -1
  687. package/dist/RS/v3/to/dependencies.js +0 -31
  688. package/dist/RS/v3/to/dependencies.js.map +0 -1
  689. package/dist/RS/v3/to/destructure.js +0 -33
  690. package/dist/RS/v3/to/destructure.js.map +0 -1
  691. package/dist/RS/v3/to/dynamic-locked-times.js +0 -97
  692. package/dist/RS/v3/to/dynamic-locked-times.js.map +0 -1
  693. package/dist/RS/v3/to/groups.js +0 -36
  694. package/dist/RS/v3/to/groups.js.map +0 -1
  695. package/dist/RS/v3/to/index.d.ts +0 -266
  696. package/dist/RS/v3/to/index.js.map +0 -1
  697. package/dist/RS/v3/to/individuals.js +0 -49
  698. package/dist/RS/v3/to/individuals.js.map +0 -1
  699. package/dist/RS/v3/to/intervals.js +0 -32
  700. package/dist/RS/v3/to/intervals.js.map +0 -1
  701. package/dist/RS/v3/to/locked-times.js +0 -49
  702. package/dist/RS/v3/to/locked-times.js.map +0 -1
  703. package/dist/RS/v3/to/periods.js +0 -48
  704. package/dist/RS/v3/to/periods.js.map +0 -1
  705. package/dist/RS/v3/to/schedules.js +0 -39
  706. package/dist/RS/v3/to/schedules.js.map +0 -1
  707. package/dist/RS/v3/to/settings.js +0 -18
  708. package/dist/RS/v3/to/settings.js.map +0 -1
  709. package/dist/RS/v3/to/teachers.js +0 -36
  710. package/dist/RS/v3/to/teachers.js.map +0 -1
  711. package/dist/RS/v3/to/util.js +0 -32
  712. package/dist/RS/v3/to/util.js.map +0 -1
  713. package/dist/RS/v3/types/areas.d.ts +0 -8
  714. package/dist/RS/v3/types/available-dependencies.d.ts +0 -8
  715. package/dist/RS/v3/types/break-lengths.d.ts +0 -9
  716. package/dist/RS/v3/types/collections.d.ts +0 -31
  717. package/dist/RS/v3/types/configurations.d.ts +0 -10
  718. package/dist/RS/v3/types/constraints.d.ts +0 -25
  719. package/dist/RS/v3/types/course-events.d.ts +0 -32
  720. package/dist/RS/v3/types/days.d.ts +0 -8
  721. package/dist/RS/v3/types/dependencies.d.ts +0 -17
  722. package/dist/RS/v3/types/groups.d.ts +0 -25
  723. package/dist/RS/v3/types/index.d.ts +0 -33
  724. package/dist/RS/v3/types/individuals.d.ts +0 -13
  725. package/dist/RS/v3/types/intervals.d.ts +0 -9
  726. package/dist/RS/v3/types/locked-times.d.ts +0 -11
  727. package/dist/RS/v3/types/out-options.d.ts +0 -23
  728. package/dist/RS/v3/types/placements.d.ts +0 -12
  729. package/dist/RS/v3/types/root-intervals.d.ts +0 -10
  730. package/dist/RS/v3/types/schedules.d.ts +0 -24
  731. package/dist/RS/v3/types/settings.d.ts +0 -12
  732. package/dist/SS12000/from/activities.js +0 -35
  733. package/dist/SS12000/from/activities.js.map +0 -1
  734. package/dist/SS12000/from/calendar-events.js +0 -20
  735. package/dist/SS12000/from/calendar-events.js.map +0 -1
  736. package/dist/SS12000/from/duties.js +0 -21
  737. package/dist/SS12000/from/duties.js.map +0 -1
  738. package/dist/SS12000/from/groups.js +0 -23
  739. package/dist/SS12000/from/groups.js.map +0 -1
  740. package/dist/SS12000/from/index.js +0 -24
  741. package/dist/SS12000/from/index.js.map +0 -1
  742. package/dist/SS12000/from/persons.js +0 -43
  743. package/dist/SS12000/from/persons.js.map +0 -1
  744. package/dist/SS12000/from/resources.js +0 -9
  745. package/dist/SS12000/from/resources.js.map +0 -1
  746. package/dist/SS12000/from/rooms.js +0 -18
  747. package/dist/SS12000/from/rooms.js.map +0 -1
  748. package/dist/SS12000/from/syllabuses.js +0 -21
  749. package/dist/SS12000/from/syllabuses.js.map +0 -1
  750. package/dist/SS12000/index.d.ts +0 -73
  751. package/dist/SS12000/index.js +0 -12
  752. package/dist/SS12000/index.js.map +0 -1
  753. package/dist/SS12000/to/activities.js +0 -55
  754. package/dist/SS12000/to/activities.js.map +0 -1
  755. package/dist/SS12000/to/calendar-events.js +0 -47
  756. package/dist/SS12000/to/calendar-events.js.map +0 -1
  757. package/dist/SS12000/to/common.js +0 -16
  758. package/dist/SS12000/to/common.js.map +0 -1
  759. package/dist/SS12000/to/duties.js +0 -36
  760. package/dist/SS12000/to/duties.js.map +0 -1
  761. package/dist/SS12000/to/groups.js +0 -37
  762. package/dist/SS12000/to/groups.js.map +0 -1
  763. package/dist/SS12000/to/index.d.ts +0 -25
  764. package/dist/SS12000/to/index.js +0 -24
  765. package/dist/SS12000/to/index.js.map +0 -1
  766. package/dist/SS12000/to/persons.js +0 -36
  767. package/dist/SS12000/to/persons.js.map +0 -1
  768. package/dist/SS12000/to/resources.js +0 -23
  769. package/dist/SS12000/to/resources.js.map +0 -1
  770. package/dist/SS12000/to/rooms.js +0 -28
  771. package/dist/SS12000/to/rooms.js.map +0 -1
  772. package/dist/SS12000/to/syllabuses.js +0 -30
  773. package/dist/SS12000/to/syllabuses.js.map +0 -1
  774. package/dist/SS12000/types/activities.d.ts +0 -41
  775. package/dist/SS12000/types/calendar-events.d.ts +0 -23
  776. package/dist/SS12000/types/codes.d.ts +0 -9
  777. package/dist/SS12000/types/duties.d.ts +0 -23
  778. package/dist/SS12000/types/duty-assignments.d.ts +0 -13
  779. package/dist/SS12000/types/groups.d.ts +0 -23
  780. package/dist/SS12000/types/index.d.ts +0 -21
  781. package/dist/SS12000/types/organisation.d.ts +0 -20
  782. package/dist/SS12000/types/persons.d.ts +0 -30
  783. package/dist/SS12000/types/resources.d.ts +0 -13
  784. package/dist/SS12000/types/rooms.d.ts +0 -17
  785. package/dist/SS12000/types/syllabus.d.ts +0 -19
  786. package/dist/core/v1/from/courses.js +0 -26
  787. package/dist/core/v1/from/courses.js.map +0 -1
  788. package/dist/core/v1/from/events.js +0 -12
  789. package/dist/core/v1/from/events.js.map +0 -1
  790. package/dist/core/v1/from/groups.js +0 -14
  791. package/dist/core/v1/from/groups.js.map +0 -1
  792. package/dist/core/v1/from/index.js +0 -8
  793. package/dist/core/v1/from/index.js.map +0 -1
  794. package/dist/core/v1/from/locations.js +0 -14
  795. package/dist/core/v1/from/locations.js.map +0 -1
  796. package/dist/core/v1/from/locked-times.js +0 -13
  797. package/dist/core/v1/from/locked-times.js.map +0 -1
  798. package/dist/core/v1/from/overlap-groups.js +0 -13
  799. package/dist/core/v1/from/overlap-groups.js.map +0 -1
  800. package/dist/core/v1/from/periods.js +0 -14
  801. package/dist/core/v1/from/periods.js.map +0 -1
  802. package/dist/core/v1/from/schedules.d.ts +0 -139
  803. package/dist/core/v1/from/schedules.js +0 -36
  804. package/dist/core/v1/from/schedules.js.map +0 -1
  805. package/dist/core/v1/from/teachers.js +0 -14
  806. package/dist/core/v1/from/teachers.js.map +0 -1
  807. package/dist/core/v1/index.d.ts +0 -14
  808. package/dist/core/v1/index.js +0 -12
  809. package/dist/core/v1/index.js.map +0 -1
  810. package/dist/core/v1/to/available-locations.js +0 -11
  811. package/dist/core/v1/to/available-locations.js.map +0 -1
  812. package/dist/core/v1/to/courses.js +0 -33
  813. package/dist/core/v1/to/courses.js.map +0 -1
  814. package/dist/core/v1/to/days.js +0 -13
  815. package/dist/core/v1/to/days.js.map +0 -1
  816. package/dist/core/v1/to/events.js +0 -35
  817. package/dist/core/v1/to/events.js.map +0 -1
  818. package/dist/core/v1/to/groups.js +0 -24
  819. package/dist/core/v1/to/groups.js.map +0 -1
  820. package/dist/core/v1/to/index.js +0 -10
  821. package/dist/core/v1/to/index.js.map +0 -1
  822. package/dist/core/v1/to/intervals.js +0 -14
  823. package/dist/core/v1/to/intervals.js.map +0 -1
  824. package/dist/core/v1/to/locations.js +0 -20
  825. package/dist/core/v1/to/locations.js.map +0 -1
  826. package/dist/core/v1/to/locked-times.js +0 -25
  827. package/dist/core/v1/to/locked-times.js.map +0 -1
  828. package/dist/core/v1/to/overlap-groups.js +0 -30
  829. package/dist/core/v1/to/overlap-groups.js.map +0 -1
  830. package/dist/core/v1/to/periods.js +0 -10
  831. package/dist/core/v1/to/periods.js.map +0 -1
  832. package/dist/core/v1/to/persons.js +0 -22
  833. package/dist/core/v1/to/persons.js.map +0 -1
  834. package/dist/core/v1/to/schedules.d.ts +0 -170
  835. package/dist/core/v1/to/schedules.js +0 -32
  836. package/dist/core/v1/to/schedules.js.map +0 -1
  837. package/dist/core/v1/to/settings.js +0 -13
  838. package/dist/core/v1/to/settings.js.map +0 -1
  839. package/dist/core/v1/to/teachers.js +0 -20
  840. package/dist/core/v1/to/teachers.js.map +0 -1
  841. package/dist/core/v1/types/areas.d.ts +0 -16
  842. package/dist/core/v1/types/available-locations.d.ts +0 -13
  843. package/dist/core/v1/types/break-lengths.d.ts +0 -5
  844. package/dist/core/v1/types/common/coalesced.d.ts +0 -10
  845. package/dist/core/v1/types/courses.d.ts +0 -54
  846. package/dist/core/v1/types/days.d.ts +0 -14
  847. package/dist/core/v1/types/division-settings.d.ts +0 -39
  848. package/dist/core/v1/types/divisions.d.ts +0 -45
  849. package/dist/core/v1/types/events.d.ts +0 -60
  850. package/dist/core/v1/types/groups.d.ts +0 -37
  851. package/dist/core/v1/types/index.d.ts +0 -41
  852. package/dist/core/v1/types/intervals.d.ts +0 -17
  853. package/dist/core/v1/types/locations.d.ts +0 -32
  854. package/dist/core/v1/types/locked-times.d.ts +0 -39
  855. package/dist/core/v1/types/meta.d.ts +0 -9
  856. package/dist/core/v1/types/overlap-groups.d.ts +0 -26
  857. package/dist/core/v1/types/periods.d.ts +0 -22
  858. package/dist/core/v1/types/persons.d.ts +0 -40
  859. package/dist/core/v1/types/teachers.d.ts +0 -34
  860. package/dist/core/v2/from/courses.js +0 -13
  861. package/dist/core/v2/from/courses.js.map +0 -1
  862. package/dist/core/v2/from/events.js +0 -12
  863. package/dist/core/v2/from/events.js.map +0 -1
  864. package/dist/core/v2/from/exceptions.js +0 -13
  865. package/dist/core/v2/from/exceptions.js.map +0 -1
  866. package/dist/core/v2/from/groups.js +0 -13
  867. package/dist/core/v2/from/groups.js.map +0 -1
  868. package/dist/core/v2/from/index.js.map +0 -1
  869. package/dist/core/v2/from/locations.js +0 -13
  870. package/dist/core/v2/from/locations.js.map +0 -1
  871. package/dist/core/v2/from/locked-times.js +0 -13
  872. package/dist/core/v2/from/locked-times.js.map +0 -1
  873. package/dist/core/v2/from/overlap-groups.js +0 -13
  874. package/dist/core/v2/from/overlap-groups.js.map +0 -1
  875. package/dist/core/v2/from/periods.js +0 -13
  876. package/dist/core/v2/from/periods.js.map +0 -1
  877. package/dist/core/v2/from/persons.js +0 -12
  878. package/dist/core/v2/from/persons.js.map +0 -1
  879. package/dist/core/v2/from/root-intervals.js +0 -13
  880. package/dist/core/v2/from/root-intervals.js.map +0 -1
  881. package/dist/core/v2/from/schedules.d.ts +0 -245
  882. package/dist/core/v2/from/schedules.js +0 -48
  883. package/dist/core/v2/from/schedules.js.map +0 -1
  884. package/dist/core/v2/from/syllabuses.js.map +0 -1
  885. package/dist/core/v2/from/teachers.js +0 -13
  886. package/dist/core/v2/from/teachers.js.map +0 -1
  887. package/dist/core/v2/index.d.ts +0 -16
  888. package/dist/core/v2/index.js +0 -12
  889. package/dist/core/v2/index.js.map +0 -1
  890. package/dist/core/v2/to/available-locations.js +0 -11
  891. package/dist/core/v2/to/available-locations.js.map +0 -1
  892. package/dist/core/v2/to/courses.js +0 -44
  893. package/dist/core/v2/to/courses.js.map +0 -1
  894. package/dist/core/v2/to/days.js +0 -13
  895. package/dist/core/v2/to/days.js.map +0 -1
  896. package/dist/core/v2/to/division.js +0 -10
  897. package/dist/core/v2/to/division.js.map +0 -1
  898. package/dist/core/v2/to/events.js +0 -47
  899. package/dist/core/v2/to/events.js.map +0 -1
  900. package/dist/core/v2/to/exceptions.js +0 -29
  901. package/dist/core/v2/to/exceptions.js.map +0 -1
  902. package/dist/core/v2/to/groups.js +0 -34
  903. package/dist/core/v2/to/groups.js.map +0 -1
  904. package/dist/core/v2/to/index.d.ts +0 -9
  905. package/dist/core/v2/to/index.js +0 -10
  906. package/dist/core/v2/to/index.js.map +0 -1
  907. package/dist/core/v2/to/intervals.js +0 -13
  908. package/dist/core/v2/to/intervals.js.map +0 -1
  909. package/dist/core/v2/to/locations.js +0 -35
  910. package/dist/core/v2/to/locations.js.map +0 -1
  911. package/dist/core/v2/to/locked-times.js +0 -25
  912. package/dist/core/v2/to/locked-times.js.map +0 -1
  913. package/dist/core/v2/to/overlap-groups.js +0 -30
  914. package/dist/core/v2/to/overlap-groups.js.map +0 -1
  915. package/dist/core/v2/to/periods.js +0 -10
  916. package/dist/core/v2/to/periods.js.map +0 -1
  917. package/dist/core/v2/to/persons.js +0 -25
  918. package/dist/core/v2/to/persons.js.map +0 -1
  919. package/dist/core/v2/to/root-intervals.js +0 -10
  920. package/dist/core/v2/to/root-intervals.js.map +0 -1
  921. package/dist/core/v2/to/schedules.d.ts +0 -249
  922. package/dist/core/v2/to/schedules.js +0 -40
  923. package/dist/core/v2/to/schedules.js.map +0 -1
  924. package/dist/core/v2/to/settings.js +0 -13
  925. package/dist/core/v2/to/settings.js.map +0 -1
  926. package/dist/core/v2/to/syllabuses.js +0 -16
  927. package/dist/core/v2/to/syllabuses.js.map +0 -1
  928. package/dist/core/v2/to/teachers.js +0 -28
  929. package/dist/core/v2/to/teachers.js.map +0 -1
  930. package/dist/core/v2/types/areas.d.ts +0 -16
  931. package/dist/core/v2/types/available-locations.d.ts +0 -13
  932. package/dist/core/v2/types/break-lengths.d.ts +0 -5
  933. package/dist/core/v2/types/common/coalesced.d.ts +0 -10
  934. package/dist/core/v2/types/common/planned-schedule-duration.d.ts +0 -7
  935. package/dist/core/v2/types/courses.d.ts +0 -76
  936. package/dist/core/v2/types/days.d.ts +0 -14
  937. package/dist/core/v2/types/divisions.d.ts +0 -54
  938. package/dist/core/v2/types/events.d.ts +0 -76
  939. package/dist/core/v2/types/groups.d.ts +0 -50
  940. package/dist/core/v2/types/index.d.ts +0 -49
  941. package/dist/core/v2/types/intervals.d.ts +0 -17
  942. package/dist/core/v2/types/locations.d.ts +0 -38
  943. package/dist/core/v2/types/locked-times.d.ts +0 -44
  944. package/dist/core/v2/types/overlap-groups.d.ts +0 -26
  945. package/dist/core/v2/types/periods.d.ts +0 -25
  946. package/dist/core/v2/types/root-intervals.d.ts +0 -23
  947. package/dist/core/v2/types/schedules.d.ts +0 -38
  948. package/dist/core/v2/types/syllabus.d.ts +0 -27
  949. package/dist/vKlass/from/index.d.ts +0 -9
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["id: string","map","locationReferences: { groupIndex: number; to: string }[]","x","groupReferences: { to: string }[]","teacherReferences: { to: string }[]","warnings: { code: Types.ErrorCode, context?: any }[]","settings: CoreTypes.divisionSettings","y: C_Syllabus","group: string | undefined","sex: C_Person['sex']","person: C_Person","expectedTotalHours: number | undefined","minutesPerWeek: number | undefined","e","event: C_Event","course: C_Course"],"sources":["../../../../src/Excel/v2/from/index.ts"],"sourcesContent":["import { isString, isNumber, countBy, values } from 'lodash-es';\nimport { nanoid } from 'nanoid';\n\nimport { Types as CoreTypes, FromInterface } from '../../../core/types';\nimport { Types } from '../types';\n\n\ntype C_Location = CoreTypes.location & { id: string } & { __raw: Types.Location };\ntype C_Group = CoreTypes.group & { id: string } & { __raw: Types.Group };\ntype C_Teacher = CoreTypes.teacher & { id: string } & { __raw: Types.Teacher };\ntype C_Course = CoreTypes.course & { id: string } & { __raw: Types.Course };\ntype C_Person = CoreTypes.person & { id: string } & { __raw: Types.Person };\ntype C_Event = CoreTypes.event & { id: string } & { __raw?: Types.Course };\ntype C_OverlapGroup = CoreTypes.overlapGroup & { id: string } & { /* raw: Types.OverlapGroup */ };\ntype C_Syllabus = CoreTypes.syllabus & { id: string } & { __raw?: Types.Syllabus };\n\n\nfunction generateId (map: Map<string, any>) {\n // generate a unique id\n let id: string;\n do {\n id = nanoid(8);\n } while (map.has(id));\n\n return id;\n}\n\nfunction toPositiveMultipleOf5 (val: number | string) {\n const num = isString(val) ? parseInt(val) : val;\n\n // throw error if nan\n if (isNaN(num)) throw new Error(`toMultipleOf5: ${val} is not a number`);\n\n const res = Math.floor(num / 5) * 5;\n\n if (res <= 0) throw new Error(`toMultipleOf5: the result ${res} is not positive`);\n\n return res;\n}\n\nfunction toPositiveInteger (val: number | string) {\n const num = isString(val) ? parseInt(val) : val;\n\n // throw error if nan\n if (isNaN(num)) throw new Error(`toInteger: ${val} is not a number`);\n if (num <= 0) throw new Error(`toInteger: te result ${num} is not positive`);\n\n return num;\n}\n\nfunction toString<T extends string | number | undefined, R = T extends undefined ? (string | undefined) : string> (x: T): R {\n if (x == undefined ) return undefined as R;\n if (typeof x == 'string' && !x.length) return undefined as R;\n if (isNumber(x) ) return x.toString() as R;\n return x.trim() as R;\n}\n\nfunction extractLocations (\n course: Types.Course,\n locationsNameMap: Map<string, C_Location>,\n warnings: { code: Types.ErrorCode, context?: any }[],\n) {\n const locationsStr = toString(course.locations);\n if (!locationsStr) return undefined;\n\n const locationReferences: { groupIndex: number; to: string }[] = [];\n\n locationsStr.split('+')\n .flatMap((x, i) => x.split(',').map(x => [i, x.trim()] as [number, string]))\n .forEach(([i, x]) => {\n const key = x.toLowerCase();\n const ref = locationsNameMap.get(key);\n if (!ref) {\n warnings.push({ code: 'invalid_location_reference', context: x });\n return;\n }\n\n if (locationReferences.some(y => y.to == ref.id)) {\n warnings.push({ code: 'location_referenced_multiple_times', context: x });\n return;\n }\n\n locationReferences.push({ groupIndex: i, to: ref.id });\n });\n\n return locationReferences;\n}\n\nfunction extractGroups (\n course: Types.Course,\n groupsNameMap: Map<string, C_Group>,\n warnings: { code: Types.ErrorCode, context?: any }[],\n) {\n const groupsStr = toString(course.groups);\n if (!groupsStr) return undefined;\n\n const groupReferences: { to: string }[] = [];\n groupsStr.split(',').map(x => x.trim())\n .forEach(x => {\n const key = x.toLowerCase();\n const ref = groupsNameMap.get(key);\n if (!ref) {\n warnings.push({ code: 'invalid_group_reference', context: x });\n return;\n }\n\n if (groupReferences.some(y => y.to == ref.id)) {\n warnings.push({ code: 'group_referenced_multiple_times', context: x });\n return;\n }\n\n groupReferences.push({ to: ref.id });\n });\n\n return groupReferences;\n}\n\nfunction extractTeachers (\n course: Types.Course,\n teachersNameMap: Map<string, C_Teacher>,\n warnings: { code: Types.ErrorCode, context?: any }[],\n) {\n const teachersStr = toString(course.teachers);\n if (!teachersStr) return undefined;\n\n const teacherReferences: { to: string }[] = [];\n teachersStr.split(',').map(x => x.trim())\n .forEach(x => {\n const key = x.toLowerCase();\n const ref = teachersNameMap.get(key);\n if (!ref) {\n warnings.push({ code: 'invalid_teacher_reference', context: x });\n return;\n }\n\n if (teacherReferences.some(y => y.to == ref.id)) {\n warnings.push({ code: 'teacher_referenced_multiple_times', context: x });\n return;\n }\n\n teacherReferences.push({ to: ref.id });\n });\n\n return teacherReferences;\n}\n\nfunction extractSyllabus (\n course: Types.Course,\n syllabusesCodeMap: Map<string, C_Syllabus>,\n syllabusesNameMap: Map<string, C_Syllabus>,\n warnings: { code: Types.ErrorCode, context?: any }[],\n): string | undefined {\n const syllabusValue = toString(course.syllabus);\n if (!syllabusValue) return undefined;\n\n const syllabus = syllabusesCodeMap.get(syllabusValue) || syllabusesNameMap.get(syllabusValue.toLowerCase());\n\n if (!syllabus) {\n warnings.push({ code: 'invalid_syllabus_reference', context: syllabusValue });\n return undefined;\n }\n\n return syllabus.id;\n}\n\n\nfunction _schedules (\n source: Types.Source\n): CoreTypes.division {\n // gather all import related warnings/errors\n const warnings: { code: Types.ErrorCode, context?: any }[] = [];\n // let errors: string[] = [];\n\n source.settings = source.settings ?.filter(x => Object.values(x).some(y => y.toString().trim().length > 0));\n source.locations = source.locations?.filter(x => Object.values(x).some(y => y.toString().trim().length > 0));\n source.teachers = source.teachers ?.filter(x => Object.values(x).some(y => y.toString().trim().length > 0));\n source.groups = source.groups ?.filter(x => Object.values(x).some(y => y.toString().trim().length > 0));\n source.persons = source.persons ?.filter(x => Object.values(x).some(y => y.toString().trim().length > 0));\n source.courses = source.courses ?.filter(x => Object.values(x).some(y => y.toString().trim().length > 0));\n\n\n ////\n //// settings\n ////\n const settings: CoreTypes.divisionSettings = {\n discretization: 5,\n numDays: 5,\n dayStart: '08:00',\n dayEnd: '17:00',\n };\n if (!source.settings) {\n warnings.push({ code: 'missing_settings_sheet' });\n }\n if (source.settings?.[0]?.number_of_days) {\n const numDays = source.settings?.[0]?.number_of_days;\n try {\n settings.numDays = toPositiveInteger(numDays);\n\n // must be 5 or 7\n if (settings.numDays !== 5 && settings.numDays !== 7) {\n warnings.push({ code: 'invalid_number_of_days', context: numDays });\n settings.numDays = 5;\n }\n } catch (e) {\n warnings.push({ code: 'invalid_number_of_days', context: numDays });\n }\n }\n\n ////\n //// syllabuses\n ////\n const syllabusesIdMap = new Map<string, C_Syllabus>();\n const syllabusesNameMap = new Map<string, C_Syllabus>();\n const syllabusesCodeMap = new Map<string, C_Syllabus>();\n if (!source.syllabuses) {\n // warnings.push({ code: 'missing_syllabus_sheet' });\n }\n source.syllabuses?.forEach(x => {\n const ids = toString(x.foreign_ID);\n const subjectCode = toString(x.subject_code);\n const subjectName = toString(x.subject_name);\n const courseCode = toString(x.course_code );\n const courseName = toString(x.course_name );\n const schoolType = toString(x.school_type);\n\n const id = x.ID?.toString() ?? generateId(syllabusesIdMap);\n if (syllabusesIdMap.has(id)) {\n warnings.push({ code: 'ignoring_duplicate_syllabus', context: `${subjectName} (${courseName})` });\n return;\n }\n\n if (!subjectName) {\n warnings.push({ code: 'missing_subject_name', context: x });\n return;\n }\n\n if (!schoolType) {\n warnings.push({ code: 'missing_school_type', context: x });\n return;\n }\n\n // create the syllabus object\n const y: C_Syllabus = {\n id,\n ...ids && { ids },\n ...subjectCode && { subjectCode },\n subjectName,\n ...courseCode && { courseCode },\n ...courseName && { courseName },\n schoolType,\n official: true, // always true for imported syllabuses\n __raw: x\n };\n syllabusesIdMap.set(id, y);\n const code = courseCode || subjectCode;\n const name = courseName || subjectName;\n if (code) syllabusesCodeMap.set(code, y);\n if (name) syllabusesNameMap.set(name.toLowerCase(), y);\n });\n\n\n ////\n //// locations, teachers\n ////\n const locationsIdMap = new Map<string, C_Location>();\n const locationsNameMap = new Map<string, C_Location>();\n const teachersIdMap = new Map<string, C_Teacher>();\n const teachersNameMap = new Map<string, C_Teacher>();\n [\n {\n name: { singular: 'location', plural: 'locations' } as const,\n data: source.locations,\n idMap: locationsIdMap,\n nameMap: locationsNameMap,\n },\n {\n name: { singular: 'teacher', plural: 'teachers' } as const,\n data: source.teachers,\n idMap: teachersIdMap,\n nameMap: teachersNameMap,\n }\n ].forEach(({ name, data, idMap, nameMap }) => {\n if (!data) {\n warnings.push({ code: `missing_${name.plural}_sheet` });\n }\n data?.forEach(x => {\n const ids = toString(x.foreign_ID);\n const displayName = toString(x.name);\n\n const id = x.ID?.toString() ?? generateId(idMap);\n if (idMap.has(id)) {\n warnings.push({ code: `ignoring_duplicate_${name.singular}`, context: displayName });\n return;\n }\n\n const y = {\n id,\n ...ids && { ids },\n ...displayName && { displayName },\n __raw: x\n };\n idMap.set(id, y);\n if (displayName) nameMap.set(displayName.toLowerCase(), y);\n });\n });\n\n\n ////\n //// groups\n ////\n const groupsIdMap = new Map<string, C_Group>();\n const groupsNameMap = new Map<string, C_Group>();\n if (!source.groups) {\n warnings.push({ code: 'missing_groups_sheet' });\n }\n source.groups?.forEach(x => {\n const ids = toString(x.foreign_ID);\n const displayName = toString(x.name);\n\n const id = x.ID?.toString() ?? generateId(groupsIdMap);\n if (groupsIdMap.has(id)) {\n warnings.push({ code: 'ignoring_duplicate_group', context: displayName });\n return;\n }\n\n // parent groups determine the species of the group\n const species = toString(x.is_class) == '1' ? 'class' : undefined;\n\n const y = {\n id,\n ...ids && { ids },\n ...displayName && { displayName },\n ...species && { species },\n __raw: x\n };\n groupsIdMap.set(id, y);\n if (displayName) groupsNameMap.set(displayName.toLowerCase(), y);\n });\n\n\n ////\n //// persons\n ////\n const personsIdMap = new Map<string, C_Person>();\n const personsSsnMap = new Map<string, C_Person>();\n if (!source.persons) {\n warnings.push({ code: 'missing_persons_sheet' });\n }\n source.persons?.forEach(x => {\n const ids = toString(x.foreign_ID);\n const firstName = toString(x.first_name);\n const lastName = toString(x.last_name );\n const SSN = toString(x.SSN );\n\n const id = x.ID?.toString() ?? generateId(personsIdMap);\n if (personsIdMap.has(id)) {\n warnings.push({ code: 'ignoring_duplicate_person', context: `${firstName} ${lastName}` });\n return;\n }\n\n let group: string | undefined = undefined;\n if (x.group) {\n const key = toString(x.group).toLowerCase();\n const ref = groupsNameMap.get(key);\n if (!ref) {\n warnings.push({ code: 'invalid_group_reference', context: x.group });\n } else if (ref.species !== 'class') {\n warnings.push({ code: 'forbidden_group_reference', context: x.group });\n } else {\n group = ref.id;\n }\n }\n\n let sex: C_Person['sex'];\n if (x.sex) {\n if (isString(x.sex) && x.sex.toLowerCase() == 'man') sex = 'Man';\n else if (isString(x.sex) && x.sex.toLowerCase() == 'woman') sex = 'Woman';\n else {\n warnings.push({ code: 'invalid_sex', context: x.sex });\n }\n }\n\n const person: C_Person = {\n id,\n ...ids && { ids },\n ...firstName && { firstName },\n ...lastName && { lastName },\n ...sex && { sex },\n ...group && { group },\n ...SSN && { SSN: { value: SSN } },\n __raw: x\n };\n personsIdMap.set(id, person);\n if (SSN) personsSsnMap.set(SSN, person);\n });\n\n\n ////\n //// group.members (need to wait for persons to be parsed)\n ////\n groupsNameMap.forEach(x => {\n let duplicateReported = false;\n\n // parse and replace SSN by person id\n x.members = Object.entries(countBy(\n (toString(x.__raw.members) ?? '')\n .split(',')\n .map(x => x.trim())\n .filter(Boolean)\n ))\n .map(([ssn, count]) => {\n // warn if duplicate member\n if (!duplicateReported && count > 1) {\n warnings.push({ code: 'duplicate_group_member', context: x.displayName });\n duplicateReported = true;\n }\n\n // fetch person and warn if not found\n const person = personsSsnMap.get(ssn);\n if (!person) {\n warnings.push({ code: 'invalid_person_reference', context: ssn });\n return;\n }\n\n // warn if the group is a class and the person is already in a different class\n // (we also need to set the group of the person if it is empty)\n if (x.species == 'class') {\n if (!person.group) {\n person.group = x.id;\n }\n else if (person.group != x.id) {\n warnings.push({ code: 'person_in_multiple_classes', context: ssn });\n return;\n }\n }\n\n return person.id;\n })\n .filter((x): x is NonNullable<typeof x> => !!x);\n });\n\n\n ////\n //// courses\n ////\n const coursesIdMap = new Map<string, C_Course >();\n const eventsIdMap = new Map<string, C_Event >();\n const overlapGroupsKeyMap = new Map<string, C_OverlapGroup>();\n if (!source.courses) {\n warnings.push({ code: 'missing_courses_sheet' });\n }\n source.courses?.forEach(x => {\n // await loading events until courses are created\n const mergeWith = toString(x.merge_with);\n if (mergeWith) return;\n\n const ids = toString(x.foreign_ID);\n const displayName = toString(x.name)?.trim();\n const subject = toString(x.subject);\n\n const courseId = x.ID?.toString() ?? generateId(coursesIdMap);\n if (coursesIdMap.has(courseId)) {\n warnings.push({ code: 'ignoring_duplicate_course', context: displayName + (subject ? ` (${subject})` : '') });\n return;\n }\n\n // try to parse the total hours as an integer\n let expectedTotalHours: number | undefined = undefined;\n if (x.total_hours) {\n try {\n expectedTotalHours = toPositiveInteger(x.total_hours);\n } catch (e) {\n warnings.push({ code: 'invalid_total_hours', context: x.total_hours });\n }\n }\n\n // try to parse the minutes per week as an multiple of 5\n let minutesPerWeek: number | undefined = undefined;\n if (x.minutes_per_week) {\n try {\n minutesPerWeek = toPositiveMultipleOf5(x.minutes_per_week);\n } catch (e) {\n warnings.push({ code: 'invalid_minutes_per_week', context: x.minutes_per_week });\n }\n }\n\n // only one of minutes_per_week or total_hours should be defined\n if (minutesPerWeek != null && expectedTotalHours != null) {\n warnings.push({ code: 'ambiguous_planned_duration', context: `${minutesPerWeek} min/week OR ${expectedTotalHours} hrs` });\n }\n const plannedDuration =\n expectedTotalHours\n ? `${expectedTotalHours} hrs` :\n minutesPerWeek\n ? `${minutesPerWeek} min/week` :\n undefined;\n\n\n // try to parse the lesson durations as an array of integers from which we will generate events\n if (x.lesson_durations) {\n const _durations = typeof x.lesson_durations === 'string'\n ? x.lesson_durations.split(',').map(x => x.trim())\n : [x.lesson_durations];\n\n // truncate to multiple of 5 and filter out zero duration events\n const durations = _durations\n .map(e => {\n try {\n return toPositiveMultipleOf5(e);\n } catch (e) {\n warnings.push({ code: 'invalid_lesson_durations', context: x.lesson_durations });\n return undefined;\n }\n })\n .filter((x): x is number => x !== undefined);\n\n durations.forEach(x => {\n const id = generateId(eventsIdMap);\n const event: C_Event = { id, course: courseId, preferredDuration: x };\n eventsIdMap.set(id, event);\n });\n }\n\n // overlap group\n if (x.overlap_group && toString(x.overlap_group)) {\n const key = toString(x.overlap_group).toLowerCase();\n\n const og = overlapGroupsKeyMap.get(key);\n if (og) og.coalesced?.push({ toModel: 'courses', to: courseId });\n else {\n const id = generateId(overlapGroupsKeyMap);\n const coalesced = [{ toModel: 'courses', to: courseId }];\n overlapGroupsKeyMap.set(key, { id, coalesced });\n }\n }\n\n const locations = extractLocations(x, locationsNameMap, warnings)?.map(x => ({ groupIndex: x.groupIndex, locations: [x.to] }));\n const groups = extractGroups (x, groupsNameMap, warnings);\n const teachers = extractTeachers (x, teachersNameMap, warnings);\n const syllabus = extractSyllabus(x, syllabusesCodeMap, syllabusesNameMap, warnings);\n\n const course: C_Course = {\n id: courseId,\n ...ids && { ids },\n ...displayName && { displayName },\n ...subject && { subject },\n /* TO BE DEPRECATED */ ...expectedTotalHours && { expectedTotalHours },\n /* TO BE DEPRECATED */ ...minutesPerWeek && { minutesPerWeek },\n ...plannedDuration && { plannedDuration },\n ...groups && { groups },\n ...teachers && { teachers },\n ...locations && { locations },\n ...syllabus && { syllabus },\n __raw: x\n };\n coursesIdMap.set(courseId, course);\n });\n\n\n ////\n //// events\n ////\n source.courses?.forEach(x => {\n // load courses\n const mergeWith = toString(x.merge_with);\n if (!mergeWith) return;\n\n // ensure that the course to merge with exists\n if (!coursesIdMap.has(mergeWith)) {\n warnings.push({ code: 'invalid_course_reference', context: mergeWith });\n return;\n }\n\n const displayName = toString(x.name)?.trim();\n const locations = extractLocations(x, locationsNameMap, warnings)?.map(x => ({ groupIndex: x.groupIndex, locations: [x.to] }));\n const groups = extractGroups (x, groupsNameMap, warnings);\n const teachers = extractTeachers (x, teachersNameMap, warnings);\n\n // try to parse the lesson durations as an array of integers from which we will generate events\n if (x.lesson_durations) {\n const _durations = typeof x.lesson_durations === 'string'\n ? x.lesson_durations.split(',').map(x => x.trim())\n : [x.lesson_durations];\n\n // truncate to multiple of 5 and filter out zero duration events\n const durations = _durations\n .map(e => {\n try {\n return toPositiveMultipleOf5(e);\n } catch (e) {\n warnings.push({ code: 'invalid_lesson_durations', context: x.lesson_durations });\n return undefined;\n }\n })\n .filter((x): x is number => x !== undefined);\n\n durations.forEach(preferredDuration => {\n const id = generateId(eventsIdMap);\n const event: C_Event = {\n id,\n course: mergeWith,\n preferredDuration: preferredDuration,\n ...displayName && { displayName },\n ...groups && { groups },\n ...teachers && { teachers },\n ...locations && { locations },\n __raw: x\n };\n eventsIdMap.set(id, event);\n });\n }\n });\n\n\n ////\n //// return\n ////\n return {\n settings,\n locations: [...locationsIdMap .values()],\n teachers: [...teachersIdMap .values()],\n persons: [...personsIdMap .values()],\n groups: [...groupsIdMap .values()],\n courses: [...coursesIdMap .values()],\n events: [...eventsIdMap .values()],\n overlapGroups: [...overlapGroupsKeyMap.values()],\n syllabuses: [...syllabusesIdMap .values()],\n meta: {\n // ...errors .length && { errors: errors },\n ...warnings.length && { warnings: warnings }\n }\n };\n}\n\n\nexport default {\n schedules: _schedules\n} satisfies FromInterface;"],"mappings":";;;;AAiBA,SAAS,WAAY,OAAuB;CAE1C,IAAIA;AACJ;AACE,OAAK,OAAO;QACLC,MAAI,IAAI;AAEjB,QAAO;;AAGT,SAAS,sBAAuB,KAAsB;CACpD,MAAM,MAAM,SAAS,OAAO,SAAS,OAAO;AAG5C,KAAI,MAAM,KAAM,OAAM,IAAI,MAAM,kBAAkB,IAAI;CAEtD,MAAM,MAAM,KAAK,MAAM,MAAM,KAAK;AAElC,KAAI,OAAO,EAAG,OAAM,IAAI,MAAM,6BAA6B,IAAI;AAE/D,QAAO;;AAGT,SAAS,kBAAmB,KAAsB;CAChD,MAAM,MAAM,SAAS,OAAO,SAAS,OAAO;AAG5C,KAAI,MAAM,KAAM,OAAM,IAAI,MAAM,cAAc,IAAI;AAClD,KAAI,OAAO,EAAG,OAAM,IAAI,MAAM,wBAAwB,IAAI;AAE1D,QAAO;;AAGT,SAAS,SAA0G,GAAS;AAC1H,KAAI,KAAK,OAA+B,QAAO;AAC/C,KAAI,OAAO,KAAK,YAAY,CAAC,EAAE,OAAQ,QAAO;AAC9C,KAAI,SAAS,GAAyB,QAAO,EAAE;AAC/C,QAAO,EAAE;;AAGX,SAAS,iBACP,QACA,kBACA,UACA;CACA,MAAM,eAAe,SAAS,OAAO;AACrC,KAAI,CAAC,aAAc,QAAO;CAE1B,MAAMC,qBAA2D;AAEjE,cAAa,MAAM,KAChB,SAAS,GAAG,MAAM,EAAE,MAAM,KAAK,KAAI,QAAK,CAAC,GAAGC,IAAE,UAC9C,SAAS,C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AAC,GAAG,eAAoB;EACvC,UAAe,CAAC,GAAG,cAAoB;EACvC,SAAe,CAAC,GAAG,aAAoB;EACvC,QAAe,CAAC,GAAG,YAAoB;EACvC,SAAe,CAAC,GAAG,aAAoB;EACvC,QAAe,CAAC,GAAG,YAAoB;EACvC,eAAe,CAAC,GAAG,oBAAoB;EACvC,YAAe,CAAC,GAAG,gBAAoB;EACvC,MAAe,EAEb,GAAG,SAAS,UAAU,EAAY;;;AAMxC,mBAAe,EACb,WAAW"}
1
+ {"version":3,"file":"index.js","names":["id: string","locationReferences: { groupIndex: number; to: string }[]","x","groupReferences: { to: string }[]","teacherReferences: { to: string }[]","warnings: { code: Types.ErrorCode, context?: unknown }[]","settings: C_Settings","y: C_Syllabus","group: string | undefined","sex: C_Person['sex']","person: C_Person","expectedTotalHours: number | undefined","minutesPerWeek: number | undefined","event: C_Event","course: C_Course"],"sources":["../../../../src/Excel/v2/from/index.ts"],"sourcesContent":["import { isString, chain, isNumber } from 'lodash-es';\nimport { nanoid } from 'nanoid';\nimport type { CoreTypes } from '../../../core';\nimport type { Types } from '../types';\nimport type { FromInterface } from '../../../common/types';\n\ntype C_Settings = Pick<CoreTypes.serialized.divisionSettings, 'discretization' | 'numDays' | 'dayStart' | 'dayEnd'>;\ntype C_Location = CoreTypes.serialized.location & { id: string } & { __raw: Types.Location };\ntype C_Group = CoreTypes.serialized.group & { id: string } & { __raw: Types.Group };\ntype C_Teacher = CoreTypes.serialized.teacher & { id: string } & { __raw: Types.Teacher };\ntype C_Course = CoreTypes.serialized.course & { id: string } & { __raw: Types.Course };\ntype C_Person = CoreTypes.serialized.person & { id: string } & { __raw: Types.Person };\ntype C_Event = CoreTypes.serialized.event & { id: string } & { __raw?: Types.Course };\ntype C_OverlapGroup = CoreTypes.serialized.overlapGroup & { id: string } & { /* raw: Types.OverlapGroup */ };\ntype C_Syllabus = CoreTypes.serialized.syllabus & { id: string } & { __raw?: Types.Syllabus };\n\ntype Out = {\n settings: C_Settings;\n locations: C_Location[];\n teachers: C_Teacher[];\n persons: C_Person[];\n groups: C_Group[];\n courses: C_Course[];\n events: C_Event[];\n overlapGroups: C_OverlapGroup[];\n syllabuses: C_Syllabus[];\n meta: {\n // errors?: string[];\n warnings?: { code: Types.ErrorCode, context?: unknown }[];\n };\n};\n\n\nfunction generateId (map: Map<string, unknown>) {\n // generate a unique id\n let id: string;\n do {\n id = nanoid(8);\n } while (map.has(id));\n\n return id;\n}\n\nfunction toPositiveMultipleOf5 (val: number | string) {\n const num = isString(val) ? parseInt(val) : val;\n\n // throw error if nan\n if (isNaN(num)) throw new Error(`toMultipleOf5: ${val} is not a number`);\n\n const res = Math.floor(num / 5) * 5;\n\n if (res <= 0) throw new Error(`toMultipleOf5: the result ${res} is not positive`);\n\n return res;\n}\n\nfunction toPositiveInteger (val: number | string) {\n const num = isString(val) ? parseInt(val) : val;\n\n // throw error if nan\n if (isNaN(num)) throw new Error(`toInteger: ${val} is not a number`);\n if (num <= 0) throw new Error(`toInteger: te result ${num} is not positive`);\n\n return num;\n}\n\nfunction toString<T extends string | number | undefined, R = T extends undefined ? (string | undefined) : string> (x: T): R {\n if (x == undefined ) return undefined as R;\n if (typeof x == 'string' && !x.length) return undefined as R;\n if (isNumber(x) ) return x.toString() as R;\n return x.trim() as R;\n}\n\nfunction extractLocations (\n course: Types.Course,\n locationsNameMap: Map<string, C_Location>,\n warnings: { code: Types.ErrorCode, context?: unknown }[],\n) {\n const locationsStr = toString(course.locations);\n if (!locationsStr) return undefined;\n\n const locationReferences: { groupIndex: number; to: string }[] = [];\n\n locationsStr.split('+')\n .flatMap((x, i) => x.split(',').map(x => [i, x.trim()] as [number, string]))\n .forEach(([i, x]) => {\n const key = x.toLowerCase();\n const ref = locationsNameMap.get(key);\n if (!ref) {\n warnings.push({ code: 'invalid_location_reference', context: x });\n return;\n }\n\n if (locationReferences.some(y => y.to == ref.id)) {\n warnings.push({ code: 'location_referenced_multiple_times', context: x });\n return;\n }\n\n locationReferences.push({ groupIndex: i, to: ref.id });\n });\n\n return locationReferences;\n}\n\nfunction extractGroups (\n course: Types.Course,\n groupsNameMap: Map<string, C_Group>,\n warnings: { code: Types.ErrorCode, context?: unknown }[],\n) {\n const groupsStr = toString(course.groups);\n if (!groupsStr) return undefined;\n\n const groupReferences: { to: string }[] = [];\n groupsStr.split(',').map(x => x.trim())\n .forEach(x => {\n const key = x.toLowerCase();\n const ref = groupsNameMap.get(key);\n if (!ref) {\n warnings.push({ code: 'invalid_group_reference', context: x });\n return;\n }\n\n if (groupReferences.some(y => y.to == ref.id)) {\n warnings.push({ code: 'group_referenced_multiple_times', context: x });\n return;\n }\n\n groupReferences.push({ to: ref.id });\n });\n\n return groupReferences;\n}\n\nfunction extractTeachers (\n course: Types.Course,\n teachersNameMap: Map<string, C_Teacher>,\n warnings: { code: Types.ErrorCode, context?: unknown }[],\n) {\n const teachersStr = toString(course.teachers);\n if (!teachersStr) return undefined;\n\n const teacherReferences: { to: string }[] = [];\n teachersStr.split(',').map(x => x.trim())\n .forEach(x => {\n const key = x.toLowerCase();\n const ref = teachersNameMap.get(key);\n if (!ref) {\n warnings.push({ code: 'invalid_teacher_reference', context: x });\n return;\n }\n\n if (teacherReferences.some(y => y.to == ref.id)) {\n warnings.push({ code: 'teacher_referenced_multiple_times', context: x });\n return;\n }\n\n teacherReferences.push({ to: ref.id });\n });\n\n return teacherReferences;\n}\n\nfunction extractSyllabus (\n course: Types.Course,\n syllabusesCodeMap: Map<string, C_Syllabus>,\n syllabusesNameMap: Map<string, C_Syllabus>,\n warnings: { code: Types.ErrorCode, context?: unknown }[],\n): string | undefined {\n const syllabusValue = toString(course.syllabus);\n if (!syllabusValue) return undefined;\n\n const syllabus = syllabusesCodeMap.get(syllabusValue) || syllabusesNameMap.get(syllabusValue.toLowerCase());\n\n if (!syllabus) {\n warnings.push({ code: 'invalid_syllabus_reference', context: syllabusValue });\n return undefined;\n }\n\n return syllabus.id;\n}\n\n\nfunction _schedules (\n source: Types.Source\n): Out {\n // gather all import related warnings/errors\n const warnings: { code: Types.ErrorCode, context?: unknown }[] = [];\n // let errors: string[] = [];\n\n source.settings = source.settings ?.filter(x => Object.values(x).some(y => y.toString().trim().length > 0));\n source.locations = source.locations?.filter(x => Object.values(x).some(y => y.toString().trim().length > 0));\n source.teachers = source.teachers ?.filter(x => Object.values(x).some(y => y.toString().trim().length > 0));\n source.groups = source.groups ?.filter(x => Object.values(x).some(y => y.toString().trim().length > 0));\n source.persons = source.persons ?.filter(x => Object.values(x).some(y => y.toString().trim().length > 0));\n source.courses = source.courses ?.filter(x => Object.values(x).some(y => y.toString().trim().length > 0));\n\n\n ////\n //// settings\n ////\n const settings: C_Settings = {\n discretization: 5,\n numDays: 5,\n dayStart: '08:00',\n dayEnd: '17:00',\n };\n if (!source.settings) {\n warnings.push({ code: 'missing_settings_sheet' });\n }\n if (source.settings?.[0]?.number_of_days) {\n const numDays = source.settings?.[0]?.number_of_days;\n try {\n settings.numDays = toPositiveInteger(numDays);\n\n // must be 5 or 7\n if (settings.numDays !== 5 && settings.numDays !== 7) {\n warnings.push({ code: 'invalid_number_of_days', context: numDays });\n settings.numDays = 5;\n }\n } catch {\n warnings.push({ code: 'invalid_number_of_days', context: numDays });\n }\n }\n\n ////\n //// syllabuses\n ////\n const syllabusesIdMap = new Map<string, C_Syllabus>();\n const syllabusesNameMap = new Map<string, C_Syllabus>();\n const syllabusesCodeMap = new Map<string, C_Syllabus>();\n if (!source.syllabuses) {\n // warnings.push({ code: 'missing_syllabus_sheet' });\n }\n source.syllabuses?.forEach(x => {\n const ids = toString(x.foreign_ID);\n const subjectCode = toString(x.subject_code);\n const subjectName = toString(x.subject_name);\n const courseCode = toString(x.course_code );\n const courseName = toString(x.course_name );\n const schoolType = toString(x.school_type);\n\n const id = x.ID?.toString() ?? generateId(syllabusesIdMap);\n if (syllabusesIdMap.has(id)) {\n warnings.push({ code: 'ignoring_duplicate_syllabus', context: `${subjectName} (${courseName})` });\n return;\n }\n\n if (!subjectName) {\n warnings.push({ code: 'missing_subject_name', context: x });\n return;\n }\n\n if (!schoolType) {\n warnings.push({ code: 'missing_school_type', context: x });\n return;\n }\n\n // create the syllabus object\n const y: C_Syllabus = {\n id,\n ...ids && { ids },\n ...subjectCode && { subjectCode },\n subjectName,\n ...courseCode && { courseCode },\n ...courseName && { courseName },\n schoolType,\n official: true, // always true for imported syllabuses\n __raw: x\n };\n syllabusesIdMap.set(id, y);\n const code = courseCode || subjectCode;\n const name = courseName || subjectName;\n if (code) syllabusesCodeMap.set(code, y);\n if (name) syllabusesNameMap.set(name.toLowerCase(), y);\n });\n\n\n ////\n //// locations, teachers\n ////\n const locationsIdMap = new Map<string, C_Location>();\n const locationsNameMap = new Map<string, C_Location>();\n const teachersIdMap = new Map<string, C_Teacher>();\n const teachersNameMap = new Map<string, C_Teacher>();\n [\n {\n name: { singular: 'location', plural: 'locations' } as const,\n data: source.locations,\n idMap: locationsIdMap,\n nameMap: locationsNameMap,\n },\n {\n name: { singular: 'teacher', plural: 'teachers' } as const,\n data: source.teachers,\n idMap: teachersIdMap,\n nameMap: teachersNameMap,\n }\n ].forEach(({ name, data, idMap, nameMap }) => {\n if (!data) {\n warnings.push({ code: `missing_${name.plural}_sheet` });\n }\n data?.forEach(x => {\n const ids = toString(x.foreign_ID);\n const displayName = toString(x.name);\n\n const id = x.ID?.toString() ?? generateId(idMap);\n if (idMap.has(id)) {\n warnings.push({ code: `ignoring_duplicate_${name.singular}`, context: displayName });\n return;\n }\n\n const y = {\n id,\n ...ids && { ids },\n ...displayName && { displayName },\n __raw: x\n };\n idMap.set(id, y);\n if (displayName) nameMap.set(displayName.toLowerCase(), y);\n });\n });\n\n\n ////\n //// groups\n ////\n const groupsIdMap = new Map<string, C_Group>();\n const groupsNameMap = new Map<string, C_Group>();\n if (!source.groups) {\n warnings.push({ code: 'missing_groups_sheet' });\n }\n source.groups?.forEach(x => {\n const ids = toString(x.foreign_ID);\n const displayName = toString(x.name);\n\n const id = x.ID?.toString() ?? generateId(groupsIdMap);\n if (groupsIdMap.has(id)) {\n warnings.push({ code: 'ignoring_duplicate_group', context: displayName });\n return;\n }\n\n // parent groups determine the species of the group\n const species = toString(x.is_class) == '1' ? 'class' as const : undefined;\n\n const y = {\n id,\n ...ids && { ids },\n ...displayName && { displayName },\n ...species && { species },\n __raw: x\n };\n groupsIdMap.set(id, y);\n if (displayName) groupsNameMap.set(displayName.toLowerCase(), y);\n });\n\n\n ////\n //// persons\n ////\n const personsIdMap = new Map<string, C_Person>();\n const personsSsnMap = new Map<string, C_Person>();\n if (!source.persons) {\n warnings.push({ code: 'missing_persons_sheet' });\n }\n source.persons?.forEach(x => {\n const ids = toString(x.foreign_ID);\n const firstName = toString(x.first_name);\n const lastName = toString(x.last_name );\n const SSN = toString(x.SSN );\n\n const id = x.ID?.toString() ?? generateId(personsIdMap);\n if (personsIdMap.has(id)) {\n warnings.push({ code: 'ignoring_duplicate_person', context: `${firstName} ${lastName}` });\n return;\n }\n\n let group: string | undefined = undefined;\n if (x.group) {\n const key = toString(x.group).toLowerCase();\n const ref = groupsNameMap.get(key);\n if (!ref) {\n warnings.push({ code: 'invalid_group_reference', context: x.group });\n } else if (ref.species !== 'class') {\n warnings.push({ code: 'forbidden_group_reference', context: x.group });\n } else {\n group = ref.id;\n }\n }\n\n let sex: C_Person['sex'];\n if (x.sex) {\n if (isString(x.sex) && x.sex.toLowerCase() == 'man') sex = 'Man';\n else if (isString(x.sex) && x.sex.toLowerCase() == 'woman') sex = 'Woman';\n else {\n warnings.push({ code: 'invalid_sex', context: x.sex });\n }\n }\n\n const person: C_Person = {\n id,\n ...ids && { ids },\n ...firstName && { firstName },\n ...lastName && { lastName },\n ...sex && { sex },\n ...group && { group },\n ...SSN && { SSN: { value: SSN } },\n __raw: x\n };\n personsIdMap.set(id, person);\n if (SSN) personsSsnMap.set(SSN, person);\n });\n\n\n ////\n //// group.members (need to wait for persons to be parsed)\n ////\n groupsNameMap.forEach(x => {\n let duplicateReported = false;\n\n // parse and replace SSN by person id\n x.members = chain(toString(x.__raw.members))\n .split(',')\n .map(x => x.trim())\n .filter(Boolean)\n .countBy()\n .map((count, ssn) => {\n // warn if duplicate member\n if (!duplicateReported && count > 1) {\n warnings.push({ code: 'duplicate_group_member', context: x.displayName });\n duplicateReported = true;\n }\n\n // fetch person and warn if not found\n const person = personsSsnMap.get(ssn);\n if (!person) {\n warnings.push({ code: 'invalid_person_reference', context: ssn });\n return;\n }\n\n // warn if the group is a class and the person is already in a different class\n // (we also need to set the group of the person if it is empty)\n if (x.species == 'class') {\n if (!person.group) {\n person.group = x.id;\n }\n else if (person.group != x.id) {\n warnings.push({ code: 'person_in_multiple_classes', context: ssn });\n return;\n }\n }\n\n return person.id;\n })\n .filter((x): x is NonNullable<typeof x> => !!x)\n .value();\n });\n\n\n ////\n //// courses\n ////\n const coursesIdMap = new Map<string, C_Course >();\n const eventsIdMap = new Map<string, C_Event >();\n const overlapGroupsKeyMap = new Map<string, C_OverlapGroup>();\n if (!source.courses) {\n warnings.push({ code: 'missing_courses_sheet' });\n }\n source.courses?.forEach(x => {\n // await loading events until courses are created\n const mergeWith = toString(x.merge_with);\n if (mergeWith) return;\n\n const ids = toString(x.foreign_ID);\n const displayName = toString(x.name)?.trim();\n const subject = toString(x.subject);\n\n const courseId = x.ID?.toString() ?? generateId(coursesIdMap);\n if (coursesIdMap.has(courseId)) {\n warnings.push({ code: 'ignoring_duplicate_course', context: displayName + (subject ? ` (${subject})` : '') });\n return;\n }\n\n // try to parse the total hours as an integer\n let expectedTotalHours: number | undefined = undefined;\n if (x.total_hours) {\n try {\n expectedTotalHours = toPositiveInteger(x.total_hours);\n } catch {\n warnings.push({ code: 'invalid_total_hours', context: x.total_hours });\n }\n }\n\n // try to parse the minutes per week as an multiple of 5\n let minutesPerWeek: number | undefined = undefined;\n if (x.minutes_per_week) {\n try {\n minutesPerWeek = toPositiveMultipleOf5(x.minutes_per_week);\n } catch {\n warnings.push({ code: 'invalid_minutes_per_week', context: x.minutes_per_week });\n }\n }\n\n // only one of minutes_per_week or total_hours should be defined\n if (minutesPerWeek != null && expectedTotalHours != null) {\n warnings.push({ code: 'ambiguous_planned_duration', context: `${minutesPerWeek} min/week OR ${expectedTotalHours} hrs` });\n }\n const plannedDuration =\n expectedTotalHours\n ? `${expectedTotalHours} hrs` :\n minutesPerWeek\n ? `${minutesPerWeek} min/week` :\n undefined;\n\n\n // try to parse the lesson durations as an array of integers from which we will generate events\n if (x.lesson_durations) {\n const _durations = typeof x.lesson_durations === 'string'\n ? x.lesson_durations.split(',').map(x => x.trim())\n : [x.lesson_durations];\n\n // truncate to multiple of 5 and filter out zero duration events\n const durations = _durations\n .map(e => {\n try {\n return toPositiveMultipleOf5(e);\n } catch {\n warnings.push({ code: 'invalid_lesson_durations', context: x.lesson_durations });\n return undefined;\n }\n })\n .filter((x): x is number => x !== undefined);\n\n durations.forEach(x => {\n const id = generateId(eventsIdMap);\n const event: C_Event = { id, course: courseId, preferredDuration: x };\n eventsIdMap.set(id, event);\n });\n }\n\n // overlap group\n if (x.overlap_group && toString(x.overlap_group)) {\n const key = toString(x.overlap_group).toLowerCase();\n\n const og = overlapGroupsKeyMap.get(key);\n if (og) og.coalesced?.push({ toModel: 'courses', to: courseId });\n else {\n const id = generateId(overlapGroupsKeyMap);\n const coalesced = [{ toModel: 'courses' as const, to: courseId }];\n overlapGroupsKeyMap.set(key, { id, coalesced });\n }\n }\n\n const locations = extractLocations(x, locationsNameMap, warnings)?.map(x => ({ groupIndex: x.groupIndex, locations: [x.to] as [string] }));\n const groups = extractGroups (x, groupsNameMap, warnings);\n const teachers = extractTeachers (x, teachersNameMap, warnings);\n const syllabus = extractSyllabus(x, syllabusesCodeMap, syllabusesNameMap, warnings);\n\n const course: C_Course = {\n id: courseId,\n ...ids && { ids },\n ...displayName && { displayName },\n ...subject && { subject },\n /* TO BE DEPRECATED */ ...expectedTotalHours && { expectedTotalHours },\n /* TO BE DEPRECATED */ ...minutesPerWeek && { minutesPerWeek },\n ...plannedDuration && { plannedDuration },\n ...groups && { groups },\n ...teachers && { teachers },\n ...locations && { locations },\n ...syllabus && { syllabus },\n __raw: x\n };\n coursesIdMap.set(courseId, course);\n });\n\n\n ////\n //// events\n ////\n source.courses?.forEach(x => {\n // load courses\n const mergeWith = toString(x.merge_with);\n if (!mergeWith) return;\n\n // ensure that the course to merge with exists\n if (!coursesIdMap.has(mergeWith)) {\n warnings.push({ code: 'invalid_course_reference', context: mergeWith });\n return;\n }\n\n const displayName = toString(x.name)?.trim();\n const locations = extractLocations(x, locationsNameMap, warnings)?.map(x => ({ groupIndex: x.groupIndex, locations: [x.to] as [string] }));\n const groups = extractGroups (x, groupsNameMap, warnings);\n const teachers = extractTeachers (x, teachersNameMap, warnings);\n\n // try to parse the lesson durations as an array of integers from which we will generate events\n if (x.lesson_durations) {\n const _durations = typeof x.lesson_durations === 'string'\n ? x.lesson_durations.split(',').map(x => x.trim())\n : [x.lesson_durations];\n\n // truncate to multiple of 5 and filter out zero duration events\n const durations = _durations\n .map(e => {\n try {\n return toPositiveMultipleOf5(e);\n } catch {\n warnings.push({ code: 'invalid_lesson_durations', context: x.lesson_durations });\n return undefined;\n }\n })\n .filter((x): x is number => x !== undefined);\n\n durations.forEach(preferredDuration => {\n const id = generateId(eventsIdMap);\n const event: C_Event = {\n id,\n course: mergeWith,\n preferredDuration: preferredDuration,\n ...displayName && { displayName },\n ...groups && { groups },\n ...teachers && { teachers },\n ...locations && { locations },\n __raw: x\n };\n eventsIdMap.set(id, event);\n });\n }\n });\n\n\n ////\n //// return\n ////\n return {\n settings,\n locations: [...locationsIdMap .values()],\n teachers: [...teachersIdMap .values()],\n persons: [...personsIdMap .values()],\n groups: [...groupsIdMap .values()],\n courses: [...coursesIdMap .values()],\n events: [...eventsIdMap .values()],\n overlapGroups: [...overlapGroupsKeyMap.values()],\n syllabuses: [...syllabusesIdMap .values()],\n meta: {\n // ...errors .length && { errors: errors },\n ...warnings.length && { warnings: warnings }\n }\n };\n}\n\n\nexport default {\n schedules: _schedules\n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,61 @@
1
- import { Types as Types$1 } from "../../core/v2/types/index.js";
1
+ import { Types as Types$1 } from "../../core/types/index.js";
2
2
  import { Types } from "./types/index.js";
3
3
 
4
4
  //#region src/Excel/v2/index.d.ts
5
5
  declare class Map {
6
6
  static from: {
7
- schedules: (source: Types.Source) => Types$1.division;
7
+ schedules: (source: Types.Source) => {
8
+ settings: {
9
+ discretization: number;
10
+ numDays: number;
11
+ dayStart: string;
12
+ dayEnd: string;
13
+ };
14
+ locations: (Types$1.serialized.location & {
15
+ id: string;
16
+ } & {
17
+ __raw: Types.Location;
18
+ })[];
19
+ teachers: (Types$1.serialized.teacher & {
20
+ id: string;
21
+ } & {
22
+ __raw: Types.Teacher;
23
+ })[];
24
+ persons: (Types$1.serialized.person & {
25
+ id: string;
26
+ } & {
27
+ __raw: Types.Person;
28
+ })[];
29
+ groups: (Types$1.serialized.group & {
30
+ id: string;
31
+ } & {
32
+ __raw: Types.Group;
33
+ })[];
34
+ courses: (Types$1.serialized.course & {
35
+ id: string;
36
+ } & {
37
+ __raw: Types.Course;
38
+ })[];
39
+ events: (Types$1.serialized.event & {
40
+ id: string;
41
+ } & {
42
+ __raw?: Types.Course;
43
+ })[];
44
+ overlapGroups: (Types$1.serialized.overlapGroup & {
45
+ id: string;
46
+ })[];
47
+ syllabuses: (Types$1.serialized.syllabus & {
48
+ id: string;
49
+ } & {
50
+ __raw?: Types.Syllabus;
51
+ })[];
52
+ meta: {
53
+ warnings?: {
54
+ code: Types.ErrorCode;
55
+ context?: unknown;
56
+ }[];
57
+ };
58
+ };
8
59
  };
9
60
  }
10
61
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_from"],"sources":["../../../src/Excel/v2/index.ts"],"sourcesContent":["import _from from './from';\n// import _to from './to';\nimport { Types } from './types';\n\nexport class Map {\n // static to = _to;\n static from = _from;\n}\n\nexport type { Types };"],"mappings":";;;AAIA,IAAa,MAAb,MAAiB;CAEf,OAAO,OAAOA"}
1
+ {"version":3,"file":"index.js","names":["_from"],"sources":["../../../src/Excel/v2/index.ts"],"sourcesContent":["import _from from './from';\n// import _to from './to';\nimport type { Types } from './types';\n\nexport class Map {\n // static to = _to;\n static from = _from;\n}\n\nexport { Types };"],"mappings":";;;AAIA,IAAa,MAAb,MAAiB;CAEf,OAAO,OAAOA"}
@@ -1,10 +1,11 @@
1
1
  //#region src/IdunSoft/from/courses.ts
2
2
  var courses_default = (courses) => {
3
3
  return courses.reduce((acc, course, index) => {
4
- if (!course["Ämne"]) throw new Error("A course does not have a unique key");
5
- if (acc.map((_course) => _course.ids).includes(course["Ämne"])) throw new Error(`A course ID exist multiple times. index ${index} and ${acc.map((_course) => _course.ids).indexOf(course["Ämne"])}`);
4
+ const ids = course["Ämne"];
5
+ if (!ids) throw new Error("A course does not have a unique key");
6
+ if (acc.map((x) => x.ids).includes(ids)) throw new Error(`A course ID "${ids}" exists multiple times at indices ${index} and ${acc.findIndex((x) => x.ids == ids)}`);
6
7
  return acc.concat({
7
- ids: course["Ämne"],
8
+ ids,
8
9
  subject: course["Betygskod"]
9
10
  });
10
11
  }, []);
@@ -1 +1 @@
1
- {"version":3,"file":"courses.js","names":[],"sources":["../../../src/IdunSoft/from/courses.ts"],"sourcesContent":["import { Course } from '../types/courses';\n\nimport { Types } from '../../core/types';\n\nexport default (courses: Course[]): Types.course[] => {\n return courses.reduce((acc: Types.course[], course: Course, index: number) => {\n if (!course['Ämne'])\n throw new Error('A course does not have a unique key');\n\n if (acc.map((_course: Types.course) => _course.ids).includes(course['Ämne']))\n throw new Error(`A course ID exist multiple times. index ${ index } and ${ acc.map((_course: Types.course) => _course.ids).indexOf(course['Ämne']) }`);\n\n return acc.concat({\n ids: course['Ämne'],\n subject: course['Betygskod']\n });\n }, []);\n};"],"mappings":";AAIA,uBAAgB,YAAsC;AACpD,QAAO,QAAQ,QAAQ,KAAqB,QAAgB,UAAkB;AAC5E,MAAI,CAAC,OAAO,QACV,OAAM,IAAI,MAAM;AAElB,MAAI,IAAI,KAAK,YAA0B,QAAQ,KAAK,SAAS,OAAO,SAClE,OAAM,IAAI,MAAM,2CAA4C,MAAO,OAAQ,IAAI,KAAK,YAA0B,QAAQ,KAAK,QAAQ,OAAO;AAE5I,SAAO,IAAI,OAAO;GAChB,KAAS,OAAO;GAChB,SAAS,OAAO;;IAEjB"}
1
+ {"version":3,"file":"courses.js","names":[],"sources":["../../../src/IdunSoft/from/courses.ts"],"sourcesContent":["import type { Types as IdunSoftTypes } from '../types';\nimport type { OutTypes } from './schedules';\n\nexport default (courses: IdunSoftTypes.course[]): OutTypes.course[] => {\n return courses\n .reduce<OutTypes.course[]>((acc, course, index) => {\n const ids = course['Ämne'];\n if (!ids)\n throw new Error('A course does not have a unique key');\n\n if (acc.map(x => x.ids).includes(ids))\n throw new Error(`A course ID \"${ids}\" exists multiple times at indices ${ index } and ${ acc.findIndex(x => x.ids == ids) }`);\n\n return acc.concat({\n ids: ids,\n subject: course['Betygskod']\n });\n }, []);\n};"],"mappings":";AAGA,uBAAgB,YAAuD;AACrE,QAAO,QACJ,QAA2B,KAAK,QAAQ,UAAU;EACjD,MAAM,MAAM,OAAO;AACnB,MAAI,CAAC,IACH,OAAM,IAAI,MAAM;AAElB,MAAI,IAAI,KAAI,MAAK,EAAE,KAAK,SAAS,KAC/B,OAAM,IAAI,MAAM,gBAAgB,IAAI,qCAAsC,MAAO,OAAQ,IAAI,WAAU,MAAK,EAAE,OAAO;AAEvH,SAAO,IAAI,OAAO;GACP;GACT,SAAS,OAAO;;IAEjB"}
@@ -1,45 +1,56 @@
1
- import { Constansts } from "../../common/constants.js";
1
+ import { getDayIndex } from "../../core/util.js";
2
+ import { Constants } from "../../common/constants.js";
2
3
 
3
4
  //#region src/IdunSoft/from/events.ts
4
5
  var events_default = (events) => {
5
- return (events || []).reduce((acc, event, index) => {
6
- if (!event["LektionID"]) throw new Error("An event does not have a unique key");
7
- if (acc.map((_event) => _event.ids).includes(event["LektionID"])) throw new Error(`An event ID exist multiple times. index ${index} and ${acc.map((_event) => _event.ids).indexOf(event["LektionID"])}`);
8
- if (!event["Lektionslängd"]) throw new Error(`An event [${event["LektionID"]}] does not have a duration`);
9
- let duration;
10
- try {
11
- duration = parseInt(event["Lektionslängd"].split("min")[0]);
12
- } catch (err) {
13
- throw new Error("duration have wrong structure");
14
- }
15
- const teachers = (event["LärareID"] ? [...new Set(event["LärareID"].split(","))] : []).map((to) => ({ to }));
16
- const groups = (event["GruppID"] ? [...new Set([event["GruppID"]])] : []).map((to) => ({ to }));
17
- const _locations = event["RumID"] ? [...new Set([event["RumID"]])] : [];
18
- const locations = _locations.map((room) => {
19
- return { locations: [room] };
20
- });
21
- const inLocations = _locations;
22
- let start, end;
6
+ return events.reduce((acc, event, index) => {
7
+ const ids = event["LektionID"];
8
+ if (!ids) throw new Error("An event does not have a unique key");
9
+ if (acc.some((x) => x.ids == ids)) throw new Error(`An event ID "${ids}" exists multiple times at indices ${index} and ${acc.findIndex((x) => x.ids == ids)}`);
10
+ if (!event["Lektionslängd"]) throw new Error(`An event [${ids}] does not have a duration`);
11
+ const duration = (() => {
12
+ try {
13
+ return parseInt(event["Lektionslängd"].split("min")[0]);
14
+ } catch {
15
+ throw new Error("duration have wrong structure");
16
+ }
17
+ })();
18
+ const teachers = event["LärareID"] ? [...new Set(event["LärareID"].split(","))].map((to) => ({ to })) : [];
19
+ const groups = event["GruppID"] ? [event["GruppID"]].map((to) => ({ to })) : [];
20
+ const inLocations = event["RumID"] ? [event["RumID"]] : [];
21
+ const locations = inLocations.map((x) => ({ locations: [x] }));
23
22
  const preferredDuration = parseInt(event.Lektionslängd);
24
- if (event.hasOwnProperty("Starttid")) {
25
- const day = event.VeckodagID != void 0 ? (event.VeckodagID + 6) % 7 : 0;
26
- const _start = event["Starttid"] || 0;
27
- start = Constansts.FIRST_DAY.clone().add(day, "days").add(Math.floor(_start * 24), "hours").add((_start * 24 - Math.floor(_start * 24)) * 60, "minutes");
28
- end = start.clone().add(duration, "minutes");
29
- }
30
- return acc.concat({
31
- ids: event["LektionID"],
23
+ const { start, end } = (() => {
24
+ if (event.Starttid == null || event.VeckodagID == null) return {
25
+ start: void 0,
26
+ end: void 0
27
+ };
28
+ const day = getDayIndex(event.VeckodagID);
29
+ const hours = Math.floor(event.Starttid * 24);
30
+ const minutes = (event.Starttid * 24 - hours) * 60;
31
+ const start$1 = Constants.FIRST_DAY.clone().add(day, "days").add(hours, "hours").add(minutes, "minutes");
32
+ const end$1 = start$1.clone().add(duration, "minutes");
33
+ return {
34
+ start: start$1,
35
+ end: end$1
36
+ };
37
+ })();
38
+ const doc = {
39
+ ids,
32
40
  course: event["Ämne"],
33
41
  preferredDuration,
34
- ...end && { end },
35
- ...start && { start },
36
- ...start && { parked: false },
37
42
  duration,
38
43
  teachers,
39
44
  groups,
40
45
  locations,
41
- inLocations
42
- });
46
+ inLocations,
47
+ ...start && end && {
48
+ start,
49
+ end,
50
+ parked: false
51
+ }
52
+ };
53
+ return acc.concat(doc);
43
54
  }, []);
44
55
  };
45
56
 
@@ -1 +1 @@
1
- {"version":3,"file":"events.js","names":["duration: number","day: number","_start: number"],"sources":["../../../src/IdunSoft/from/events.ts"],"sourcesContent":["import { FromEvent } from '../types/events';\n\nimport { Types } from '../../core/types';\n\nimport { Constansts } from '../../common/constants';\n\nexport default (events: FromEvent[]): Types.event[] => {\n return (events || []).reduce((acc: Types.event[], event: FromEvent, index: number) => {\n\n if (!event['LektionID'])\n throw new Error('An event does not have a unique key');\n\n if (acc.map((_event: Types.event) => _event.ids).includes(event['LektionID']))\n throw new Error(`An event ID exist multiple times. index ${ index } and ${ acc.map((_event: Types.event) => _event.ids).indexOf(event['LektionID']) }`);\n\n if (!event['Lektionslängd'])\n throw new Error(`An event [${ event['LektionID'] }] does not have a duration`);\n\n let duration: number;\n\n try {\n duration = parseInt(event['Lektionslängd'].split('min')[0]);\n } catch(err) {\n throw new Error('duration have wrong structure');\n }\n\n const teachers =( event['LärareID'] ? [...new Set((event['LärareID']).split(','))] : []).map(to => ({ to }));\n\n const groups = (event['GruppID'] ? [...new Set([event['GruppID']])] : []).map(to => ({ to }));\n\n const _locations = event['RumID'] ? [...new Set([event['RumID']])] : [];\n\n const locations = _locations.map((room: string) => { return { locations: [room] } });\n\n const inLocations = _locations;\n\n let start, end;\n\n // assumed to be of the format '40', is this true?\n const preferredDuration = parseInt(event.Lektionslängd);\n\n if (event.hasOwnProperty('Starttid')) {\n const day: number = event.VeckodagID != undefined ? (event.VeckodagID + 6) % 7 : 0;\n const _start: number = event['Starttid'] || 0;\n\n start = Constansts.FIRST_DAY.clone()\n .add(day, 'days')\n .add(Math.floor(_start * 24), 'hours')\n .add((_start * 24 - Math.floor(_start * 24)) * 60, 'minutes');\n end = start.clone().add(duration, 'minutes');\n }\n\n return acc.concat({\n ids: event['LektionID'],\n course: event['Ämne'],\n preferredDuration,\n ...end && { end },\n ...start && { start },\n ...start && { parked: false },\n ...{ duration },\n ...{ teachers },\n ...{ groups },\n ...{ locations },\n ...{ inLocations }\n });\n }, []);\n};"],"mappings":";;;AAMA,sBAAgB,WAAuC;AACrD,SAAQ,UAAU,IAAI,QAAQ,KAAoB,OAAkB,UAAkB;AAEpF,MAAI,CAAC,MAAM,aACT,OAAM,IAAI,MAAM;AAElB,MAAI,IAAI,KAAK,WAAwB,OAAO,KAAK,SAAS,MAAM,cAC9D,OAAM,IAAI,MAAM,2CAA4C,MAAO,OAAQ,IAAI,KAAK,WAAwB,OAAO,KAAK,QAAQ,MAAM;AAExI,MAAI,CAAC,MAAM,iBACT,OAAM,IAAI,MAAM,aAAc,MAAM,aAAc;EAEpD,IAAIA;AAEJ,MAAI;AACF,cAAW,SAAS,MAAM,iBAAiB,MAAM,OAAO;WAClD,KAAK;AACX,SAAM,IAAI,MAAM;;EAGlB,MAAM,YAAe,MAAM,cAAc,CAAC,GAAG,IAAI,IAAK,MAAM,YAAa,MAAM,SAAS,IAAI,KAAI,QAAO,EAAE;EAEzG,MAAM,UAAe,MAAM,aAAa,CAAC,GAAG,IAAI,IAAI,CAAC,MAAM,gBAAgB,IAAI,KAAI,QAAO,EAAE;EAE5F,MAAM,aAAc,MAAM,WAAW,CAAC,GAAG,IAAI,IAAI,CAAC,MAAM,cAAc;EAEtE,MAAM,YAAc,WAAW,KAAK,SAAiB;AAAE,UAAO,EAAE,WAAW,CAAC;;EAE5E,MAAM,cAAc;EAEpB,IAAI,OAAO;EAGX,MAAM,oBAAoB,SAAS,MAAM;AAEzC,MAAI,MAAM,eAAe,aAAa;GACpC,MAAMC,MAAiB,MAAM,cAAc,UAAa,MAAM,aAAa,KAAK,IAAI;GACpF,MAAMC,SAAiB,MAAM,eAAkB;AAE/C,WAAgB,WAAW,UAAU,QAClC,IAAI,KAAK,QACT,IAAI,KAAK,MAAM,SAAS,KAAK,SAC7B,KAAK,SAAS,KAAK,KAAK,MAAM,SAAS,OAAO,IAAI;AACrD,SAAgB,MAAM,QAAQ,IAAI,UAAU;;AAG9C,SAAO,IAAI,OAAO;GAChB,KAAQ,MAAM;GACd,QAAQ,MAAM;GACd;GACA,GAAG,OAAS,EAAE;GACd,GAAG,SAAS,EAAE;GACd,GAAG,SAAS,EAAE,QAAQ;GACjB;GACA;GACA;GACA;GACA;;IAEN"}
1
+ {"version":3,"file":"events.js","names":["start","end","doc: OutTypes.event"],"sources":["../../../src/IdunSoft/from/events.ts"],"sourcesContent":["import { getDayIndex } from '../../core/util';\nimport { Constants } from '../../common/constants';\nimport type { Types as IdunSoftTypes } from '../types';\nimport type { OutTypes } from './schedules';\n\nexport default (events: IdunSoftTypes.fromEvent[]): OutTypes.event[] => {\n return events\n .reduce<OutTypes.event[]>((acc, event, index) => {\n const ids = event['LektionID'];\n if (!ids)\n throw new Error('An event does not have a unique key');\n\n if (acc.some(x => x.ids == ids))\n throw new Error(`An event ID \"${ids}\" exists multiple times at indices ${ index } and ${ acc.findIndex(x => x.ids == ids) }`);\n\n if (!event['Lektionslängd'])\n throw new Error(`An event [${ ids }] does not have a duration`);\n\n const duration = (() => {\n try {\n return parseInt(event['Lektionslängd'].split('min')[0]);\n } catch {\n throw new Error('duration have wrong structure');\n }\n })();\n\n const teachers = event['LärareID'] ? [...new Set(event['LärareID'].split(','))].map(to => ({ to })) : [];\n const groups = event['GruppID' ] ? [event['GruppID'] ].map(to => ({ to })) : [];\n const inLocations = event['RumID' ] ? [event['RumID'] ] : [];\n const locations = inLocations.map(x => ({ locations: [x] as [string] }));\n\n const preferredDuration = parseInt(event.Lektionslängd); // ASSUMED TO BE OF THE FORMAT '40', IS THIS TRUE?\n\n const { start, end } = (() => {\n if (event.Starttid == null || event.VeckodagID == null) return { start: undefined, end: undefined };\n\n const day = getDayIndex(event.VeckodagID);\n const hours = Math.floor(event.Starttid * 24);\n const minutes = (event.Starttid * 24 - hours) * 60;\n\n const start = Constants.FIRST_DAY\n .clone()\n .add(day, 'days')\n .add(hours, 'hours')\n .add(minutes, 'minutes');\n const end = start\n .clone()\n .add(duration, 'minutes');\n\n return { start, end };\n })();\n\n const doc: OutTypes.event = {\n ids: ids,\n course: event['Ämne'],\n preferredDuration,\n duration,\n teachers,\n groups,\n locations,\n inLocations,\n ...start && end && { start, end, parked: false }\n };\n return acc.concat(doc);\n }, []);\n};"],"mappings":";;;;AAKA,sBAAgB,WAAwD;AACtE,QAAO,OACJ,QAA0B,KAAK,OAAO,UAAU;EAC/C,MAAM,MAAM,MAAM;AAClB,MAAI,CAAC,IACH,OAAM,IAAI,MAAM;AAElB,MAAI,IAAI,MAAK,MAAK,EAAE,OAAO,KACzB,OAAM,IAAI,MAAM,gBAAgB,IAAI,qCAAsC,MAAO,OAAQ,IAAI,WAAU,MAAK,EAAE,OAAO;AAEvH,MAAI,CAAC,MAAM,iBACT,OAAM,IAAI,MAAM,aAAc,IAAK;EAErC,MAAM,kBAAkB;AACtB,OAAI;AACF,WAAO,SAAS,MAAM,iBAAiB,MAAM,OAAO;WAC9C;AACN,UAAM,IAAI,MAAM;;;EAIpB,MAAM,WAAc,MAAM,cAAc,CAAC,GAAG,IAAI,IAAI,MAAM,YAAY,MAAM,OAAO,KAAI,QAAO,EAAE,SAAS;EACzG,MAAM,SAAc,MAAM,aAAc,CAAC,MAAM,YAAoC,KAAI,QAAO,EAAE,SAAS;EACzG,MAAM,cAAc,MAAM,WAAc,CAAC,MAAM,YAA0D;EACzG,MAAM,YAAc,YAAY,KAAI,OAAM,EAAE,WAAW,CAAC;EAExD,MAAM,oBAAoB,SAAS,MAAM;EAEzC,MAAM,EAAE,OAAO,eAAe;AAC5B,OAAI,MAAM,YAAY,QAAQ,MAAM,cAAc,KAAM,QAAO;IAAE,OAAO;IAAW,KAAK;;GAExF,MAAM,MAAU,YAAY,MAAM;GAClC,MAAM,QAAU,KAAK,MAAM,MAAM,WAAW;GAC5C,MAAM,WAAW,MAAM,WAAW,KAAK,SAAS;GAEhD,MAAMA,UAAQ,UAAU,UACrB,QACA,IAAI,KAAK,QACT,IAAI,OAAO,SACX,IAAI,SAAS;GAChB,MAAMC,QAAMD,QACT,QACA,IAAI,UAAU;AAEjB,UAAO;IAAE;IAAO;;;EAGlB,MAAME,MAAsB;GAClB;GACR,QAAQ,MAAM;GACd;GACA;GACA;GACA;GACA;GACA;GACA,GAAG,SAAS,OAAO;IAAE;IAAO;IAAK,QAAQ;;;AAE3C,SAAO,IAAI,OAAO;IACjB"}
@@ -1,10 +1,11 @@
1
1
  //#region src/IdunSoft/from/groups.ts
2
2
  var groups_default = (groups) => {
3
- return (groups || []).reduce((acc, group, index) => {
4
- if (!group["ID"]) throw new Error("A group does not have a unique key");
5
- if (acc.map((_group) => _group.ids).includes(group["ID"])) throw new Error(`A group ID exist multiple times. index ${index} and ${acc.map((_group) => _group.ids).indexOf(group["ID"])}`);
3
+ return groups.reduce((acc, group, index) => {
4
+ const ids = group["ID"];
5
+ if (!ids) throw new Error("A group does not have a unique key");
6
+ if (acc.some((x) => x.ids == ids)) throw new Error(`A group ID "${ids}" exist multiple times at indices ${index} and ${acc.findIndex((x) => x.ids == ids)}`);
6
7
  return acc.concat({
7
- ids: group["ID"],
8
+ ids,
8
9
  displayName: group["Klassnamn"],
9
10
  species: "class"
10
11
  });
@@ -1 +1 @@
1
- {"version":3,"file":"groups.js","names":[],"sources":["../../../src/IdunSoft/from/groups.ts"],"sourcesContent":["import { Group } from '../types/groups';\n\nimport { Types } from '../../core/types';\n\nexport default (groups: Group[]): Types.group[] => {\n return (groups || []).reduce((acc: Types.group[], group: Group, index: number) => {\n if (!group['ID'])\n throw new Error('A group does not have a unique key');\n\n if (acc.map((_group: Types.group) => _group.ids).includes(group['ID']))\n throw new Error(`A group ID exist multiple times. index ${ index } and ${ acc.map((_group: Types.group) => _group.ids).indexOf(group['ID']) }`);\n\n return acc.concat({\n ids: group['ID'],\n displayName: group['Klassnamn'],\n species: 'class',\n });\n }, []);\n};"],"mappings":";AAIA,sBAAgB,WAAmC;AACjD,SAAQ,UAAU,IAAI,QAAQ,KAAoB,OAAc,UAAkB;AAChF,MAAI,CAAC,MAAM,MACT,OAAM,IAAI,MAAM;AAElB,MAAI,IAAI,KAAK,WAAwB,OAAO,KAAK,SAAS,MAAM,OAC9D,OAAM,IAAI,MAAM,0CAA2C,MAAO,OAAQ,IAAI,KAAK,WAAwB,OAAO,KAAK,QAAQ,MAAM;AAEvI,SAAO,IAAI,OAAO;GAChB,KAAa,MAAM;GACnB,aAAa,MAAM;GACnB,SAAa;;IAEd"}
1
+ {"version":3,"file":"groups.js","names":[],"sources":["../../../src/IdunSoft/from/groups.ts"],"sourcesContent":["import type { Types as IdunSoftTypes } from '../types';\nimport type { OutTypes } from './schedules';\n\nexport default (groups: IdunSoftTypes.group[]): OutTypes.group[] => {\n return groups\n .reduce<OutTypes.group[]>((acc, group, index) => {\n const ids = group['ID'];\n if (!ids)\n throw new Error('A group does not have a unique key');\n\n if (acc.some(x => x.ids == ids))\n throw new Error(`A group ID \"${ids}\" exist multiple times at indices ${ index } and ${ acc.findIndex(x => x.ids == ids) }`);\n\n return acc.concat({\n ids: ids,\n displayName: group['Klassnamn'],\n species: 'class',\n });\n }, []);\n};"],"mappings":";AAGA,sBAAgB,WAAoD;AAClE,QAAO,OACJ,QAA0B,KAAK,OAAO,UAAU;EAC/C,MAAM,MAAM,MAAM;AAClB,MAAI,CAAC,IACH,OAAM,IAAI,MAAM;AAElB,MAAI,IAAI,MAAK,MAAK,EAAE,OAAO,KACzB,OAAM,IAAI,MAAM,eAAe,IAAI,oCAAqC,MAAO,OAAQ,IAAI,WAAU,MAAK,EAAE,OAAO;AAErH,SAAO,IAAI,OAAO;GACH;GACb,aAAa,MAAM;GACnB,SAAa;;IAEd"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_schedules"],"sources":["../../../src/IdunSoft/from/index.ts"],"sourcesContent":["import { FromInterface } from '../../core/types';\nimport _schedules from './schedules';\n\nexport default {\n schedules: _schedules\n} satisfies FromInterface;"],"mappings":";;;AAGA,mBAAe,EACb,WAAWA"}
1
+ {"version":3,"file":"index.js","names":["_schedules"],"sources":["../../../src/IdunSoft/from/index.ts"],"sourcesContent":["import type { FromInterface } from '../../common/types';\nimport _schedules from './schedules';\n\nexport default {\n schedules: _schedules\n} satisfies FromInterface;"],"mappings":";;;AAGA,mBAAe,EACb,WAAWA"}
@@ -1,10 +1,11 @@
1
1
  //#region src/IdunSoft/from/locations.ts
2
2
  var locations_default = (locations) => {
3
3
  return locations.reduce((acc, location, index) => {
4
- if (!location["ID"]) throw new Error("A location does not have a unique key");
5
- if (acc.map((_location) => _location.ids).includes(location["ID"])) throw new Error(`A location ID exist multiple times. index ${index} and ${acc.map((_location) => _location.ids).indexOf(location["ID"])}`);
4
+ const ids = location["ID"];
5
+ if (!ids) throw new Error("A location does not have a unique key");
6
+ if (acc.some((x) => x.ids == ids)) throw new Error(`A location ID "${ids}" exists multiple times at indices ${index} and ${acc.findIndex((x) => x.ids == ids)}`);
6
7
  return acc.concat({
7
- ids: location["ID"],
8
+ ids,
8
9
  displayName: location["Namn"]
9
10
  });
10
11
  }, []);
@@ -1 +1 @@
1
- {"version":3,"file":"locations.js","names":[],"sources":["../../../src/IdunSoft/from/locations.ts"],"sourcesContent":["import { Location } from '../types/locations';\n\nimport { Types } from '../../core/types';\n\nexport default (locations: Location[]): Types.location[] => {\n return locations.reduce((acc: Types.location[], location: Location, index: number) => {\n\n if (!location['ID'])\n throw new Error('A location does not have a unique key');\n\n if (acc.map((_location: Types.location) => _location.ids).includes(location['ID']))\n throw new Error(`A location ID exist multiple times. index ${ index } and ${ acc.map((_location: Types.location) => _location.ids).indexOf(location['ID']) }`);\n\n return acc.concat({\n ids: location['ID'],\n displayName: location['Namn']\n });\n }, []);\n};"],"mappings":";AAIA,yBAAgB,cAA4C;AAC1D,QAAO,UAAU,QAAQ,KAAuB,UAAoB,UAAkB;AAEpF,MAAI,CAAC,SAAS,MACZ,OAAM,IAAI,MAAM;AAElB,MAAI,IAAI,KAAK,cAA8B,UAAU,KAAK,SAAS,SAAS,OAC1E,OAAM,IAAI,MAAM,6CAA8C,MAAO,OAAQ,IAAI,KAAK,cAA8B,UAAU,KAAK,QAAQ,SAAS;AAEtJ,SAAO,IAAI,OAAO;GAChB,KAAa,SAAS;GACtB,aAAa,SAAS;;IAEvB"}
1
+ {"version":3,"file":"locations.js","names":[],"sources":["../../../src/IdunSoft/from/locations.ts"],"sourcesContent":["import type { Types as IdunSoftTypes } from '../types';\nimport type { OutTypes } from './schedules';\n\nexport default (locations: IdunSoftTypes.location[]): OutTypes.location[] => {\n return locations\n .reduce<OutTypes.location[]>((acc, location, index) => {\n const ids = location['ID'];\n if (!ids)\n throw new Error('A location does not have a unique key');\n\n if (acc.some(x => x.ids == ids))\n throw new Error(`A location ID \"${ids}\" exists multiple times at indices ${ index } and ${ acc.findIndex(x => x.ids == ids) }`);\n\n return acc.concat({\n ids: ids,\n displayName: location['Namn']\n });\n }, []);\n};"],"mappings":";AAGA,yBAAgB,cAA6D;AAC3E,QAAO,UACJ,QAA6B,KAAK,UAAU,UAAU;EACrD,MAAM,MAAM,SAAS;AACrB,MAAI,CAAC,IACH,OAAM,IAAI,MAAM;AAElB,MAAI,IAAI,MAAK,MAAK,EAAE,OAAO,KACzB,OAAM,IAAI,MAAM,kBAAkB,IAAI,qCAAsC,MAAO,OAAQ,IAAI,WAAU,MAAK,EAAE,OAAO;AAEzH,SAAO,IAAI,OAAO;GACH;GACb,aAAa,SAAS;;IAEvB"}
@@ -1,8 +1,23 @@
1
- import { Types as Types$1 } from "../../core/v2/types/index.js";
2
- import { Types } from "../types/index.js";
1
+ import { InternalIdKey } from "../../core/types/common/index.js";
2
+ import { Types } from "../../core/types/index.js";
3
+ import { Types as Types$1 } from "../types/index.js";
3
4
 
4
5
  //#region src/IdunSoft/from/schedules.d.ts
5
- declare function export_default(schedule: Types.schedule): Types$1.division;
6
+ declare namespace OutTypes {
7
+ type group = Omit<Types.serialized.group, InternalIdKey>;
8
+ type teacher = Omit<Types.serialized.teacher, InternalIdKey>;
9
+ type location = Omit<Types.serialized.location, InternalIdKey>;
10
+ type course = Omit<Types.serialized.course, InternalIdKey>;
11
+ type event = Omit<Types.serialized.event, InternalIdKey>;
12
+ }
13
+ type Out = {
14
+ groups: OutTypes.group[];
15
+ teachers: OutTypes.teacher[];
16
+ locations: OutTypes.location[];
17
+ courses: OutTypes.course[];
18
+ events: OutTypes.event[];
19
+ };
20
+ declare function export_default(schedule: Partial<Types$1.schedule>): Out;
6
21
  //#endregion
7
22
  export { export_default };
8
23
  //# sourceMappingURL=schedules.d.ts.map
@@ -6,17 +6,12 @@ import events_default from "./events.js";
6
6
 
7
7
  //#region src/IdunSoft/from/schedules.ts
8
8
  function schedules_default(schedule) {
9
- const groups = groups_default(schedule["Grupp"]);
10
- const teachers = teachers_default(schedule["Lärare"]);
11
- const locations = locations_default(schedule["Rum"]);
12
- const courses = courses_default(schedule["Ämne"]);
13
- const events = events_default(schedule["Lektion"]);
14
9
  return {
15
- groups,
16
- teachers,
17
- locations,
18
- courses,
19
- events
10
+ groups: groups_default(schedule["Grupp"] ?? []),
11
+ teachers: teachers_default(schedule["Lärare"] ?? []),
12
+ locations: locations_default(schedule["Rum"] ?? []),
13
+ courses: courses_default(schedule["Ämne"] ?? []),
14
+ events: events_default(schedule["Lektion"] ?? [])
20
15
  };
21
16
  }
22
17
 
@@ -1 +1 @@
1
- {"version":3,"file":"schedules.js","names":["groups: CoreTypes.group[]","_groups","teachers: CoreTypes.teacher[]","_teachers","locations: CoreTypes.location[]","_locations","courses: CoreTypes.course[]","_courses","events: CoreTypes.event[]","_events"],"sources":["../../../src/IdunSoft/from/schedules.ts"],"sourcesContent":["\nimport _groups from './groups';\nimport _teachers from './teachers';\nimport _locations from './locations';\nimport _courses from './courses';\nimport _events from './events';\n\nimport { Types as IdunSoftTypes } from '../types';\n\nimport { Types as CoreTypes } from '../../core/types';\n\nexport default function (schedule: IdunSoftTypes.schedule): CoreTypes.division {\n\n const groups: CoreTypes.group[] = _groups(schedule['Grupp']);\n const teachers: CoreTypes.teacher[] = _teachers(schedule['Lärare']);\n const locations: CoreTypes.location[] = _locations(schedule['Rum']);\n const courses: CoreTypes.course[] = _courses(schedule['Ämne']);\n const events: CoreTypes.event[] = _events(schedule['Lektion']);\n\n return { groups, teachers, locations, courses, events };\n}"],"mappings":";;;;;;;AAWA,2BAAyB,UAAsD;CAE7E,MAAMA,SAAqCC,eAAQ,SAAS;CAC5D,MAAMC,WAAqCC,iBAAU,SAAS;CAC9D,MAAMC,YAAqCC,kBAAW,SAAS;CAC/D,MAAMC,UAAqCC,gBAAS,SAAS;CAC7D,MAAMC,SAAqCC,eAAQ,SAAS;AAE5D,QAAO;EAAE;EAAQ;EAAU;EAAW;EAAS"}
1
+ {"version":3,"file":"schedules.js","names":["_groups","_teachers","_locations","_courses","_events"],"sources":["../../../src/IdunSoft/from/schedules.ts"],"sourcesContent":["\nimport type { CoreTypes } from '../../core';\nimport type { Types as IdunSoftTypes } from '../types';\nimport _groups from './groups';\nimport _teachers from './teachers';\nimport _locations from './locations';\nimport _courses from './courses';\nimport _events from './events';\nimport type { InternalIdKey } from '../../core/types/common';\n\nexport namespace OutTypes {\n export type group = Omit<CoreTypes.serialized.group, InternalIdKey>;\n export type teacher = Omit<CoreTypes.serialized.teacher, InternalIdKey>;\n export type location = Omit<CoreTypes.serialized.location, InternalIdKey>;\n export type course = Omit<CoreTypes.serialized.course, InternalIdKey>;\n export type event = Omit<CoreTypes.serialized.event, InternalIdKey>;\n};\n\ntype Out = {\n groups: OutTypes.group[];\n teachers: OutTypes.teacher[];\n locations: OutTypes.location[];\n courses: OutTypes.course[];\n events: OutTypes.event[];\n};\n\nexport default function (schedule: Partial<IdunSoftTypes.schedule>): Out {\n return {\n groups: _groups (schedule['Grupp' ] ?? []),\n teachers: _teachers (schedule['Lärare' ] ?? []),\n locations: _locations(schedule['Rum' ] ?? []),\n courses: _courses (schedule['Ämne' ] ?? []),\n events: _events (schedule['Lektion'] ?? []),\n };\n}"],"mappings":";;;;;;;AA0BA,2BAAyB,UAAgD;AACvE,QAAO;EACL,QAAWA,eAAW,SAAS,YAAc;EAC7C,UAAWC,iBAAW,SAAS,aAAc;EAC7C,WAAWC,kBAAW,SAAS,UAAc;EAC7C,SAAWC,gBAAW,SAAS,WAAc;EAC7C,QAAWC,eAAW,SAAS,cAAc"}
@@ -1,10 +1,11 @@
1
1
  //#region src/IdunSoft/from/teachers.ts
2
2
  var teachers_default = (teachers) => {
3
3
  return teachers.reduce((acc, teacher, index) => {
4
- if (!teacher["ID"]) throw new Error("A teacher does not have a unique key");
5
- if (acc.map((_teacher) => _teacher.ids).includes(teacher["ID"])) throw new Error(`A teacher ID exist multiple times. index ${index} and ${acc.map((_teacher) => _teacher.ids).indexOf(teacher["ID"])}`);
4
+ const ids = teacher["ID"];
5
+ if (!ids) throw new Error("A teacher does not have a unique key");
6
+ if (acc.some((x) => x.ids == ids)) throw new Error(`A teacher ID "${ids}" exists multiple times at indices ${index} and ${acc.findIndex((x) => x.ids == ids)}`);
6
7
  return acc.concat({
7
- ids: teacher["ID"],
8
+ ids,
8
9
  displayName: teacher["Namn"]
9
10
  });
10
11
  }, []);
@@ -1 +1 @@
1
- {"version":3,"file":"teachers.js","names":[],"sources":["../../../src/IdunSoft/from/teachers.ts"],"sourcesContent":["import { Teacher } from '../types/teachers';\n\nimport { Types } from '../../core/types';\n\nexport default (teachers: Teacher[]): Types.teacher[] => {\n return teachers.reduce((acc: Types.teacher[], teacher: Teacher, index: number) => {\n\n if (!teacher['ID'])\n throw new Error('A teacher does not have a unique key');\n\n if (acc.map((_teacher: Types.teacher) => _teacher.ids).includes(teacher['ID']))\n throw new Error(`A teacher ID exist multiple times. index ${ index } and ${ acc.map((_teacher: Types.teacher) => _teacher.ids).indexOf(teacher['ID']) }`);\n\n return acc.concat({\n ids: teacher['ID'],\n displayName: teacher['Namn']\n });\n }, []);\n};"],"mappings":";AAIA,wBAAgB,aAAyC;AACvD,QAAO,SAAS,QAAQ,KAAsB,SAAkB,UAAkB;AAEhF,MAAI,CAAC,QAAQ,MACX,OAAM,IAAI,MAAM;AAElB,MAAI,IAAI,KAAK,aAA4B,SAAS,KAAK,SAAS,QAAQ,OACtE,OAAM,IAAI,MAAM,4CAA6C,MAAO,OAAQ,IAAI,KAAK,aAA4B,SAAS,KAAK,QAAQ,QAAQ;AAEjJ,SAAO,IAAI,OAAO;GAChB,KAAa,QAAQ;GACrB,aAAa,QAAQ;;IAEtB"}
1
+ {"version":3,"file":"teachers.js","names":[],"sources":["../../../src/IdunSoft/from/teachers.ts"],"sourcesContent":["import type { Types as IdunSoftTypes } from '../types';\nimport type { OutTypes } from './schedules';\n\nexport default (teachers: IdunSoftTypes.teacher[]): OutTypes.teacher[] => {\n return teachers\n .reduce<OutTypes.teacher[]>((acc, teacher, index) => {\n const ids = teacher['ID'];\n if (!ids)\n throw new Error('A teacher does not have a unique key');\n\n if (acc.some(x => x.ids == ids))\n throw new Error(`A teacher ID \"${ids}\" exists multiple times at indices ${ index } and ${ acc.findIndex(x => x.ids == ids) }`);\n\n return acc.concat({\n ids: ids,\n displayName: teacher['Namn']\n });\n }, []);\n};"],"mappings":";AAGA,wBAAgB,aAA0D;AACxE,QAAO,SACJ,QAA4B,KAAK,SAAS,UAAU;EACnD,MAAM,MAAM,QAAQ;AACpB,MAAI,CAAC,IACH,OAAM,IAAI,MAAM;AAElB,MAAI,IAAI,MAAK,MAAK,EAAE,OAAO,KACzB,OAAM,IAAI,MAAM,iBAAiB,IAAI,qCAAsC,MAAO,OAAQ,IAAI,WAAU,MAAK,EAAE,OAAO;AAExH,SAAO,IAAI,OAAO;GACH;GACb,aAAa,QAAQ;;IAEtB"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_to","_from"],"sources":["../../src/IdunSoft/index.ts"],"sourcesContent":["import _from from './from';\nimport _to from './to';\nimport { Types } from './types';\n\nexport class IdunSoftMap {\n static to = _to;\n static from = _from;\n}\n\nexport type { Types as IdunSoftTypes };"],"mappings":";;;;AAIA,IAAa,cAAb,MAAyB;CACvB,OAAO,KAAOA;CACd,OAAO,OAAOC"}
1
+ {"version":3,"file":"index.js","names":["_to","_from"],"sources":["../../src/IdunSoft/index.ts"],"sourcesContent":["import _from from './from';\nimport _to from './to';\nimport type { Types } from './types';\n\nexport class IdunSoftMap {\n static to = _to;\n static from = _from;\n}\n\nexport { Types as IdunSoftTypes };"],"mappings":";;;;AAIA,IAAa,cAAb,MAAyB;CACvB,OAAO,KAAOA;CACd,OAAO,OAAOC"}
@@ -1,9 +1,8 @@
1
- import { Types } from "../../core/v2/types/index.js";
2
- import { Deserialized } from "../../core/types/index.js";
1
+ import { Types } from "../../core/types/index.js";
3
2
 
4
3
  //#region src/IdunSoft/to/index.d.ts
5
4
  declare class export_default {
6
- static schedules: (courseEvents: Deserialized<Types.event>[]) => string;
5
+ static schedules: (courseEvents: Types.mixed.event[]) => string;
7
6
  }
8
7
  //#endregion
9
8
  export { export_default };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_schedules"],"sources":["../../../src/IdunSoft/to/index.ts"],"sourcesContent":["import _schedules from './schedules';\n\nexport default class {\n static schedules = _schedules;\n}"],"mappings":";;;AAEA,uBAAqB;CACnB,OAAO,YAAsBA"}
1
+ {"version":3,"file":"index.js","names":["_schedules"],"sources":["../../../src/IdunSoft/to/index.ts"],"sourcesContent":["import _schedules from './schedules';\n\nexport default class {\n static schedules = _schedules;\n}"],"mappings":";;;AAEA,uBAAqB;CACnB,OAAO,YAAYA"}