@royalschedule/maps 4.0.33 → 4.1.1-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Additio/from/courses.js.map +1 -1
- package/dist/Additio/from/events.js.map +1 -1
- package/dist/Additio/from/groups.js.map +1 -1
- package/dist/Additio/from/index.js.map +1 -1
- package/dist/Additio/from/locations.js.map +1 -1
- package/dist/Additio/from/persons.js.map +1 -1
- package/dist/Additio/from/schedules.d.ts +0 -1
- package/dist/Additio/from/schedules.js +4 -2
- package/dist/Additio/from/schedules.js.map +1 -1
- package/dist/Additio/from/teachers.js.map +1 -1
- package/dist/Additio/to/index.d.ts +2 -4
- package/dist/Additio/to/schedules.js +4 -2
- package/dist/Additio/to/schedules.js.map +1 -1
- package/dist/Admentum/from/courses.js.map +1 -1
- package/dist/Admentum/from/events.js.map +1 -1
- package/dist/Admentum/from/groups.js.map +1 -1
- package/dist/Admentum/from/index.js.map +1 -1
- package/dist/Admentum/from/locations.js.map +1 -1
- package/dist/Admentum/from/persons.js.map +1 -1
- package/dist/Admentum/from/schedules.d.ts +0 -1
- package/dist/Admentum/from/schedules.js +6 -3
- package/dist/Admentum/from/schedules.js.map +1 -1
- package/dist/Admentum/from/teachers.js.map +1 -1
- package/dist/Admentum/to/index.d.ts +0 -1
- package/dist/Admentum/to/schedules.js +7 -4
- package/dist/Admentum/to/schedules.js.map +1 -1
- package/dist/Excel/index.d.ts +1 -1
- package/dist/Excel/v1/from/index.js +1 -1
- package/dist/Excel/v1/from/index.js.map +1 -1
- package/dist/Excel/v1/index.d.ts +4 -4
- package/dist/Excel/v2/from/index.js +54 -45
- package/dist/Excel/v2/from/index.js.map +1 -1
- package/dist/Excel/v2/index.d.ts +4 -4
- package/dist/IdunSoft/from/courses.js.map +1 -1
- package/dist/IdunSoft/from/events.js +2 -1
- package/dist/IdunSoft/from/events.js.map +1 -1
- package/dist/IdunSoft/from/groups.js.map +1 -1
- package/dist/IdunSoft/from/index.js.map +1 -1
- package/dist/IdunSoft/from/locations.js.map +1 -1
- package/dist/IdunSoft/from/schedules.d.ts +0 -1
- package/dist/IdunSoft/from/schedules.js.map +1 -1
- package/dist/IdunSoft/from/teachers.js.map +1 -1
- package/dist/IdunSoft/to/index.d.ts +0 -1
- package/dist/IdunSoft/to/schedules.js +7 -4
- package/dist/IdunSoft/to/schedules.js.map +1 -1
- package/dist/InfoMentor/to/index.d.ts +0 -1
- package/dist/InfoMentor/to/schedules.js +3 -2
- package/dist/InfoMentor/to/schedules.js.map +1 -1
- package/dist/PlanDigital/from/index.js.map +1 -1
- package/dist/PlanDigital/from/schedules.js +11 -9
- package/dist/PlanDigital/from/schedules.js.map +1 -1
- package/dist/PlanDigital/index.d.ts +0 -1
- package/dist/Quiculum/file/to/index.d.ts +0 -1
- package/dist/Quiculum/file/to/schedules.js +9 -5
- package/dist/Quiculum/file/to/schedules.js.map +1 -1
- package/dist/RS/from/division.d.ts +0 -1
- package/dist/RS/from/division.js +2 -1
- package/dist/RS/from/division.js.map +1 -1
- package/dist/RS/from/index.js.map +1 -1
- package/dist/RS/from/schedules.d.ts +0 -1
- package/dist/RS/from/schedules.js.map +1 -1
- package/dist/RS/make-connected.d.ts +2 -4
- package/dist/RS/make-connected.js +46 -54
- package/dist/RS/make-connected.js.map +1 -1
- package/dist/RS/to/index.js.map +1 -1
- package/dist/RS/to/initial-configuration.js +7 -5
- package/dist/RS/to/initial-configuration.js.map +1 -1
- package/dist/RS/to/input/default.js +16 -21
- package/dist/RS/to/input/default.js.map +1 -1
- package/dist/RS/to/input/dependencies.js +12 -10
- package/dist/RS/to/input/dependencies.js.map +1 -1
- package/dist/RS/to/input/events.js +53 -41
- package/dist/RS/to/input/events.js.map +1 -1
- package/dist/RS/to/input/groups.js +7 -15
- package/dist/RS/to/input/groups.js.map +1 -1
- package/dist/RS/to/input/individuals.js +4 -6
- package/dist/RS/to/input/individuals.js.map +1 -1
- package/dist/RS/to/input/input.js +21 -13
- package/dist/RS/to/input/input.js.map +1 -1
- package/dist/RS/to/input/intervals.js +10 -8
- package/dist/RS/to/input/intervals.js.map +1 -1
- package/dist/RS/to/input/linked-events-sets.js +96 -0
- package/dist/RS/to/input/linked-events-sets.js.map +1 -0
- package/dist/RS/to/input/locked-times.js +91 -0
- package/dist/RS/to/input/locked-times.js.map +1 -0
- package/dist/RS/to/input/periods.js +5 -36
- package/dist/RS/to/input/periods.js.map +1 -1
- package/dist/RS/to/input/settings.js +1 -8
- package/dist/RS/to/input/settings.js.map +1 -1
- package/dist/RS/to/input/teachers.js +8 -16
- package/dist/RS/to/input/teachers.js.map +1 -1
- package/dist/RS/to/input/util/parse-days.js +2 -2
- package/dist/RS/to/input/util/parse-days.js.map +1 -1
- package/dist/RS/to/input/util/parse-group-references.js +2 -10
- package/dist/RS/to/input/util/parse-group-references.js.map +1 -1
- package/dist/RS/to/input/util/parse-location-references.js +1 -7
- package/dist/RS/to/input/util/parse-location-references.js.map +1 -1
- package/dist/RS/to/input/util/parse-max-working-hours.js +4 -7
- package/dist/RS/to/input/util/parse-max-working-hours.js.map +1 -1
- package/dist/RS/to/input/util/parse-minimum-break-length.js +2 -2
- package/dist/RS/to/input/util/parse-minimum-break-length.js.map +1 -1
- package/dist/RS/to/input/util/util.js +5 -11
- package/dist/RS/to/input/util/util.js.map +1 -1
- package/dist/RS/to/schedules.js.map +1 -1
- package/dist/RS/types/algorithm-parameters.d.ts +1 -2
- package/dist/RS/types/index.d.ts +2 -31
- package/dist/RS/types/schedule-data.d.ts +12 -15
- package/dist/RS/types/to.d.ts +10 -18
- package/dist/RS/types/to.js +1 -1
- package/dist/RS/types/to.js.map +1 -1
- package/dist/SS12000/from/activities.js +2 -1
- package/dist/SS12000/from/activities.js.map +1 -1
- package/dist/SS12000/from/calendar-events.js.map +1 -1
- package/dist/SS12000/from/duties.js.map +1 -1
- package/dist/SS12000/from/groups.js.map +1 -1
- package/dist/SS12000/from/index.js.map +1 -1
- package/dist/SS12000/from/persons.js.map +1 -1
- package/dist/SS12000/from/resources.js.map +1 -1
- package/dist/SS12000/from/rooms.js.map +1 -1
- package/dist/SS12000/from/syllabuses.js.map +1 -1
- package/dist/SS12000/index.d.ts +9 -12782
- package/dist/SS12000/to/activities.js.map +1 -1
- package/dist/SS12000/to/calendar-events.js.map +1 -1
- package/dist/SS12000/to/common.js.map +1 -1
- package/dist/SS12000/to/duties.js.map +1 -1
- package/dist/SS12000/to/groups.js.map +1 -1
- package/dist/SS12000/to/index.d.ts +0 -1
- package/dist/SS12000/to/persons.js.map +1 -1
- package/dist/SS12000/to/resources.js.map +1 -1
- package/dist/SS12000/to/rooms.js.map +1 -1
- package/dist/SS12000/to/syllabuses.js.map +1 -1
- package/dist/SchoolSoft/api/from/index.js.map +1 -1
- package/dist/SchoolSoft/api/from/schedules.js +12 -8
- package/dist/SchoolSoft/api/from/schedules.js.map +1 -1
- package/dist/SchoolSoft/api/index.d.ts +7 -6
- package/dist/SchoolSoft/file/from/index.js.map +1 -1
- package/dist/SchoolSoft/file/from/schedules.js +87 -83
- package/dist/SchoolSoft/file/from/schedules.js.map +1 -1
- package/dist/SchoolSoft/file/index.d.ts +0 -1
- package/dist/SchoolSoft/file/to/index.d.ts +2 -3
- package/dist/SchoolSoft/file/to/schedules.js +2 -1
- package/dist/SchoolSoft/file/to/schedules.js.map +1 -1
- package/dist/SchoolSoft/index.d.ts +0 -1
- package/dist/Schoolity/txt/to/index.d.ts +0 -1
- package/dist/Schoolity/txt/to/schedules.js +14 -7
- package/dist/Schoolity/txt/to/schedules.js.map +1 -1
- package/dist/Skola24/mdb/from/course-and-events.js +5 -3
- package/dist/Skola24/mdb/from/course-and-events.js.map +1 -1
- package/dist/Skola24/mdb/from/groups.js.map +1 -1
- package/dist/Skola24/mdb/from/index.js.map +1 -1
- package/dist/Skola24/mdb/from/locations.js.map +1 -1
- package/dist/Skola24/mdb/from/schedule.d.ts +0 -1
- package/dist/Skola24/mdb/from/schedule.js.map +1 -1
- package/dist/Skola24/mdb/from/teachers.js.map +1 -1
- package/dist/Skola24/txt/from/calendar-exceptions.js +2 -1
- package/dist/Skola24/txt/from/calendar-exceptions.js.map +1 -1
- package/dist/Skola24/txt/from/division.js.map +1 -1
- package/dist/Skola24/txt/from/index.js.map +1 -1
- package/dist/Skola24/txt/from/period.js +34 -31
- package/dist/Skola24/txt/from/period.js.map +1 -1
- package/dist/Skola24/txt/from/schedules.d.ts +0 -1
- package/dist/Skola24/txt/from/schedules.js +10 -6
- package/dist/Skola24/txt/from/schedules.js.map +1 -1
- package/dist/Skola24/txt/from/util.js.map +1 -1
- package/dist/Skola24/txt/index.d.ts +0 -1
- package/dist/Skola24/txt/to/index.d.ts +0 -1
- package/dist/Skola24/txt/to/schedules.js +15 -8
- package/dist/Skola24/txt/to/schedules.js.map +1 -1
- package/dist/common/constants.js.map +1 -1
- package/dist/common/functions.js +2 -2
- package/dist/common/functions.js.map +1 -1
- package/dist/common/get-date.js.map +1 -1
- package/dist/common/make-chainable/index.js.map +1 -1
- package/dist/common/types.d.ts +28 -2
- package/dist/core/from/configurations.js.map +1 -1
- package/dist/core/from/courses.js.map +1 -1
- package/dist/core/from/events.js.map +1 -1
- package/dist/core/from/exceptions.js.map +1 -1
- package/dist/core/from/groups.js.map +1 -1
- package/dist/core/from/index.js.map +1 -1
- package/dist/core/from/locations.js.map +1 -1
- package/dist/core/from/locked-times.js.map +1 -1
- package/dist/core/from/overlap-groups.js.map +1 -1
- package/dist/core/from/periods.js.map +1 -1
- package/dist/core/from/persons.js.map +1 -1
- package/dist/core/from/root-intervals.js.map +1 -1
- package/dist/core/from/schedules.js.map +1 -1
- package/dist/core/from/settings.js.map +1 -1
- package/dist/core/from/syllabuses.js.map +1 -1
- package/dist/core/from/teachers.js.map +1 -1
- package/dist/core/index.d.ts +0 -1
- package/dist/core/interfaces/other/companies.d.ts +0 -1
- package/dist/core/interfaces/other/companies.js.map +1 -1
- package/dist/core/interfaces/other/operations.d.ts +0 -1
- package/dist/core/interfaces/vertices/companies.d.ts +0 -1
- package/dist/core/interfaces/vertices/configurations.d.ts +0 -1
- package/dist/core/interfaces/vertices/courses.d.ts +0 -1
- package/dist/core/interfaces/vertices/division-settings.d.ts +2 -3
- package/dist/core/interfaces/vertices/divisions.d.ts +0 -1
- package/dist/core/interfaces/vertices/events.d.ts +3 -1
- package/dist/core/interfaces/vertices/exceptions.d.ts +0 -1
- package/dist/core/interfaces/vertices/generations.d.ts +1 -3
- package/dist/core/interfaces/vertices/groups.d.ts +0 -1
- package/dist/core/interfaces/vertices/index.d.ts +15 -8
- package/dist/core/interfaces/vertices/linked-events-sets.d.ts +18 -0
- package/dist/core/interfaces/vertices/locations.d.ts +0 -1
- package/dist/core/interfaces/vertices/locked-times.d.ts +0 -2
- package/dist/core/interfaces/vertices/overlap-groups.d.ts +0 -1
- package/dist/core/interfaces/vertices/periods.d.ts +0 -3
- package/dist/core/interfaces/vertices/persons.d.ts +0 -1
- package/dist/core/interfaces/vertices/properties/belongs-to.d.ts +0 -1
- package/dist/core/interfaces/vertices/properties/coalesced.d.ts +0 -1
- package/dist/core/interfaces/vertices/root-intervals.d.ts +0 -2
- package/dist/core/interfaces/vertices/syllabuses.d.ts +0 -1
- package/dist/core/interfaces/vertices/teachers.d.ts +0 -1
- package/dist/core/interfaces/vertices/threads.d.ts +0 -1
- package/dist/core/interfaces/vertices/users.d.ts +0 -1
- package/dist/core/interfaces/vertices/util/custom-vertex-export/index.d.ts +6 -6
- package/dist/core/interfaces/vertices/util/custom-vertex-export/util.d.ts +4 -4
- package/dist/core/interfaces/vertices/util/deep-vertex-export/index.d.ts +10 -10
- package/dist/core/interfaces/vertices/util/edges.d.ts +7 -7
- package/dist/core/interfaces/vertices/util/util.d.ts +24 -20
- package/dist/core/interfaces/vertices/util/vertex-query/index.d.ts +11 -11
- package/dist/core/interfaces/vertices/util/vertex.d.ts +5 -4
- package/dist/core/interfaces/vertices/vertex-query.d.ts +29 -27
- package/dist/core/interfaces/vertices/vertex-query.js +4 -0
- package/dist/core/interfaces/vertices/vertex-query.js.map +1 -1
- package/dist/core/to/configurations.js +2 -1
- package/dist/core/to/configurations.js.map +1 -1
- package/dist/core/to/courses.js +2 -1
- package/dist/core/to/courses.js.map +1 -1
- package/dist/core/to/division.js.map +1 -1
- package/dist/core/to/events.js +3 -1
- package/dist/core/to/events.js.map +1 -1
- package/dist/core/to/exceptions.js +2 -1
- package/dist/core/to/exceptions.js.map +1 -1
- package/dist/core/to/groups.js +2 -1
- package/dist/core/to/groups.js.map +1 -1
- package/dist/core/to/linked-events-sets.js +18 -0
- package/dist/core/to/linked-events-sets.js.map +1 -0
- package/dist/core/to/locations.js +2 -1
- package/dist/core/to/locations.js.map +1 -1
- package/dist/core/to/locked-times.js +2 -1
- package/dist/core/to/locked-times.js.map +1 -1
- package/dist/core/to/overlap-groups.js +2 -1
- package/dist/core/to/overlap-groups.js.map +1 -1
- package/dist/core/to/periods.js +2 -1
- package/dist/core/to/periods.js.map +1 -1
- package/dist/core/to/persons.js +2 -1
- package/dist/core/to/persons.js.map +1 -1
- package/dist/core/to/root-intervals.js +2 -1
- package/dist/core/to/root-intervals.js.map +1 -1
- package/dist/core/to/schedules.d.ts +2 -1
- package/dist/core/to/schedules.js +3 -1
- package/dist/core/to/schedules.js.map +1 -1
- package/dist/core/to/settings.js +2 -1
- package/dist/core/to/settings.js.map +1 -1
- package/dist/core/to/syllabuses.js +2 -1
- package/dist/core/to/syllabuses.js.map +1 -1
- package/dist/core/to/teachers.js +2 -1
- package/dist/core/to/teachers.js.map +1 -1
- package/dist/core/to/util.d.ts +0 -2
- package/dist/core/to/util.js +2 -1
- package/dist/core/to/util.js.map +1 -1
- package/dist/core/types/index.d.ts +5 -1
- package/dist/core/util.js +5 -3
- package/dist/core/util.js.map +1 -1
- package/dist/identify/constants/index.d.ts +1 -1
- package/dist/identify/constants/index.js.map +1 -1
- package/dist/identify/index.js +2 -1
- package/dist/identify/index.js.map +1 -1
- package/dist/sdui/from/classes.js.map +1 -1
- package/dist/sdui/from/courses.js.map +1 -1
- package/dist/sdui/from/holidays.js.map +1 -1
- package/dist/sdui/from/index.js.map +1 -1
- package/dist/sdui/from/lessons.js.map +1 -1
- package/dist/sdui/from/rooms.js.map +1 -1
- package/dist/sdui/from/schedules.d.ts +0 -2
- package/dist/sdui/from/schedules.js.map +1 -1
- package/dist/sdui/from/school-years.js.map +1 -1
- package/dist/sdui/from/substitution-plans.js.map +1 -1
- package/dist/sdui/from/teachers.js.map +1 -1
- package/dist/sdui/to/classes.js.map +1 -1
- package/dist/sdui/to/courses.js.map +1 -1
- package/dist/sdui/to/holidays.js +1 -1
- package/dist/sdui/to/holidays.js.map +1 -1
- package/dist/sdui/to/hours.js.map +1 -1
- package/dist/sdui/to/index.d.ts +0 -2
- package/dist/sdui/to/lessons.js +1 -1
- package/dist/sdui/to/lessons.js.map +1 -1
- package/dist/sdui/to/rooms.js.map +1 -1
- package/dist/sdui/to/schedules.js.map +1 -1
- package/dist/sdui/to/school-years.js +1 -1
- package/dist/sdui/to/school-years.js.map +1 -1
- package/dist/sdui/to/substitution-plans.js +7 -4
- package/dist/sdui/to/substitution-plans.js.map +1 -1
- package/dist/sdui/to/teachers.js.map +1 -1
- package/dist/vKlass/from/index.js.map +1 -1
- package/dist/vKlass/from/schedule.d.ts +0 -1
- package/dist/vKlass/from/schedule.js.map +1 -1
- package/dist/vKlass/to/schedules.js +17 -6
- package/dist/vKlass/to/schedules.js.map +1 -1
- package/package.json +29 -24
- package/dist/RS/to/input/collections.js +0 -58
- package/dist/RS/to/input/collections.js.map +0 -1
- package/dist/RS/to/input/dynamic-locked-times.js +0 -69
- package/dist/RS/to/input/dynamic-locked-times.js.map +0 -1
- package/dist/RS/to/input/util/attach-locked-times.js +0 -27
- package/dist/RS/to/input/util/attach-locked-times.js.map +0 -1
- package/dist/RS/to/input/util/parse-intervals.js +0 -56
- package/dist/RS/to/input/util/parse-intervals.js.map +0 -1
- package/dist/RS/types/collections.d.ts +0 -33
- package/dist/RS/types/default.d.ts +0 -31
- package/dist/RS/types/dependencies.d.ts +0 -16
- package/dist/RS/types/events.d.ts +0 -34
- package/dist/RS/types/groups.d.ts +0 -27
- package/dist/RS/types/individuals.d.ts +0 -16
- package/dist/RS/types/locked-times.d.ts +0 -12
- package/dist/RS/types/period.d.ts +0 -27
- package/dist/RS/types/root-intervals.d.ts +0 -10
- package/dist/RS/types/settings.d.ts +0 -15
- package/dist/RS/types/shared.d.ts +0 -27
- package/dist/core/interfaces/index.d.ts +0 -23
- package/dist/core/interfaces/other/index.d.ts +0 -6
- package/dist/core/interfaces/vertices/util/index.d.ts +0 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"make-connected.js","names":["division: Division","edges: DeepVertexEdgesOnlyExport<DivisionSettingsVertex>","x","edges: DeepVertexEdgesOnlyExport<LocationVertex>","edges: DeepVertexEdgesOnlyExport<GroupVertex>","edges: DeepVertexEdgesOnlyExport<TeacherVertex>","edges: DeepVertexEdgesOnlyExport<PersonVertex>","map","edges: DeepVertexEdgesOnlyExport<LockedTimeVertex>","edges: DeepVertexEdgesOnlyExport<OverlapGroupVertex>","locations","edges: DeepVertexEdgesOnlyExport<CourseVertex>","edges: DeepVertexEdgesOnlyExport<EventVertex>"],"sources":["../../src/RS/make-connected.ts"],"sourcesContent":["import { pick } from 'lodash-es';\nimport { getIdKey, getVertexId } from '../core/util';\nimport type { CoreTypes } from '../core';\nimport type { IdKey, InternalIdKey } from '../core/types/common';\nimport type { Types } from './types';\nimport type { PickEdges } from '../core/interfaces/vertices/util/common';\nimport type { Mixed } from '../core/interfaces/vertices/';\nimport type { Vertex, Collection } from '../core/interfaces/vertices/util/vertex';\nimport type { Coalesced } from '../core/interfaces/vertices/util/edges';\nimport type { DeepVertexExport } from '../core/interfaces/vertices/util';\nimport type { DivisionSettingsVertex } from '../core/interfaces/vertices/division-settings';\nimport type { LocationVertex } from '../core/interfaces/vertices/locations';\nimport type { GroupVertex } from '../core/interfaces/vertices/groups';\nimport type { TeacherVertex } from '../core/interfaces/vertices/teachers';\nimport type { PersonVertex } from '../core/interfaces/vertices/persons';\nimport type { PeriodVertex } from '../core/interfaces/vertices/periods';\nimport type { RootIntervalVertex } from '../core/interfaces/vertices/root-intervals';\nimport type { LockedTimeVertex } from '../core/interfaces/vertices/locked-times';\nimport type { OverlapGroupVertex } from '../core/interfaces/vertices/overlap-groups';\nimport type { CourseVertex } from '../core/interfaces/vertices/courses';\nimport type { EventVertex } from '../core/interfaces/vertices/events';\nimport type { MixedVertexExport } from '../core/interfaces/vertices/util/deep-vertex-export';\n\n\ntype IgnoredEdges =\n | 'belongsTo'\n | 'exceptions'\n | 'derivedParentGroups'\n | 'syllabus'\n | 'defaultLunch'\n | InternalIdKey;\n\ntype OmitProperties<T> = Omit<T, IgnoredEdges>;\n\ntype _Schedule = {\n division: Mixed.Division;\n divisions: Mixed.Division;\n settings: Mixed.Settings;\n groups: Mixed.Group[];\n teachers: Mixed.Teacher[];\n locations: Mixed.Location[];\n periods: Mixed.Period[];\n persons: Mixed.Person[];\n rootIntervals: Mixed.RootInterval[];\n lockedTimes: Mixed.LockedTime[];\n overlapGroups: Mixed.OverlapGroup[];\n courses: Mixed.Course[];\n events: Mixed.Event[];\n};\nexport type MixedScheduleData = Partial<_Schedule>;\n\ntype Division = Pick<CoreTypes.Deep.Division, 'displayName' | 'start' | 'end'>;\ntype DivisionSettings = CoreTypes.Deep.Settings;\ntype Location = CoreTypes.Deep.Location;\ntype Group = CoreTypes.Deep.Group;\ntype Teacher = CoreTypes.Deep.Teacher;\ntype Person = CoreTypes.Deep.Person;\ntype Period = CoreTypes.Deep.Period;\ntype RootInterval = CoreTypes.Deep.RootInterval;\ntype LockedTime = CoreTypes.Deep.LockedTime;\ntype OverlapGroup = CoreTypes.Deep.OverlapGroup;\ntype Course = CoreTypes.Deep.Course;\ntype Event = CoreTypes.Deep.Event;\n\nexport namespace ConnectedTypes {\n export type division = OmitProperties<Division>;\n export type divisionSettings = OmitProperties<DivisionSettings>;\n export type location = OmitProperties<Location>;\n export type group = OmitProperties<Group>;\n export type teacher = OmitProperties<Teacher>;\n export type person = OmitProperties<Person>;\n export type period = OmitProperties<Period>;\n export type rootInterval = OmitProperties<RootInterval>;\n export type lockedTime = OmitProperties<LockedTime>;\n export type overlapGroup = OmitProperties<OverlapGroup>;\n export type course = OmitProperties<Course>;\n export type event = OmitProperties<Event>;\n}\n\nexport type ConnectedScheduleData = {\n division: ConnectedTypes.division;\n settings: ConnectedTypes.divisionSettings;\n groups: ConnectedTypes.group[];\n teachers: ConnectedTypes.teacher[];\n locations: ConnectedTypes.location[];\n periods: ConnectedTypes.period[];\n persons: ConnectedTypes.person[];\n rootIntervals: ConnectedTypes.rootInterval[];\n lockedTimes: ConnectedTypes.lockedTime[];\n overlapGroups: ConnectedTypes.overlapGroup[];\n courses: ConnectedTypes.course[];\n events: ConnectedTypes.event[];\n};\n\ntype DeepVertexEdgesOnlyExport<\n V extends Vertex<Collection>\n> = {\n [K in keyof PickEdges<V> as K extends IgnoredEdges ? never : K]: DeepVertexExport<V>[K]\n};\n\n\nfunction indexCollection<T extends Vertex<Collection>> (collection: MixedVertexExport<T>[], idKey: IdKey): Map<string, DeepVertexExport<T>> {\n return new Map(collection.map(x => ([getVertexId(x, idKey), x as DeepVertexExport<T>] as const)));\n}\nfunction nonNullable<T> (value: T | null | undefined): value is T {\n return value != null;\n}\n\n/**\n * Connects the schedule data by replacing references with actual objects making it easier to work with.\n */\nexport function makeConnected (\n schedule: MixedScheduleData,\n options: Pick<Types.toOptions, 'idKey'> = {}\n): ConnectedScheduleData {\n const _division = schedule.divisions ?? schedule.division;\n if (!_division) throw new Error(`\"division\" or \"divisions\" missing in schedule, present keys: ${Object.keys(schedule).join(', ')}`);\n const _settings = schedule.settings;\n if (!_settings) throw new Error(`\"settings\" missing in schedule, present keys: ${Object.keys(schedule).join(', ')}`);\n\n const idKey = getIdKey(options);\n\n const groupsMap = indexCollection<GroupVertex >(schedule.groups ?? [], idKey);\n const teachersMap = indexCollection<TeacherVertex >(schedule.teachers ?? [], idKey);\n const locationsMap = indexCollection<LocationVertex >(schedule.locations ?? [], idKey);\n const coursesMap = indexCollection<CourseVertex >(schedule.courses ?? [], idKey);\n const eventsMap = indexCollection<EventVertex >(schedule.events ?? [], idKey);\n const overlapGroupsMap = indexCollection<OverlapGroupVertex>(schedule.overlapGroups ?? [], idKey);\n const periodsMap = indexCollection<PeriodVertex >(schedule.periods ?? [], idKey);\n const personsMap = indexCollection<PersonVertex >(schedule.persons ?? [], idKey);\n const lockedTimesMap = indexCollection<LockedTimeVertex >(schedule.lockedTimes ?? [], idKey);\n const rootIntervalsMap = indexCollection<RootIntervalVertex>(schedule.rootIntervals ?? [], idKey);\n\n const division: Division = pick(_division, [ 'displayName', 'start', 'end']);\n\n const settings = ((): OmitProperties<DivisionSettings> => {\n const edges: DeepVertexEdgesOnlyExport<DivisionSettingsVertex> = {\n period: _settings.period != null ? periodsMap .get(getVertexId(_settings.period, idKey)) : _settings.period,\n defaultRootInterval: _settings.defaultRootInterval != null ? rootIntervalsMap.get(getVertexId(_settings.defaultRootInterval, idKey)) : _settings.defaultRootInterval,\n } satisfies Record<keyof DeepVertexEdgesOnlyExport<DivisionSettingsVertex>, unknown>;\n return Object.assign(_settings, edges);\n })();\n\n const getLockedTimes = <T extends Mixed.Group['lockedTimes'] | undefined | null>(x: T): LockedTime[] | Extract<T, null | undefined> => {\n if (!x) return x as Extract<T, null | undefined>;\n return x.map(x => lockedTimesMap.get(getVertexId(x, idKey))).filter(nonNullable);\n };\n const getLunch = <T extends Mixed.Group['lockedTimes'] | undefined | null>(x: T): LockedTime[] | Extract<T, null | undefined> => {\n if (!x) return x as Extract<T, null | undefined>;\n return x.map(x => lockedTimesMap.get(getVertexId(x, idKey))).filter(nonNullable);\n };\n const getComplementaryTimes = <T extends Mixed.Teacher['lockedTimes'] | undefined | null>(x: T): LockedTime[] | Extract<T, null | undefined> => {\n if (!x) return x as Extract<T, null | undefined>;\n return x.map(x => lockedTimesMap.get(getVertexId(x, idKey))).filter(nonNullable);\n };\n\n const locations = (schedule.locations ?? [])\n .map((x): OmitProperties<Location> => {\n\n const edges: DeepVertexEdgesOnlyExport<LocationVertex> = {\n lockedTimes: getLockedTimes(x.lockedTimes),\n lunch: getLunch(x.lunch),\n } satisfies Record<keyof DeepVertexEdgesOnlyExport<LocationVertex>, unknown>;\n\n return Object.assign(x, edges);\n });\n\n const groups = (schedule.groups ?? [])\n .map((x): OmitProperties<Group> => {\n const edges: DeepVertexEdgesOnlyExport<GroupVertex> = {\n lockedTimes: getLockedTimes(x.lockedTimes),\n lunch: getLunch (x.lunch),\n members: x.members ? x.members .map(x => personsMap.get(getVertexId(x, idKey))).filter(nonNullable) : x.members,\n parentGroups: x.parentGroups ? x.parentGroups.map(x => groupsMap .get(getVertexId(x, idKey))).filter(nonNullable) : x.parentGroups,\n subGroups: x.subGroups ? x.subGroups .map(x => groupsMap .get(getVertexId(x, idKey))).filter(nonNullable) : x.subGroups,\n\n rootInterval: x.rootInterval != null ? rootIntervalsMap.get(getVertexId(x.rootInterval, idKey)) : x.rootInterval,\n } satisfies Record<keyof DeepVertexEdgesOnlyExport<GroupVertex>, unknown>;\n return Object.assign(x, edges);\n });\n\n const teachers = (schedule.teachers ?? [])\n .map((x): OmitProperties<Teacher> => {\n const edges: DeepVertexEdgesOnlyExport<TeacherVertex> = {\n lockedTimes: getLockedTimes (x.lockedTimes),\n lunch: getLunch (x.lunch),\n complementaryTimes: getComplementaryTimes(x.complementaryTimes),\n\n person: x.person != null ? personsMap .get(getVertexId(x.person, idKey)) : x.person,\n rootInterval: x.rootInterval != null ? rootIntervalsMap.get(getVertexId(x.rootInterval, idKey)) : x.rootInterval,\n } satisfies Record<keyof DeepVertexEdgesOnlyExport<TeacherVertex>, unknown>;\n return Object.assign(x, edges);\n });\n\n const persons = (schedule.persons ?? [])\n .map((x): OmitProperties<Person> => {\n const edges: DeepVertexEdgesOnlyExport<PersonVertex> = {\n group: x.group != null ? groupsMap.get(getVertexId(x.group, idKey)) : x.group,\n } satisfies Record<keyof DeepVertexEdgesOnlyExport<PersonVertex>, unknown>;\n return Object.assign(x, edges);\n });\n\n const periods = (schedule.periods ?? [])\n .map((x): OmitProperties<Period> => {\n const edges: DeepVertexEdgesOnlyExport<PeriodVertex> = {\n } satisfies Record<keyof DeepVertexEdgesOnlyExport<PeriodVertex>, unknown>;\n return Object.assign(x, edges);\n });\n\n const rootIntervals = (schedule.rootIntervals ?? [])\n .map((x): OmitProperties<RootInterval> => {\n const edges: DeepVertexEdgesOnlyExport<RootIntervalVertex> = {\n } satisfies Record<keyof DeepVertexEdgesOnlyExport<RootIntervalVertex>, unknown>;\n return Object.assign(x, edges);\n });\n\n type InferCollection<V extends DeepVertexExport<Vertex<Collection>>> = V extends DeepVertexExport<Vertex<infer C>> ? C : never;\n const makeCoalesced = <T extends DeepVertexExport<Vertex<Collection>>, C extends InferCollection<T>, E extends object> (\n map: Map<string, T>,\n id: string, toModel: C,\n extra?: E\n ) => {\n const to = map.get(id);\n if (!to) return;\n return { ...extra, to, toModel } as Coalesced.Util.Value<T, C, object, E>;\n };\n\n const lockedTimes = (schedule.lockedTimes ?? [])\n .map((x): OmitProperties<LockedTime> => {\n const edges: DeepVertexEdgesOnlyExport<LockedTimeVertex> = {\n coalesced: x.coalesced\n ? x.coalesced\n .map((x) => {\n const toModel = x.toModel;\n switch (toModel) {\n case 'groups': return makeCoalesced(groupsMap, getVertexId(x.to, idKey), toModel);\n case 'teachers': return makeCoalesced(teachersMap, getVertexId(x.to, idKey), toModel);\n case 'locations': return makeCoalesced(locationsMap, getVertexId(x.to, idKey), toModel);\n case 'courses': return makeCoalesced(coursesMap, getVertexId(x.to, idKey), toModel);\n case 'events': return makeCoalesced(eventsMap, getVertexId(x.to, idKey), toModel);\n case 'courseevents': return makeCoalesced(eventsMap, getVertexId(x.to, idKey), 'events');\n // case 'persons': return makeCoalesced(personsMap, getVertexId(x.to, idKey), x.toModel);\n default: throw new Error(`Unknown coalesced model \"${toModel satisfies never as string}\" in locked time ${JSON.stringify(x)}`);\n }\n })\n .filter(nonNullable)\n : x.coalesced,\n } satisfies Record<keyof DeepVertexEdgesOnlyExport<LockedTimeVertex>, unknown>;\n return Object.assign(x, edges);\n });\n\n const overlapGroups = (schedule.overlapGroups ?? [])\n .map((x): OmitProperties<OverlapGroup> => {\n const edges: DeepVertexEdgesOnlyExport<OverlapGroupVertex> = {\n coalesced: x.coalesced\n ? x.coalesced\n .map(x => {\n switch (x.toModel) {\n case 'courses': return makeCoalesced(coursesMap, getVertexId(x.to, idKey), x.toModel);\n default: throw new Error(`Unknown coalesced model \"${x.toModel satisfies never as string}\" in overlap group ${JSON.stringify(x)}`);\n }\n })\n .filter(nonNullable)\n : x.coalesced,\n species: x.species\n ? x.species\n .map(x => {\n switch (x.toModel) {\n case 'events': return makeCoalesced(eventsMap, getVertexId(x.to, idKey), x.toModel, x);\n case 'courseevents': return makeCoalesced(eventsMap, getVertexId(x.to, idKey), 'events', x);\n default: throw new Error(`Unknown species model \"${x.toModel satisfies never as string}\" in overlap group ${JSON.stringify(x)}`);\n }\n })\n .filter(nonNullable)\n : x.species,\n } satisfies Record<keyof DeepVertexEdgesOnlyExport<OverlapGroupVertex>, unknown>;\n return Object.assign(x, edges);\n });\n\n const getParticipants = (x: Mixed.Course['participants'] | Mixed.Event['participants']): CoreTypes.Deep.Course['participants'] | undefined => {\n if (!x) return undefined;\n return x\n .map(x => {\n const to = personsMap.get(getVertexId(x.to, idKey));\n if (!to) return;\n const participant: NonNullable<CoreTypes.Deep.Course['participants']>[number] = { ...x, to };\n return participant;\n })\n .filter(nonNullable);\n };\n const getTeachers = (x: Mixed.Course['teachers'] | Mixed.Event['teachers']): CoreTypes.Deep.Course['teachers'] | undefined => {\n if (!x) return undefined;\n return x\n .map(x => {\n const to = teachersMap.get(getVertexId(x.to, idKey));\n if (!to) return;\n const participant: NonNullable<CoreTypes.Deep.Course['teachers']>[number] = { ...x, to };\n return participant;\n })\n .filter(nonNullable);\n };\n const getLocations = (x: Mixed.Course['locations'] | Mixed.Event['locations']): CoreTypes.Deep.Course['locations'] | undefined => {\n if (!x) return undefined;\n return x\n .map(x => {\n const locations = x.locations\n .map(x => locationsMap.get(getVertexId(x, idKey)))\n .filter(nonNullable);\n if (locations.length != 1) throw new Error(`(RS::MakeConnected) Expected exactly one location in available locations, got ${locations.length} and before filtering: ${x.locations.map(x => getVertexId(x, idKey)).join(', ')}`);\n const availableLocation: NonNullable<CoreTypes.Deep.Course['locations']>[number] = { ...x, locations: locations as [Location] };\n return availableLocation;\n })\n .filter(nonNullable);\n };\n const getGroups = (x: Mixed.Course['groups'] | Mixed.Event['groups']): CoreTypes.Deep.Course['groups'] | undefined => {\n if (!x) return undefined;\n return x\n .map(x => {\n const to = groupsMap.get(getVertexId(x.to, idKey));\n if (!to) return;\n const exclude = x.exclude\n ? x.exclude\n .map(x => personsMap.get(getVertexId(x, idKey)))\n .filter(nonNullable)\n : undefined;\n const group: NonNullable<CoreTypes.Deep.Course['groups']>[number] = { ...x, to, exclude };\n return group;\n })\n .filter(nonNullable);\n };\n\n const courses = (schedule.courses ?? [])\n .map((x): OmitProperties<Course> => {\n const edges: DeepVertexEdgesOnlyExport<CourseVertex> = {\n groups: getGroups (x.groups),\n teachers: getTeachers (x.teachers),\n locations: getLocations (x.locations),\n participants: getParticipants(x.participants),\n lockedTimes: getLockedTimes (x.lockedTimes),\n events: x.events ? x.events .map(x => eventsMap .get(getVertexId(x, idKey))).filter(nonNullable) : x.events,\n\n period: x.period != null ? periodsMap .get(getVertexId(x.period, idKey)) : x.period,\n overlapGroup: x.overlapGroup != null ? overlapGroupsMap.get(getVertexId(x.overlapGroup, idKey)) : x.overlapGroup,\n } satisfies Record<keyof DeepVertexEdgesOnlyExport<CourseVertex>, unknown>;\n return Object.assign(x, edges);\n });\n\n const events = (schedule.events ?? [])\n .map((x): OmitProperties<Event> => {\n const edges: DeepVertexEdgesOnlyExport<EventVertex> = {\n groups: getGroups (x.groups),\n teachers: getTeachers (x.teachers),\n locations: getLocations (x.locations),\n participants: getParticipants(x.participants),\n lockedTimes: getLockedTimes (x.lockedTimes),\n inLocations: x.inLocations\n ? x.inLocations\n .map(x => x === null ? null : locationsMap.get(getVertexId(x, idKey)))\n .filter((x): x is Exclude<typeof x, undefined> => x !== undefined)\n : x.inLocations,\n\n course: x.course != null ? coursesMap .get(getVertexId(x.course, idKey)) : x.course,\n period: x.period != null ? periodsMap .get(getVertexId(x.period, idKey)) : x.period,\n overlapSpecies: x.overlapSpecies != null ? overlapGroupsMap.get(getVertexId(x.overlapSpecies, idKey)) : x.overlapSpecies,\n threads: undefined\n } satisfies Record<keyof DeepVertexEdgesOnlyExport<EventVertex>, unknown>;\n return Object.assign(x, edges);\n });\n\n\n return {\n division,\n settings,\n locations,\n groups,\n teachers,\n persons,\n periods,\n rootIntervals,\n lockedTimes,\n overlapGroups,\n courses,\n events\n };\n}"],"mappings":";;;;AAqGA,SAAS,gBAA+C,YAAoC,OAAgD;AAC1I,QAAO,IAAI,IAAI,WAAW,KAAI,MAAM,CAAC,YAAY,GAAG,MAAM,EAAE,EAAyB,CAAW,CAAC;;AAEnG,SAAS,YAAgB,OAAyC;AAChE,QAAO,SAAS;;;;;AAMlB,SAAgB,cACd,UACA,UAA2C,EAAE,EACtB;CACvB,MAAM,YAAY,SAAS,aAAa,SAAS;AACjD,KAAI,CAAC,UAAW,OAAM,IAAI,MAAM,gEAAgE,OAAO,KAAK,SAAS,CAAC,KAAK,KAAK,GAAG;CACnI,MAAM,YAAY,SAAS;AAC3B,KAAI,CAAC,UAAW,OAAM,IAAI,MAAM,iDAAiD,OAAO,KAAK,SAAS,CAAC,KAAK,KAAK,GAAG;CAEpH,MAAM,QAAQ,SAAS,QAAQ;CAE/B,MAAM,YAAmB,gBAAoC,SAAS,UAAiB,EAAE,EAAE,MAAM;CACjG,MAAM,cAAmB,gBAAoC,SAAS,YAAiB,EAAE,EAAE,MAAM;CACjG,MAAM,eAAmB,gBAA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QAAc,EAAE,SAAe,EAAE,OAAY,KAAI,QAAK,UAAe,IAAI,YAAYT,KAAG,MAAM,CAAC,CAAC,CAAC,OAAO,YAAY,GAAG,EAAE;IAEzH,QAAc,EAAE,UAAgB,OAAO,WAAiB,IAAI,YAAY,EAAE,QAAc,MAAM,CAAC,GAAG,EAAE;IACpG,cAAc,EAAE,gBAAgB,OAAO,iBAAiB,IAAI,YAAY,EAAE,cAAc,MAAM,CAAC,GAAG,EAAE;IACrG;AACD,UAAO,OAAO,OAAO,GAAG,MAAM;IAC9B;EAqCF,SAnCc,SAAS,UAAU,EAAE,EAClC,KAAK,MAA6B;GACjC,MAAMU,QAAgD;IACpD,QAAc,UAAgB,EAAE,OAAO;IACvC,UAAc,YAAgB,EAAE,SAAS;IACzC,WAAc,aAAgB,EAAE,UAAU;IAC1C,cAAc,gBAAgB,EAAE,aAAa;IAC7C,aAAc,eAAgB,EAAE,YAAY;IAC5C,aAAc,EAAE,cACZ,EAAE,YACD,KAAI,QAAKV,QAAM,OAAO,OAAO,aAAa,IAAI,YAAYA,KAAG,MAAM,CAAC,CAAC,CACrE,QAAQ,QAAyCA,QAAM,OAAU,GAClE,EAAE;IAEN,QAAgB,EAAE,UAAkB,OAAO,WAAiB,IAAI,YAAY,EAAE,QAAgB,MAAM,CAAC,GAAG,EAAE;IAC1G,QAAgB,EAAE,UAAkB,OAAO,WAAiB,IAAI,YAAY,EAAE,QAAgB,MAAM,CAAC,GAAG,EAAE;IAC1G,gBAAgB,EAAE,kBAAkB,OAAO,iBAAiB,IAAI,YAAY,EAAE,gBAAgB,MAAM,CAAC,GAAG,EAAE;IAC1G,SAAS;IACV;AACD,UAAO,OAAO,OAAO,GAAG,MAAM;IAC9B;EAgBH"}
|
|
1
|
+
{"version":3,"file":"make-connected.js","names":["division: Division","edges: DeepVertexEdgesOnlyExport<DivisionSettingsVertex>","x","edges: DeepVertexEdgesOnlyExport<LocationVertex>","edges: DeepVertexEdgesOnlyExport<GroupVertex>","edges: DeepVertexEdgesOnlyExport<TeacherVertex>","edges: DeepVertexEdgesOnlyExport<PersonVertex>","edges: DeepVertexEdgesOnlyExport<PeriodVertex>","edges: DeepVertexEdgesOnlyExport<RootIntervalVertex>","map","edges: DeepVertexEdgesOnlyExport<LockedTimeVertex>","participant: NonNullable<CoreTypes.Deep.Course['participants']>[number]","participant: NonNullable<CoreTypes.Deep.Course['teachers']>[number]","locations","availableLocation: NonNullable<CoreTypes.Deep.Course['locations']>[number]","group: NonNullable<CoreTypes.Deep.Course['groups']>[number]","edges: DeepVertexEdgesOnlyExport<CourseVertex>","edges: DeepVertexEdgesOnlyExport<EventVertex>","edges: DeepVertexEdgesOnlyExport<LinkedEventsSetVertex>"],"sources":["../../src/RS/make-connected.ts"],"sourcesContent":["import { pick } from 'lodash-es';\nimport { getIdKey, getVertexId } from '../core/util';\nimport type { CoreTypes } from '../core';\nimport type { IdKey, InternalIdKey } from '../core/types/common';\nimport type { Types } from './types';\nimport type { PickEdges } from '../core/interfaces/vertices/util/common';\nimport type { Mixed } from '../core/interfaces/vertices/';\nimport type { Vertex, Collection } from '../core/interfaces/vertices/util/vertex';\nimport type { Coalesced } from '../core/interfaces/vertices/util/edges';\nimport type { DeepVertexExport } from '../core/interfaces/vertices/util';\nimport type { DivisionSettingsVertex } from '../core/interfaces/vertices/division-settings';\nimport type { LocationVertex } from '../core/interfaces/vertices/locations';\nimport type { GroupVertex } from '../core/interfaces/vertices/groups';\nimport type { TeacherVertex } from '../core/interfaces/vertices/teachers';\nimport type { PersonVertex } from '../core/interfaces/vertices/persons';\nimport type { PeriodVertex } from '../core/interfaces/vertices/periods';\nimport type { RootIntervalVertex } from '../core/interfaces/vertices/root-intervals';\nimport type { LockedTimeVertex } from '../core/interfaces/vertices/locked-times';\nimport type { LinkedEventsSetVertex } from '../core/interfaces/vertices/linked-events-sets';\nimport type { CourseVertex } from '../core/interfaces/vertices/courses';\nimport type { EventVertex } from '../core/interfaces/vertices/events';\nimport type { MixedVertexExport } from '../core/interfaces/vertices/util/deep-vertex-export';\n\n\ntype IgnoredEdges =\n | 'belongsTo'\n | 'exceptions'\n | 'derivedParentGroups'\n | 'syllabus'\n | 'defaultLunch'\n | 'threads'\n | InternalIdKey;\n\ntype OmitProperties<T> = Omit<T, IgnoredEdges>;\n\ntype _Schedule = {\n division: Mixed.Division;\n divisions: Mixed.Division;\n settings: Mixed.Settings;\n groups: Mixed.Group[];\n teachers: Mixed.Teacher[];\n locations: Mixed.Location[];\n periods: Mixed.Period[];\n persons: Mixed.Person[];\n rootIntervals: Mixed.RootInterval[];\n lockedTimes: Mixed.LockedTime[];\n linkedEventsSets: Mixed.LinkedEventsSet[];\n courses: Mixed.Course[];\n events: Mixed.Event[];\n};\nexport type MixedScheduleData = Partial<_Schedule>;\n\ntype Division = Pick<CoreTypes.Deep.Division, 'displayName' | 'start' | 'end'>;\ntype DivisionSettings = CoreTypes.Deep.Settings;\ntype Location = CoreTypes.Deep.Location;\ntype Group = CoreTypes.Deep.Group;\ntype Teacher = CoreTypes.Deep.Teacher;\ntype Person = CoreTypes.Deep.Person;\ntype Period = CoreTypes.Deep.Period;\ntype RootInterval = CoreTypes.Deep.RootInterval;\ntype LockedTime = CoreTypes.Deep.LockedTime;\ntype Course = Omit<CoreTypes.Deep.Course, 'overlapGroup'>;\ntype Event = Omit<CoreTypes.Deep.Event, 'overlapSpecies'>;\ntype LinkedEventsSet = CoreTypes.Deep.LinkedEventsSet;\n\nexport namespace ConnectedTypes {\n export type division = OmitProperties<Division>;\n export type divisionSettings = OmitProperties<DivisionSettings>;\n export type location = OmitProperties<Location>;\n export type group = OmitProperties<Group>;\n export type teacher = OmitProperties<Teacher>;\n export type person = OmitProperties<Person>;\n export type period = OmitProperties<Period>;\n export type rootInterval = OmitProperties<RootInterval>;\n export type lockedTime = OmitProperties<LockedTime>;\n export type course = OmitProperties<Course>;\n export type event = OmitProperties<Event>;\n export type linkedEventsSet = OmitProperties<CoreTypes.Deep.LinkedEventsSet>;\n}\n\nexport type ConnectedScheduleData = {\n division: ConnectedTypes.division;\n settings: ConnectedTypes.divisionSettings;\n groups: ConnectedTypes.group[];\n teachers: ConnectedTypes.teacher[];\n locations: ConnectedTypes.location[];\n periods: ConnectedTypes.period[];\n persons: ConnectedTypes.person[];\n rootIntervals: ConnectedTypes.rootInterval[];\n lockedTimes: ConnectedTypes.lockedTime[];\n courses: ConnectedTypes.course[];\n events: ConnectedTypes.event[];\n linkedEventsSets: ConnectedTypes.linkedEventsSet[];\n};\n\ntype DeepVertexEdgesOnlyExport<\n V extends Vertex<Collection>\n> = {\n [K in keyof PickEdges<V> as K extends IgnoredEdges ? never : K]: DeepVertexExport<V>[K]\n};\n\n\nfunction indexCollection<T extends Vertex<Collection>> (collection: MixedVertexExport<T>[], idKey: IdKey): Map<string, DeepVertexExport<T>> {\n return new Map(collection.map(x => ([getVertexId(x, idKey), x as DeepVertexExport<T>] as const)));\n}\nfunction nonNullable<T> (value: T | null | undefined): value is T {\n return value != null;\n}\n\n/**\n * Connects the schedule data by replacing references with actual objects making it easier to work with.\n */\nexport function makeConnected (\n schedule: MixedScheduleData,\n options: Pick<Types.toOptions, 'idKey'> = {}\n): ConnectedScheduleData {\n const _division = schedule.divisions ?? schedule.division;\n if (!_division) throw new Error(`\"division\" or \"divisions\" missing in schedule, present keys: ${Object.keys(schedule).join(', ')}`);\n const _settings = schedule.settings;\n if (!_settings) throw new Error(`\"settings\" missing in schedule, present keys: ${Object.keys(schedule).join(', ')}`);\n\n const idKey = getIdKey(options);\n\n const groupsMap = indexCollection<GroupVertex >(schedule.groups ?? [], idKey);\n const teachersMap = indexCollection<TeacherVertex >(schedule.teachers ?? [], idKey);\n const locationsMap = indexCollection<LocationVertex >(schedule.locations ?? [], idKey);\n const coursesMap = indexCollection<CourseVertex >(schedule.courses ?? [], idKey);\n const eventsMap = indexCollection<EventVertex >(schedule.events ?? [], idKey);\n const periodsMap = indexCollection<PeriodVertex >(schedule.periods ?? [], idKey);\n const personsMap = indexCollection<PersonVertex >(schedule.persons ?? [], idKey);\n const lockedTimesMap = indexCollection<LockedTimeVertex >(schedule.lockedTimes ?? [], idKey);\n const rootIntervalsMap = indexCollection<RootIntervalVertex >(schedule.rootIntervals ?? [], idKey);\n const linkedEventsSetsMap = indexCollection<LinkedEventsSetVertex>(schedule.linkedEventsSets ?? [], idKey);\n\n const division: Division = pick(_division, [ 'displayName', 'start', 'end']);\n\n const settings = ((): OmitProperties<DivisionSettings> => {\n const edges: DeepVertexEdgesOnlyExport<DivisionSettingsVertex> = {\n period: _settings.period != null ? periodsMap .get(getVertexId(_settings.period, idKey)) : _settings.period,\n defaultRootInterval: _settings.defaultRootInterval != null ? rootIntervalsMap.get(getVertexId(_settings.defaultRootInterval, idKey)) : _settings.defaultRootInterval,\n } satisfies Record<keyof DeepVertexEdgesOnlyExport<DivisionSettingsVertex>, unknown>;\n return Object.assign(_settings, edges);\n })();\n\n const getLockedTimes = <T extends Mixed.Group['lockedTimes'] | undefined | null>(x: T): LockedTime[] | Extract<T, null | undefined> => {\n if (!x) return x as Extract<T, null | undefined>;\n return x.map(x => lockedTimesMap.get(getVertexId(x, idKey))).filter(nonNullable);\n };\n const getLunch = <T extends Mixed.Group['lockedTimes'] | undefined | null>(x: T): LockedTime[] | Extract<T, null | undefined> => {\n if (!x) return x as Extract<T, null | undefined>;\n return x.map(x => lockedTimesMap.get(getVertexId(x, idKey))).filter(nonNullable);\n };\n const getComplementaryTimes = <T extends Mixed.Teacher['lockedTimes'] | undefined | null>(x: T): LockedTime[] | Extract<T, null | undefined> => {\n if (!x) return x as Extract<T, null | undefined>;\n return x.map(x => lockedTimesMap.get(getVertexId(x, idKey))).filter(nonNullable);\n };\n\n const locations = (schedule.locations ?? [])\n .map((x): OmitProperties<Location> => {\n\n const edges: DeepVertexEdgesOnlyExport<LocationVertex> = {\n lockedTimes: getLockedTimes(x.lockedTimes),\n lunch: getLunch(x.lunch),\n } satisfies Record<keyof DeepVertexEdgesOnlyExport<LocationVertex>, unknown>;\n\n return Object.assign(x, edges);\n });\n\n const groups = (schedule.groups ?? [])\n .map((x): OmitProperties<Group> => {\n const edges: DeepVertexEdgesOnlyExport<GroupVertex> = {\n lockedTimes: getLockedTimes(x.lockedTimes),\n lunch: getLunch (x.lunch),\n members: x.members ? x.members .map(x => personsMap.get(getVertexId(x, idKey))).filter(nonNullable) : x.members,\n parentGroups: x.parentGroups ? x.parentGroups.map(x => groupsMap .get(getVertexId(x, idKey))).filter(nonNullable) : x.parentGroups,\n subGroups: x.subGroups ? x.subGroups .map(x => groupsMap .get(getVertexId(x, idKey))).filter(nonNullable) : x.subGroups,\n\n rootInterval: x.rootInterval != null ? rootIntervalsMap.get(getVertexId(x.rootInterval, idKey)) : x.rootInterval,\n } satisfies Record<keyof DeepVertexEdgesOnlyExport<GroupVertex>, unknown>;\n return Object.assign(x, edges);\n });\n\n const teachers = (schedule.teachers ?? [])\n .map((x): OmitProperties<Teacher> => {\n const edges: DeepVertexEdgesOnlyExport<TeacherVertex> = {\n lockedTimes: getLockedTimes (x.lockedTimes),\n lunch: getLunch (x.lunch),\n complementaryTimes: getComplementaryTimes(x.complementaryTimes),\n\n person: x.person != null ? personsMap .get(getVertexId(x.person, idKey)) : x.person,\n rootInterval: x.rootInterval != null ? rootIntervalsMap.get(getVertexId(x.rootInterval, idKey)) : x.rootInterval,\n } satisfies Record<keyof DeepVertexEdgesOnlyExport<TeacherVertex>, unknown>;\n return Object.assign(x, edges);\n });\n\n const persons = (schedule.persons ?? [])\n .map((x): OmitProperties<Person> => {\n const edges: DeepVertexEdgesOnlyExport<PersonVertex> = {\n group: x.group != null ? groupsMap.get(getVertexId(x.group, idKey)) : x.group,\n } satisfies Record<keyof DeepVertexEdgesOnlyExport<PersonVertex>, unknown>;\n return Object.assign(x, edges);\n });\n\n const periods = (schedule.periods ?? [])\n .map((x): OmitProperties<Period> => {\n const edges: DeepVertexEdgesOnlyExport<PeriodVertex> = {\n } satisfies Record<keyof DeepVertexEdgesOnlyExport<PeriodVertex>, unknown>;\n return Object.assign(x, edges);\n });\n\n const rootIntervals = (schedule.rootIntervals ?? [])\n .map((x): OmitProperties<RootInterval> => {\n const edges: DeepVertexEdgesOnlyExport<RootIntervalVertex> = {\n } satisfies Record<keyof DeepVertexEdgesOnlyExport<RootIntervalVertex>, unknown>;\n return Object.assign(x, edges);\n });\n\n type InferCollection<V extends DeepVertexExport<Vertex<Collection>>> = V extends DeepVertexExport<Vertex<infer C>> ? C : never;\n const makeCoalesced = <T extends DeepVertexExport<Vertex<Collection>>, C extends InferCollection<T>, E extends object> (\n map: Map<string, T>,\n id: string, toModel: C,\n extra?: E\n ) => {\n const to = map.get(id);\n if (!to) return;\n return { ...extra, to, toModel } as Coalesced.Util.Value<T, C, object, E>;\n };\n\n const lockedTimes = (schedule.lockedTimes ?? [])\n .map((x): OmitProperties<LockedTime> => {\n const edges: DeepVertexEdgesOnlyExport<LockedTimeVertex> = {\n coalesced: x.coalesced\n ? x.coalesced\n .map((x) => {\n const toModel = x.toModel;\n switch (toModel) {\n case 'groups': return makeCoalesced(groupsMap, getVertexId(x.to, idKey), toModel);\n case 'teachers': return makeCoalesced(teachersMap, getVertexId(x.to, idKey), toModel);\n case 'locations': return makeCoalesced(locationsMap, getVertexId(x.to, idKey), toModel);\n case 'courses': return makeCoalesced(coursesMap, getVertexId(x.to, idKey), toModel);\n case 'events': return makeCoalesced(eventsMap, getVertexId(x.to, idKey), toModel);\n case 'courseevents': return makeCoalesced(eventsMap, getVertexId(x.to, idKey), 'events');\n // case 'persons': return makeCoalesced(personsMap, getVertexId(x.to, idKey), x.toModel);\n default: throw new Error(`Unknown coalesced model \"${toModel satisfies never as string}\" in locked time ${JSON.stringify(x)}`);\n }\n })\n .filter(nonNullable)\n : x.coalesced,\n } satisfies Record<keyof DeepVertexEdgesOnlyExport<LockedTimeVertex>, unknown>;\n return Object.assign(x, edges);\n });\n\n const getParticipants = (x: Mixed.Course['participants'] | Mixed.Event['participants']): CoreTypes.Deep.Course['participants'] | undefined => {\n if (!x) return undefined;\n return x\n .map(x => {\n const to = personsMap.get(getVertexId(x.to, idKey));\n if (!to) return;\n const participant: NonNullable<CoreTypes.Deep.Course['participants']>[number] = { ...x, to };\n return participant;\n })\n .filter(nonNullable);\n };\n const getTeachers = (x: Mixed.Course['teachers'] | Mixed.Event['teachers']): CoreTypes.Deep.Course['teachers'] | undefined => {\n if (!x) return undefined;\n return x\n .map(x => {\n const to = teachersMap.get(getVertexId(x.to, idKey));\n if (!to) return;\n const participant: NonNullable<CoreTypes.Deep.Course['teachers']>[number] = { ...x, to };\n return participant;\n })\n .filter(nonNullable);\n };\n const getLocations = (x: Mixed.Course['locations'] | Mixed.Event['locations']): CoreTypes.Deep.Course['locations'] | undefined => {\n if (!x) return undefined;\n return x\n .map(x => {\n const locations = x.locations\n .map(x => locationsMap.get(getVertexId(x, idKey)))\n .filter(nonNullable);\n if (locations.length != 1) throw new Error(`(RS::MakeConnected) Expected exactly one location in available locations, got ${locations.length} and before filtering: ${x.locations.map(x => getVertexId(x, idKey)).join(', ')}`);\n const availableLocation: NonNullable<CoreTypes.Deep.Course['locations']>[number] = { ...x, locations: locations as [Location] };\n return availableLocation;\n })\n .filter(nonNullable);\n };\n const getGroups = (x: Mixed.Course['groups'] | Mixed.Event['groups']): CoreTypes.Deep.Course['groups'] | undefined => {\n if (!x) return undefined;\n return x\n .map(x => {\n const to = groupsMap.get(getVertexId(x.to, idKey));\n if (!to) return;\n const exclude = x.exclude\n ? x.exclude\n .map(x => personsMap.get(getVertexId(x, idKey)))\n .filter(nonNullable)\n : undefined;\n const group: NonNullable<CoreTypes.Deep.Course['groups']>[number] = { ...x, to, exclude };\n return group;\n })\n .filter(nonNullable);\n };\n\n const courses = (schedule.courses ?? [])\n .map((x): OmitProperties<Course> => {\n const edges: DeepVertexEdgesOnlyExport<CourseVertex> = {\n groups: getGroups (x.groups),\n teachers: getTeachers (x.teachers),\n locations: getLocations (x.locations),\n participants: getParticipants(x.participants),\n lockedTimes: getLockedTimes (x.lockedTimes),\n events: x.events ? x.events.map(x => eventsMap.get(getVertexId(x, idKey))).filter(nonNullable) : x.events,\n\n period: x.period != null ? periodsMap.get(getVertexId(x.period, idKey)) : x.period,\n } satisfies Record<keyof DeepVertexEdgesOnlyExport<Omit<CourseVertex, 'overlapGroup'>>, unknown>;\n return Object.assign(x, edges);\n });\n\n const events = (schedule.events ?? [])\n .map((x): OmitProperties<Event> => {\n const edges: DeepVertexEdgesOnlyExport<EventVertex> = {\n groups: getGroups (x.groups),\n teachers: getTeachers (x.teachers),\n locations: getLocations (x.locations),\n participants: getParticipants(x.participants),\n lockedTimes: getLockedTimes (x.lockedTimes),\n inLocations: x.inLocations\n ? x.inLocations\n .map(x => x === null ? null : locationsMap.get(getVertexId(x, idKey)))\n .filter((x): x is Exclude<typeof x, undefined> => x !== undefined)\n : x.inLocations,\n\n course: x.course != null ? coursesMap .get(getVertexId(x.course, idKey)) : x.course,\n period: x.period != null ? periodsMap .get(getVertexId(x.period, idKey)) : x.period,\n linkedEventsSet: x.linkedEventsSet != null ? linkedEventsSetsMap.get(getVertexId(x.linkedEventsSet, idKey)) : x.linkedEventsSet,\n } satisfies Record<keyof DeepVertexEdgesOnlyExport<Omit<EventVertex, 'overlapSpecies'>>, unknown>;\n return Object.assign(x, edges);\n });\n\n const linkedEventsSets = (schedule.linkedEventsSets ?? [])\n .map((x): OmitProperties<LinkedEventsSet> => {\n const edges: DeepVertexEdgesOnlyExport<LinkedEventsSetVertex> = {\n events: x.events\n ? x.events\n .map(x => eventsMap.get(getVertexId(x, idKey)))\n .filter(nonNullable)\n : x.events,\n } satisfies Record<keyof DeepVertexEdgesOnlyExport<LinkedEventsSetVertex>, unknown>;\n return Object.assign(x, edges);\n });\n\n\n return {\n division,\n settings,\n locations,\n groups,\n teachers,\n persons,\n periods,\n rootIntervals,\n lockedTimes,\n courses,\n events,\n linkedEventsSets\n };\n}"],"mappings":";;;;AAsGA,SAAS,gBAA+C,YAAoC,OAAgD;AAC1I,QAAO,IAAI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;EACA"}
|
package/dist/RS/to/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/RS/to/index.ts"],"sourcesContent":["import { schedules } from './schedules';\n\nexport default {\n schedules: schedules\n};"],"mappings":";;;AAEA,iBAAe,EACF
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/RS/to/index.ts"],"sourcesContent":["import { schedules } from './schedules';\n\nexport default {\n schedules: schedules\n};"],"mappings":";;;AAEA,iBAAe,EACF"}
|
|
@@ -17,21 +17,23 @@ function initialConfiguration(events, lockedTimes, options) {
|
|
|
17
17
|
const fromEvents = events.map((x) => {
|
|
18
18
|
if (x.parked) return;
|
|
19
19
|
if (!x.start || !x.end) return;
|
|
20
|
-
|
|
20
|
+
const doc = {
|
|
21
21
|
id: idOf.event(x, options),
|
|
22
22
|
...getPosition(x.start, x.end),
|
|
23
23
|
collection: x.course ? getVertexId(x.course, options) : void 0,
|
|
24
24
|
dependencies: x.inLocations?.map((x$1) => x$1 ? getVertexId(x$1, options) : null).filter((x$1) => x$1 != null)
|
|
25
|
-
}
|
|
25
|
+
};
|
|
26
|
+
return omitBy(doc, (x$1) => x$1 == null);
|
|
26
27
|
}).filter((x) => x != null);
|
|
27
28
|
const fromLockedTimes = lockedTimes.map((x) => {
|
|
28
|
-
if (x.type
|
|
29
|
+
if (!x.type || x.type == "ANY") return;
|
|
29
30
|
if (!x.start || !x.end) return;
|
|
30
|
-
|
|
31
|
+
const doc = {
|
|
31
32
|
id: idOf.lockedTime(x, options),
|
|
32
33
|
...getPosition(x.start, x.end),
|
|
33
34
|
dependencies: makeChainable(x.coalesced ?? []).chain((x$1) => x$1.filter((x$2) => x$2.toModel == "locations").map((x$2) => getVertexId(x$2.to, options)), (x$1) => uniq(x$1)).value
|
|
34
|
-
}
|
|
35
|
+
};
|
|
36
|
+
return omitBy(doc, (x$1) => x$1 == null);
|
|
35
37
|
}).filter((x) => x != null);
|
|
36
38
|
return [{ events: fromEvents.concat(fromLockedTimes) }];
|
|
37
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initial-configuration.js","names":["x"],"sources":["../../../src/RS/to/initial-configuration.ts"],"sourcesContent":["import moment from 'moment';\nimport { omitBy, uniq } from 'lodash-es';\nimport type { ConnectedTypes } from '../make-connected';\nimport { idOf } from './input/util/util';\nimport { getDayIndex, getVertexId } from '../../core/util';\nimport type { DateType } from '../../common/types';\nimport type { Types } from '../types';\nimport { makeChainable } from '../../common/make-chainable';\n\nfunction getPosition (\n start: DateType,\n end: DateType\n): Pick<Types.eventConfiguration, 'day' | 'start' | 'end'> {\n const mmtMidnight = moment.utc(start).clone().startOf('day');\n return {\n day: getDayIndex(start),\n start: moment.utc(start).diff(mmtMidnight, 'minutes'),\n end: moment.utc(end ).diff(mmtMidnight, 'minutes'),\n };\n}\n\nexport function initialConfiguration (\n events: ConnectedTypes.event[],\n lockedTimes: ConnectedTypes.lockedTime[],\n options: Types.parsedToOptions\n): Types.configuration[] {\n const fromEvents = events\n .map(x => {\n if (x.parked) return;\n if (!x.start || !x.end) return;\n\n const doc: Types.eventConfiguration = {\n id: idOf.event(x, options),\n ...getPosition(x.start, x.end),\n\n collection: x.course ? getVertexId(x.course, options) : undefined,\n dependencies: x.inLocations?.map(x => x ? getVertexId(x, options) : null).filter(x => x != null),\n };\n return omitBy(doc, x => x == null) as Types.eventConfiguration;\n })\n .filter(x => x != null);\n\n const fromLockedTimes = lockedTimes\n .map(x => {\n if (x.type
|
|
1
|
+
{"version":3,"file":"initial-configuration.js","names":["doc: Types.eventConfiguration","x"],"sources":["../../../src/RS/to/initial-configuration.ts"],"sourcesContent":["import moment from 'moment';\nimport { omitBy, uniq } from 'lodash-es';\nimport type { ConnectedTypes } from '../make-connected';\nimport { idOf } from './input/util/util';\nimport { getDayIndex, getVertexId } from '../../core/util';\nimport type { DateType } from '../../common/types';\nimport type { Types } from '../types';\nimport { makeChainable } from '../../common/make-chainable';\n\nfunction getPosition (\n start: DateType,\n end: DateType\n): Pick<Types.eventConfiguration, 'day' | 'start' | 'end'> {\n const mmtMidnight = moment.utc(start).clone().startOf('day');\n return {\n day: getDayIndex(start),\n start: moment.utc(start).diff(mmtMidnight, 'minutes'),\n end: moment.utc(end ).diff(mmtMidnight, 'minutes'),\n };\n}\n\nexport function initialConfiguration (\n events: ConnectedTypes.event[],\n lockedTimes: ConnectedTypes.lockedTime[],\n options: Types.parsedToOptions\n): Types.configuration[] {\n const fromEvents = events\n .map(x => {\n if (x.parked) return;\n if (!x.start || !x.end) return;\n\n const doc: Types.eventConfiguration = {\n id: idOf.event(x, options),\n ...getPosition(x.start, x.end),\n\n collection: x.course ? getVertexId(x.course, options) : undefined,\n dependencies: x.inLocations?.map(x => x ? getVertexId(x, options) : null).filter(x => x != null),\n };\n return omitBy(doc, x => x == null) as Types.eventConfiguration;\n })\n .filter(x => x != null);\n\n const fromLockedTimes = lockedTimes\n .map(x => {\n if (!x.type || x.type == 'ANY') return;\n if (!x.start || !x.end) return;\n\n const doc: Types.eventConfiguration = {\n id: idOf.lockedTime(x, options),\n ...getPosition(x.start, x.end),\n\n dependencies: makeChainable(x.coalesced ?? [])\n .chain(\n x => x\n .filter(x => x.toModel == 'locations')\n .map(x => getVertexId(x.to, options)),\n x => uniq(x)\n )\n .value\n };\n return omitBy(doc, x => x == null) as Types.eventConfiguration;\n })\n .filter(x => x != null);\n\n return [{\n events: fromEvents.concat(fromLockedTimes)\n }];\n};"],"mappings":";;;;;;;AASA,SAAS,YACP,OACA,KACyD;CACzD,MAAM,cAAc,OAAO,IAAI,OAAO,QAAQ,QAAQ;AACtD,QAAO;EACL,KAAO,YAAY;EACnB,OAAO,OAAO,IAAI,OAAO,KAAK,aAAa;EAC3C,KAAO,OAAO,IAAI,KAAO,KAAK,aAAa;;;AAI/C,SAAgB,qBACd,QACA,aACA,SACuB;CACvB,MAAM,aAAa,OAChB,KAAI,MAAK;AACR,MAAI,EAAE,OAAQ;AACd,MAAI,CAAC,EAAE,SAAS,CAAC,EAAE,IAAK;EAExB,MAAMA,MAAgC;GACpC,IAAI,KAAK,MAAM,GAAG;GAClB,GAAG,YAAY,EAAE,OAAO,EAAE;GAE1B,YAAc,EAAE,SAAS,YAAY,EAAE,QAAQ,WAAW;GAC1D,cAAc,EAAE,aAAa,KAAI,QAAKC,MAAI,YAAYA,KAAG,WAAW,MAAM,QAAO,QAAKA,OAAK;;AAE7F,SAAO,OAAO,MAAK,QAAKA,OAAK;IAE9B,QAAO,MAAK,KAAK;CAEpB,MAAM,kBAAkB,YACrB,KAAI,MAAK;AACR,MAAI,CAAC,EAAE,QAAQ,EAAE,QAAQ,MAAO;AAChC,MAAI,CAAC,EAAE,SAAS,CAAC,EAAE,IAAK;EAExB,MAAMD,MAAgC;GACpC,IAAI,KAAK,WAAW,GAAG;GACvB,GAAG,YAAY,EAAE,OAAO,EAAE;GAE1B,cAAc,cAAc,EAAE,aAAa,IACxC,OACC,QAAKC,IACF,QAAO,QAAKA,IAAE,WAAW,aACzB,KAAI,QAAK,YAAYA,IAAE,IAAI,YAC9B,QAAK,KAAKA,MAEX;;AAEL,SAAO,OAAO,MAAK,QAAKA,OAAK;IAE9B,QAAO,MAAK,KAAK;AAEpB,QAAO,CAAC,EACN,QAAQ,WAAW,OAAO"}
|
|
@@ -1,32 +1,27 @@
|
|
|
1
1
|
import { getVertexId } from "../../../core/util.js";
|
|
2
|
-
import {
|
|
3
|
-
import { computesDefaultIntervalId
|
|
4
|
-
import { parseIntervals } from "./util/parse-intervals.js";
|
|
5
|
-
import { DEFAULT_PERIOD_ID } from "./periods.js";
|
|
2
|
+
import { min2hrs, toTimeFloat } from "./util/util.js";
|
|
3
|
+
import { computesDefaultIntervalId } from "./intervals.js";
|
|
6
4
|
|
|
7
5
|
//#region src/RS/to/input/default.ts
|
|
8
|
-
function parseDefault(settings,
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
maxNumDailyWorkingHours,
|
|
6
|
+
function parseDefault(settings, options) {
|
|
7
|
+
const res = {
|
|
8
|
+
intervals: computesDefaultIntervalId(settings, options),
|
|
9
|
+
period: settings.period ? getVertexId(settings.period, options) : void 0,
|
|
10
|
+
minGroupBreakDuration: settings.defaultGroupMinimumBreakLength ?? 0,
|
|
11
|
+
minDependencyBreakDuration: settings.defaultDependencyMinimumBreakLength ?? 0,
|
|
12
|
+
minEventBreakDuration: settings.defaultEventMinimumBreakLength ?? 0,
|
|
13
|
+
preferredTime: toTimeFloat(settings.potentialCenter ?? "12:00"),
|
|
14
|
+
eventDensity: settings.defaultEventDensity ?? 1,
|
|
15
|
+
maxEventDurationVariance: settings.defaultEventDurationVariance ?? 0,
|
|
16
|
+
maxNumWorkingHours: min2hrs(settings.defaultMaximumScheduleSpan?.weekly) ?? false,
|
|
17
|
+
maxNumDailyWorkingHours: min2hrs(settings.defaultMaximumScheduleSpan?.daily) ?? false,
|
|
21
18
|
dependencyRank: settings.defaultDependencyRank ?? 0,
|
|
22
19
|
groupRank: settings.defaultGroupRank ?? 0,
|
|
23
20
|
dayRank: settings.defaultDayRank ?? 0,
|
|
24
21
|
groupWeight: settings.defaultGroupWeight ?? 0,
|
|
25
|
-
|
|
26
|
-
eventWeight: settings.defaultEventWeight ?? 0,
|
|
27
|
-
period: getPeriodIndex(settings.period ?? DEFAULT_PERIOD_ID, periodsMap, options),
|
|
28
|
-
_period: settings.period ? getVertexId(settings.period, options) : void 0
|
|
22
|
+
eventWeight: settings.defaultEventWeight ?? 0
|
|
29
23
|
};
|
|
24
|
+
return res;
|
|
30
25
|
}
|
|
31
26
|
|
|
32
27
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default.js","names":[],"sources":["../../../../src/RS/to/input/default.ts"],"sourcesContent":["import type { Types } from '../../types';\nimport { computesDefaultIntervalId
|
|
1
|
+
{"version":3,"file":"default.js","names":["res: Types.Entities.DefaultValues"],"sources":["../../../../src/RS/to/input/default.ts"],"sourcesContent":["import type { Types } from '../../types';\nimport { computesDefaultIntervalId } from './intervals';\nimport { min2hrs, toTimeFloat } from './util/util';\nimport type { ConnectedTypes } from '../../make-connected';\nimport { getVertexId } from '../../../core/util';\n\nexport function parseDefault (\n settings: ConnectedTypes.divisionSettings,\n options: Types.parsedToOptions\n): Types.Entities.DefaultValues {\n const res: Types.Entities.DefaultValues = {\n intervals: computesDefaultIntervalId(settings, options),\n period: settings.period ? getVertexId(settings.period, options) : undefined,\n\n minGroupBreakDuration: settings.defaultGroupMinimumBreakLength ?? 0,\n minDependencyBreakDuration: settings.defaultDependencyMinimumBreakLength ?? 0,\n minEventBreakDuration: settings.defaultEventMinimumBreakLength ?? 0,\n\n preferredTime: toTimeFloat(settings.potentialCenter ?? '12:00'),\n eventDensity: settings.defaultEventDensity ?? 1,\n\n maxEventDurationVariance: settings.defaultEventDurationVariance ?? 0,\n\n maxNumWorkingHours: min2hrs(settings.defaultMaximumScheduleSpan?.weekly) ?? false,\n maxNumDailyWorkingHours: min2hrs(settings.defaultMaximumScheduleSpan?.daily ) ?? false,\n\n dependencyRank: settings.defaultDependencyRank ?? 0,\n groupRank: settings.defaultGroupRank ?? 0,\n dayRank: settings.defaultDayRank ?? 0,\n\n groupWeight: settings.defaultGroupWeight ?? 0,\n eventWeight: settings.defaultEventWeight ?? 0,\n };\n\n return res;\n};"],"mappings":";;;;;AAMA,SAAgB,aACd,UACA,SAC8B;CAC9B,MAAMA,MAAoC;EACxC,WAAW,0BAA0B,UAAU;EAC/C,QAAW,SAAS,SAAS,YAAY,SAAS,QAAQ,WAAW;EAErE,uBAA4B,SAAS,kCAAuC;EAC5E,4BAA4B,SAAS,uCAAuC;EAC5E,uBAA4B,SAAS,kCAAuC;EAE5E,eAAe,YAAY,SAAS,mBAAmB;EACvD,cAAe,SAAS,uBAAuB;EAE/C,0BAA0B,SAAS,gCAAgC;EAEnE,oBAAyB,QAAQ,SAAS,4BAA4B,WAAW;EACjF,yBAAyB,QAAQ,SAAS,4BAA4B,UAAW;EAEjF,gBAAgB,SAAS,yBAAyB;EAClD,WAAgB,SAAS,oBAAyB;EAClD,SAAgB,SAAS,kBAAyB;EAElD,aAAa,SAAS,sBAAuB;EAC7C,aAAa,SAAS,sBAAuB;;AAG/C,QAAO"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getVertexId } from "../../../core/util.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { idOf } from "./util/util.js";
|
|
3
|
+
import { parseDayIndices } from "./util/parse-days.js";
|
|
4
4
|
import { omitBy } from "lodash-es";
|
|
5
5
|
|
|
6
6
|
//#region src/RS/to/input/dependencies.ts
|
|
@@ -11,16 +11,18 @@ function fromLocations(locations, settings, options) {
|
|
|
11
11
|
if (includedLocations && !includedLocations.has(id)) return false;
|
|
12
12
|
return true;
|
|
13
13
|
}).map((location) => {
|
|
14
|
+
const id = getVertexId(location, options);
|
|
14
15
|
const doc = {
|
|
15
|
-
id
|
|
16
|
-
|
|
17
|
-
days:
|
|
18
|
-
|
|
16
|
+
id,
|
|
17
|
+
minBreakDuration: location.minBreakLength,
|
|
18
|
+
days: parseDayIndices(location.days, settings),
|
|
19
|
+
intervals: [[{
|
|
20
|
+
start: 0,
|
|
21
|
+
end: 24
|
|
22
|
+
}]],
|
|
23
|
+
blockedTimes: location.lockedTimes?.map((x) => idOf.lockedTime(x, options))
|
|
19
24
|
};
|
|
20
|
-
if (options.includeEntityMeta) doc.
|
|
21
|
-
ids: location.ids,
|
|
22
|
-
name: location.displayName
|
|
23
|
-
}, (x) => x == null);
|
|
25
|
+
if (options.includeEntityMeta) doc.name = location.displayName;
|
|
24
26
|
return omitBy(doc, (x) => x == null);
|
|
25
27
|
});
|
|
26
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dependencies.js","names":["doc: Types.
|
|
1
|
+
{"version":3,"file":"dependencies.js","names":["doc: Types.Entities.Dependency"],"sources":["../../../../src/RS/to/input/dependencies.ts"],"sourcesContent":["import { omitBy } from 'lodash-es';\nimport type { ConnectedTypes } from '../../make-connected';\nimport { getVertexId } from '../../../core/util';\nimport { parseDayIndices } from './util/parse-days';\nimport type { Types } from '../../types';\nimport { idOf } from './util/util';\n\nexport function fromLocations (\n locations: ConnectedTypes.location[],\n settings: ConnectedTypes.divisionSettings,\n options: Types.parsedToOptions\n) {\n return locations\n .filter(x => {\n const id = getVertexId(x, options);\n\n // filter location references based on partial schedule options\n const includedLocations = options.partialScheduleOptions?.includedLocations;\n if (includedLocations && !includedLocations.has(id)) return false;\n return true;\n })\n .map(location => {\n const id = getVertexId(location, options);\n\n const doc: Types.Entities.Dependency = {\n id,\n minBreakDuration: location.minBreakLength,\n days: parseDayIndices(location.days, settings),\n intervals: [[{ start: 0, end: 24.00 }]], // as there is currently no way to specify intervals for locations\n blockedTimes: location.lockedTimes?.map(x => idOf.lockedTime(x, options)),\n };\n\n if (options.includeEntityMeta) {\n doc.name = location.displayName;\n }\n\n return omitBy(doc, x => x == null) as Types.Entities.Dependency;\n });\n}"],"mappings":";;;;;;AAOA,SAAgB,cACd,WACA,UACA,SACA;AACA,QAAO,UACJ,QAAO,MAAK;EACX,MAAM,KAAK,YAAY,GAAG;EAG1B,MAAM,oBAAoB,QAAQ,wBAAwB;AAC1D,MAAI,qBAAqB,CAAC,kBAAkB,IAAI,IAAK,QAAO;AAC5D,SAAO;IAER,KAAI,aAAY;EACf,MAAM,KAAK,YAAY,UAAU;EAEjC,MAAMA,MAAiC;GACrC;GACA,kBAAkB,SAAS;GAC3B,MAAkB,gBAAgB,SAAS,MAAM;GACjD,WAAkB,CAAC,CAAC;IAAE,OAAO;IAAG,KAAK;;GACrC,cAAkB,SAAS,aAAa,KAAI,MAAK,KAAK,WAAW,GAAG;;AAGtE,MAAI,QAAQ,kBACV,KAAI,OAAO,SAAS;AAGtB,SAAO,OAAO,MAAK,MAAK,KAAK"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { getDayIndex, getVertexId } from "../../../core/util.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { parseMinimumBreakLength } from "./util/parse-minimum-break-length.js";
|
|
2
|
+
import { makeChainable } from "../../../common/make-chainable/index.js";
|
|
3
|
+
import { idOf } from "./util/util.js";
|
|
4
|
+
import { parseDayIndices } from "./util/parse-days.js";
|
|
6
5
|
import { getDefaultInterval } from "./intervals.js";
|
|
7
|
-
import {
|
|
6
|
+
import { parseMinimumBreakLength } from "./util/parse-minimum-break-length.js";
|
|
8
7
|
import { parseGroupReferences } from "./util/parse-group-references.js";
|
|
9
|
-
import { parseLocationReferences
|
|
10
|
-
import { omitBy } from "lodash-es";
|
|
8
|
+
import { parseLocationReferences } from "./util/parse-location-references.js";
|
|
9
|
+
import { groupBy, omit, omitBy } from "lodash-es";
|
|
11
10
|
import moment from "moment";
|
|
12
11
|
|
|
13
12
|
//#region src/RS/to/input/events.ts
|
|
@@ -17,46 +16,46 @@ function toDayAndStart(start) {
|
|
|
17
16
|
day: getDayIndex(start)
|
|
18
17
|
};
|
|
19
18
|
}
|
|
20
|
-
function
|
|
19
|
+
function fromEvents(_events, settings, options) {
|
|
21
20
|
const defaultInterval = getDefaultInterval(settings);
|
|
22
|
-
|
|
21
|
+
const events = (_events ?? []).map((event) => {
|
|
23
22
|
const id = getVertexId(event, options);
|
|
24
|
-
const intervals = event.intervals ?? event.course?.intervals ?? defaultInterval;
|
|
25
23
|
const duration = event.preferredDuration;
|
|
26
|
-
if (!duration) throw new Error(`(RS::To::
|
|
27
|
-
const
|
|
28
|
-
const
|
|
24
|
+
if (!duration) throw new Error(`(RS::To::fromEvents) Event "${id}" has no duration`);
|
|
25
|
+
const maxDurationVariance = event.linkedEventsSet == null ? event.durationVariance ?? event.course?.eventDurationVariance : 0;
|
|
26
|
+
const preferredTime = (() => {
|
|
27
|
+
const centerOfAttraction = event.centerOfAttraction ?? event.course?.centerOfAttraction;
|
|
28
|
+
if (!centerOfAttraction) return;
|
|
29
|
+
return parseFloat(centerOfAttraction.replace(":", "."));
|
|
30
|
+
})();
|
|
31
|
+
const period = (() => {
|
|
32
|
+
const periodId = event.period ?? event.course?.period;
|
|
33
|
+
if (!periodId) return;
|
|
34
|
+
return getVertexId(periodId, options);
|
|
35
|
+
})();
|
|
36
|
+
const intervals = event.intervals ?? event.course?.intervals ?? defaultInterval;
|
|
29
37
|
const doc = {
|
|
30
38
|
id: idOf.event(event, options),
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
weight: event.weight,
|
|
34
|
-
density: event.density,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
days: parseDays(event.days, settings),
|
|
40
|
-
dependencies: parseLocationReferences(event.locations, options),
|
|
39
|
+
duration,
|
|
40
|
+
maxDurationVariance,
|
|
41
|
+
weight: event.weight ?? event.course?.weight,
|
|
42
|
+
density: event.density ?? event.course?.density,
|
|
43
|
+
preferredTime,
|
|
44
|
+
period,
|
|
45
|
+
days: parseDayIndices(event.days ?? event.course?.days, settings),
|
|
46
|
+
dependencies: parseLocationReferences(event.locations ?? event.course?.locations, options),
|
|
41
47
|
groups: parseGroupReferences({
|
|
42
48
|
type: "event",
|
|
43
49
|
item: event
|
|
44
50
|
}, options),
|
|
45
|
-
intervals:
|
|
46
|
-
|
|
47
|
-
|
|
51
|
+
intervals: idOf.intervalPairReference(intervals, void 0, options),
|
|
52
|
+
blockedTimes: (event.lockedTimes ?? event.course?.lockedTimes)?.map((x) => idOf.lockedTime(x, options)),
|
|
53
|
+
minBreakDuration: parseMinimumBreakLength(event.minBreakLength ?? event.course?.minBreakLength),
|
|
54
|
+
distributionKey: event.course?.id,
|
|
55
|
+
course: event.course
|
|
48
56
|
};
|
|
49
57
|
if (event.fixedStart && event.start) Object.assign(doc, toDayAndStart(event.start));
|
|
50
|
-
if (options.includeEntityMeta) doc.
|
|
51
|
-
name: event.displayName,
|
|
52
|
-
ids: event.ids,
|
|
53
|
-
parked: event.parked,
|
|
54
|
-
visible: event.visible,
|
|
55
|
-
start: event.start ? moment.utc(event.start) : void 0,
|
|
56
|
-
end: event.end ? moment.utc(event.start) : void 0,
|
|
57
|
-
course: event.course ? getVertexId(event.course, options) : void 0,
|
|
58
|
-
inLocations: event.inLocations ? parseSelectedLocations(event, options) : void 0
|
|
59
|
-
}, (x) => x == null);
|
|
58
|
+
if (options.includeEntityMeta) doc.name = event.displayName ?? event.course?.displayName;
|
|
60
59
|
if (options.partialScheduleOptions) {
|
|
61
60
|
const { includedEvents, omittedEventsHandling } = options.partialScheduleOptions;
|
|
62
61
|
if (includedEvents && !includedEvents.has(doc.id)) {
|
|
@@ -64,13 +63,13 @@ function parseEvents(events, settings, options, periodsMap) {
|
|
|
64
63
|
if (omittedEventsHandling == "freeze") {
|
|
65
64
|
if (event.parked || !event.start || !event.duration) return;
|
|
66
65
|
Object.assign(doc, toDayAndStart(event.start));
|
|
67
|
-
doc.
|
|
68
|
-
doc.
|
|
66
|
+
doc.duration = event.duration;
|
|
67
|
+
doc.maxDurationVariance = 0;
|
|
69
68
|
const numDays = settings.numDays ?? 5;
|
|
70
69
|
doc.days = Array.from({ length: numDays }, (_, i) => i);
|
|
71
70
|
doc.intervals = Array.from({ length: numDays }, () => [{
|
|
72
|
-
|
|
73
|
-
end:
|
|
71
|
+
start: 0,
|
|
72
|
+
end: 24
|
|
74
73
|
}]);
|
|
75
74
|
doc.dependencies = (event.inLocations ?? []).filter((x) => !!x).map((x) => {
|
|
76
75
|
const id$1 = getVertexId(x, options);
|
|
@@ -83,8 +82,21 @@ function parseEvents(events, settings, options, periodsMap) {
|
|
|
83
82
|
}
|
|
84
83
|
return omitBy(doc, (x) => x == null);
|
|
85
84
|
}).filter((x) => !!x);
|
|
85
|
+
const activities = makeChainable(events).chain((x) => x.filter((x$1) => !!x$1.course)).chain((x) => Object.entries(groupBy(x, (x$1) => getVertexId(x$1.course, options))).map(([id, events$1]) => {
|
|
86
|
+
const doc = {
|
|
87
|
+
id,
|
|
88
|
+
events: events$1.map((x$1) => x$1.id)
|
|
89
|
+
};
|
|
90
|
+
if (options.includeEntityMeta) doc.name = events$1[0].course?.displayName;
|
|
91
|
+
return doc;
|
|
92
|
+
})).value;
|
|
93
|
+
const outEvents = events.map((x) => omit(x, "course"));
|
|
94
|
+
return {
|
|
95
|
+
events: outEvents,
|
|
96
|
+
activities
|
|
97
|
+
};
|
|
86
98
|
}
|
|
87
99
|
|
|
88
100
|
//#endregion
|
|
89
|
-
export {
|
|
101
|
+
export { fromEvents, toDayAndStart };
|
|
90
102
|
//# sourceMappingURL=events.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.js","names":["doc:
|
|
1
|
+
{"version":3,"file":"events.js","names":["doc: _Event","id","x","events","doc: Types.Entities.Activity"],"sources":["../../../../src/RS/to/input/events.ts"],"sourcesContent":["import moment from 'moment';\nimport { groupBy, omit, omitBy } from 'lodash-es';\nimport { parseMinimumBreakLength } from './util/parse-minimum-break-length';\nimport type { Types } from '../../types';\nimport { parseGroupReferences } from './util/parse-group-references';\nimport { parseLocationReferences } from './util/parse-location-references';\nimport type { ConnectedTypes } from '../../make-connected';\nimport { getDayIndex, getVertexId } from '../../../core/util';\nimport { idOf } from './util/util';\nimport { parseDayIndices } from './util/parse-days';\nimport type { DateType } from '../../../common/types';\nimport { getDefaultInterval } from './intervals';\nimport { makeChainable } from '../../../common/make-chainable';\n\nexport function toDayAndStart (start: DateType) {\n return {\n start: parseFloat(moment.utc(start).format('HH.mm')),\n day: getDayIndex(start)\n };\n}\n\ntype _Event = Types.Entities.Event & {\n course?: ConnectedTypes.course;\n}\n\n// a type generic that makes certain properties of T required\ntype RequireProperties<T, K extends keyof T> = T & { [P in K]-?: T[P] };\n\ntype Out = {\n events: Types.Entities.Event[];\n activities: Types.Entities.Activity[];\n}\nexport function fromEvents (\n _events: ConnectedTypes.event[],\n settings: ConnectedTypes.divisionSettings,\n options: Types.parsedToOptions\n): Out {\n const defaultInterval = getDefaultInterval(settings);\n\n const events = (_events ?? [])\n .map(event => {\n const id = getVertexId(event, options);\n\n const duration = event.preferredDuration;\n if (!duration) throw new Error(`(RS::To::fromEvents) Event \"${id}\" has no duration`);\n\n // allow duration variance only if the event isn't linked\n const maxDurationVariance = event.linkedEventsSet == null\n ? (event.durationVariance ?? event.course?.eventDurationVariance)\n : 0;\n\n const preferredTime = (() => {\n const centerOfAttraction = event.centerOfAttraction ?? event.course?.centerOfAttraction;\n if (!centerOfAttraction) return;\n return parseFloat(centerOfAttraction.replace(':', '.'));\n })()\n\n const period = (() => {\n const periodId = event.period ?? event.course?.period;\n if (!periodId) return;\n return getVertexId(periodId, options);\n })();\n\n const intervals = event.intervals ?? event.course?.intervals ?? defaultInterval;\n\n const doc: _Event = {\n id: idOf.event(event, options),\n duration: duration,\n maxDurationVariance: maxDurationVariance,\n weight: event.weight ?? event.course?.weight,\n density: event.density ?? event.course?.density,\n preferredTime: preferredTime,\n period: period,\n days: parseDayIndices (event.days ?? event.course?.days, settings),\n dependencies: parseLocationReferences (event.locations ?? event.course?.locations, options),\n groups: parseGroupReferences ({ type: 'event', item: event }, options),\n intervals: idOf.intervalPairReference(intervals, undefined, options),\n blockedTimes: (event.lockedTimes ?? event.course?.lockedTimes)?.map(x => idOf.lockedTime(x, options)),\n minBreakDuration: parseMinimumBreakLength (event.minBreakLength ?? event.course?.minBreakLength),\n distributionKey: event.course?.id,\n\n // temporary data\n course: event.course,\n };\n\n // if the event has a fixed day and start\n if (event.fixedStart && event.start) {\n Object.assign(doc, toDayAndStart(event.start));\n }\n\n if (options.includeEntityMeta) {\n doc.name = event.displayName ?? event.course?.displayName;\n }\n\n ////\n //// filter events based on partialScheduleOptions\n ////\n if (options.partialScheduleOptions) {\n const { includedEvents, omittedEventsHandling } = options.partialScheduleOptions;\n if (includedEvents && !includedEvents.has(doc.id)) { // collection.id => take into account dynamic locked times too!\n\n if (omittedEventsHandling == 'ignore') return;\n\n if (omittedEventsHandling == 'freeze') {\n // must not be parked and have a start and duration to be frozen, otherwise it's ignored\n if (event.parked || !event.start || !event.duration) return;\n\n // fix day, start and end\n Object.assign(doc, toDayAndStart(event.start));\n doc.duration = event.duration;\n doc.maxDurationVariance = 0;\n\n // override intervals and days to not cause conflicts\n const numDays = settings.numDays ?? 5;\n doc.days = Array.from({ length: numDays }, (_, i) => i);\n doc.intervals = Array.from({ length: numDays }, () => [{ start: 0, end: 24.00 }]);\n\n // fix locations\n doc.dependencies = (event.inLocations ?? [])\n .filter((x): x is NonNullable<typeof x> => !!x)\n .map(x => {\n const id = getVertexId(x, options);\n\n // filter location references based on partial schedule options\n const includedLocations = options.partialScheduleOptions?.includedLocations;\n if (includedLocations && !includedLocations.has(id)) return;\n\n return [{ dependency: id }] as Types.Shared.DependencyReference[];\n })\n .filter(x => x != null);\n }\n\n }\n }\n\n return omitBy(doc, x => x == null) as typeof doc;\n })\n .filter((x): x is NonNullable<typeof x> => !!x);\n\n const activities = makeChainable(events)\n .chain(x => x.filter((x): x is RequireProperties<typeof x, 'course'> => !!x.course))\n .chain(x => Object.entries(groupBy(x, x => getVertexId(x.course, options)))\n .map(([id, events]) => {\n const doc: Types.Entities.Activity = {\n id: id,\n events: events.map(x => x.id)\n };\n\n if (options.includeEntityMeta) {\n doc.name = events[0].course?.displayName;\n }\n\n return doc;\n })\n ).value;\n\n // remove temporary data from events\n const outEvents = events.map(x => omit(x, 'course' satisfies keyof typeof x));\n\n return {\n events: outEvents,\n activities\n };\n}"],"mappings":";;;;;;;;;;;;AAcA,SAAgB,cAAe,OAAiB;AAC9C,QAAO;EACL,OAAO,WAAW,OAAO,IAAI,OAAO,OAAO;EAC3C,KAAO,YAAY;;;AAevB,SAAgB,WACd,SACA,UACA,SACK;CACL,MAAM,kBAAkB,mBAAmB;CAE3C,MAAM,UAAU,WAAW,IACxB,KAAI,U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
-
import {
|
|
3
|
-
import { parseDays } from "./util/parse-days.js";
|
|
2
|
+
import { parseDayIndices } from "./util/parse-days.js";
|
|
4
3
|
import { parseMaxWorkingHours } from "./util/parse-max-working-hours.js";
|
|
5
|
-
import { parseMinimumBreakLength } from "./util/parse-minimum-break-length.js";
|
|
6
4
|
import { getDefaultInterval } from "./intervals.js";
|
|
7
|
-
import { parseIntervals } from "./util/parse-intervals.js";
|
|
8
5
|
import { omitBy } from "lodash-es";
|
|
9
6
|
|
|
10
7
|
//#region src/RS/to/input/groups.ts
|
|
@@ -19,18 +16,13 @@ function fromGroups(groups, settings, options) {
|
|
|
19
16
|
weight: group.weight,
|
|
20
17
|
minimizeGaps: true,
|
|
21
18
|
minimizeDependencyAlternation: false,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
minBreakLength: parseMinimumBreakLength(group.minBreakLength),
|
|
28
|
-
...parseMaxWorkingHours(group, options)
|
|
19
|
+
intervals: idOf.intervalPairReference(intervals, rootInterval, options),
|
|
20
|
+
days: parseDayIndices(group.days, settings),
|
|
21
|
+
blockedTimes: group.lockedTimes?.map((x) => idOf.lockedTime(x, options)),
|
|
22
|
+
minBreakDuration: group.minBreakLength,
|
|
23
|
+
...parseMaxWorkingHours(group)
|
|
29
24
|
};
|
|
30
|
-
if (options.includeEntityMeta) doc.
|
|
31
|
-
ids: group.ids,
|
|
32
|
-
name: group.displayName
|
|
33
|
-
}, (x) => x == null);
|
|
25
|
+
if (options.includeEntityMeta) doc.name = group.displayName;
|
|
34
26
|
return omitBy(doc, (x) => x == null);
|
|
35
27
|
});
|
|
36
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"groups.js","names":["doc: Types.
|
|
1
|
+
{"version":3,"file":"groups.js","names":["doc: Types.Entities.Group"],"sources":["../../../../src/RS/to/input/groups.ts"],"sourcesContent":["import { omitBy } from 'lodash-es';\nimport type { Types } from '../../types';\nimport type { ConnectedTypes } from '../../make-connected';\nimport { parseDayIndices } from './util/parse-days';\nimport { parseMaxWorkingHours } from './util/parse-max-working-hours';\nimport { idOf } from './util/util';\nimport { getDefaultInterval } from './intervals';\n\nexport function fromGroups (\n groups: ConnectedTypes.group[],\n settings: ConnectedTypes.divisionSettings,\n options: Types.parsedToOptions\n): Types.Entities.Group[] {\n const defaultInterval = getDefaultInterval(settings);\n\n return groups\n .filter(group => group.species == 'class')\n .map(group => {\n const intervals = group.intervals ?? defaultInterval;\n const rootInterval = group.rootInterval ?? settings.defaultRootInterval;\n\n const doc: Types.Entities.Group = {\n id: idOf.group(group, options),\n group_type: 'classes',\n weight: group.weight,\n minimizeGaps: true,\n minimizeDependencyAlternation: false,\n intervals: idOf.intervalPairReference(intervals, rootInterval, options),\n days: parseDayIndices(group.days, settings),\n blockedTimes: group.lockedTimes?.map(x => idOf.lockedTime(x, options)),\n minBreakDuration: group.minBreakLength,\n ...parseMaxWorkingHours(group),\n };\n\n if (options.includeEntityMeta) {\n doc.name = group.displayName;\n }\n\n return omitBy(doc, x => x == null) as Types.Entities.Group;\n });\n};\n"],"mappings":";;;;;;;AAQA,SAAgB,WACd,QACA,UACA,SACwB;CACxB,MAAM,kBAAkB,mBAAmB;AAE3C,QAAO,OACJ,QAAO,UAAS,MAAM,WAAW,SACjC,KAAI,UAAS;EACZ,MAAM,YAAe,MAAM,aAAgB;EAC3C,MAAM,eAAe,MAAM,gBAAgB,SAAS;EAEpD,MAAMA,MAA4B;GAChC,IAA+B,KAAK,MAAM,OAAO;GACjD,YAA+B;GAC/B,QAA+B,MAAM;GACrC,cAA+B;GAC/B,+BAA+B;GAC/B,WAA+B,KAAK,sBAAsB,WAAW,cAAc;GACnF,MAA+B,gBAAgB,MAAM,MAAM;GAC3D,cAA+B,MAAM,aAAa,KAAI,MAAK,KAAK,WAAW,GAAG;GAC9E,kBAA+B,MAAM;GACrC,GAAG,qBAAqB;;AAG1B,MAAI,QAAQ,kBACV,KAAI,OAAO,MAAM;AAGnB,SAAO,OAAO,MAAK,MAAK,KAAK"}
|
|
@@ -10,21 +10,19 @@ function fromPersonsToIndividuals(persons, options) {
|
|
|
10
10
|
id: idOf.person(person, options),
|
|
11
11
|
group: person.group ? `groups.${getVertexId(person.group, options)}` : void 0
|
|
12
12
|
};
|
|
13
|
-
if (options.includeEntityMeta) doc.
|
|
14
|
-
ids: person.ids,
|
|
15
|
-
name: person.displayName
|
|
16
|
-
}, (x) => x == null);
|
|
13
|
+
if (options.includeEntityMeta) doc.name = person.displayName;
|
|
17
14
|
return omitBy(doc, (x) => x == null);
|
|
18
15
|
});
|
|
19
16
|
}
|
|
20
17
|
function fromGroupToIndividualsSet(id, reference, options) {
|
|
21
18
|
const members = new Set(reference.to.members?.map((x) => getVertexId(x, options)));
|
|
22
19
|
const excluded = new Set(reference.exclude?.map((x) => getVertexId(x, options)));
|
|
20
|
+
const remaining = members.difference(excluded);
|
|
23
21
|
const doc = {
|
|
24
22
|
id,
|
|
25
|
-
individuals: [...
|
|
23
|
+
individuals: [...remaining].map((x) => idOf.person(x, options))
|
|
26
24
|
};
|
|
27
|
-
if (options.includeEntityMeta) doc.
|
|
25
|
+
if (options.includeEntityMeta) doc.name = reference.to.displayName + (reference.exclude?.length ? ` (excl. ${reference.exclude.map((x) => x.displayName).join(", ")})` : "");
|
|
28
26
|
return doc;
|
|
29
27
|
}
|
|
30
28
|
function extractUniqueIndividuals(persons, courses, events, lockedTimes, options) {
|