@royalschedule/maps 4.0.31 → 4.0.33
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 +1 -0
- package/dist/Additio/from/schedules.js +2 -4
- 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 +4 -2
- package/dist/Additio/to/schedules.js +2 -4
- 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 +1 -0
- package/dist/Admentum/from/schedules.js +3 -6
- 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 +1 -0
- package/dist/Admentum/to/schedules.js +4 -7
- package/dist/Admentum/to/schedules.js.map +1 -1
- package/dist/Excel/index.d.ts +1 -0
- 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 -3
- package/dist/Excel/v2/from/index.js +45 -54
- package/dist/Excel/v2/from/index.js.map +1 -1
- package/dist/Excel/v2/index.d.ts +4 -3
- package/dist/IdunSoft/from/courses.js.map +1 -1
- package/dist/IdunSoft/from/events.js +1 -2
- 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 +1 -0
- 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 +1 -0
- package/dist/IdunSoft/to/schedules.js +3 -6
- package/dist/IdunSoft/to/schedules.js.map +1 -1
- package/dist/InfoMentor/to/index.d.ts +1 -0
- package/dist/InfoMentor/to/schedules.js +1 -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 +9 -11
- package/dist/PlanDigital/from/schedules.js.map +1 -1
- package/dist/PlanDigital/index.d.ts +1 -0
- package/dist/Quiculum/file/to/index.d.ts +1 -0
- package/dist/Quiculum/file/to/schedules.js +5 -9
- package/dist/Quiculum/file/to/schedules.js.map +1 -1
- package/dist/RS/from/division.d.ts +1 -0
- package/dist/RS/from/division.js +1 -2
- 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 +1 -0
- package/dist/RS/from/schedules.js.map +1 -1
- package/dist/RS/make-connected.d.ts +3 -1
- package/dist/RS/make-connected.js +34 -42
- 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 +4 -6
- package/dist/RS/to/initial-configuration.js.map +1 -1
- package/dist/RS/to/input/collections.js.map +1 -1
- package/dist/RS/to/input/default.js +1 -2
- package/dist/RS/to/input/default.js.map +1 -1
- package/dist/RS/to/input/dependencies.js +1 -2
- package/dist/RS/to/input/dependencies.js.map +1 -1
- package/dist/RS/to/input/dynamic-locked-times.js +1 -2
- package/dist/RS/to/input/dynamic-locked-times.js.map +1 -1
- package/dist/RS/to/input/events.js.map +1 -1
- package/dist/RS/to/input/groups.js.map +1 -1
- package/dist/RS/to/input/individuals.js +1 -2
- package/dist/RS/to/input/individuals.js.map +1 -1
- package/dist/RS/to/input/input.js +1 -2
- package/dist/RS/to/input/input.js.map +1 -1
- package/dist/RS/to/input/intervals.js +2 -4
- package/dist/RS/to/input/intervals.js.map +1 -1
- package/dist/RS/to/input/periods.js +2 -4
- package/dist/RS/to/input/periods.js.map +1 -1
- package/dist/RS/to/input/settings.js.map +1 -1
- package/dist/RS/to/input/teachers.js +1 -1
- package/dist/RS/to/input/teachers.js.map +1 -1
- package/dist/RS/to/input/util/attach-locked-times.js.map +1 -1
- package/dist/RS/to/input/util/parse-days.js.map +1 -1
- package/dist/RS/to/input/util/parse-group-references.js.map +1 -1
- package/dist/RS/to/input/util/parse-intervals.js +2 -4
- package/dist/RS/to/input/util/parse-intervals.js.map +1 -1
- package/dist/RS/to/input/util/parse-location-references.js +1 -2
- package/dist/RS/to/input/util/parse-location-references.js.map +1 -1
- 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.map +1 -1
- package/dist/RS/to/input/util/util.js +1 -2
- package/dist/RS/to/input/util/util.js.map +1 -1
- package/dist/RS/to/schedules.js.map +1 -1
- package/dist/RS/types/to.d.ts +1 -0
- package/dist/SS12000/from/activities.js +1 -2
- 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 +41 -6
- 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 +1 -0
- 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 +8 -12
- package/dist/SchoolSoft/api/from/schedules.js.map +1 -1
- package/dist/SchoolSoft/api/index.d.ts +6 -5
- package/dist/SchoolSoft/file/from/index.js.map +1 -1
- package/dist/SchoolSoft/file/from/schedules.js +83 -87
- package/dist/SchoolSoft/file/from/schedules.js.map +1 -1
- package/dist/SchoolSoft/file/index.d.ts +1 -0
- package/dist/SchoolSoft/file/to/index.d.ts +3 -2
- package/dist/SchoolSoft/file/to/schedules.js +1 -2
- package/dist/SchoolSoft/file/to/schedules.js.map +1 -1
- package/dist/SchoolSoft/index.d.ts +1 -0
- package/dist/Schoolity/txt/to/index.d.ts +1 -0
- package/dist/Schoolity/txt/to/schedules.js +5 -12
- package/dist/Schoolity/txt/to/schedules.js.map +1 -1
- package/dist/Skola24/mdb/from/course-and-events.js +3 -5
- 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 +1 -0
- 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 +1 -2
- 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 +31 -34
- package/dist/Skola24/txt/from/period.js.map +1 -1
- package/dist/Skola24/txt/from/schedules.d.ts +1 -0
- package/dist/Skola24/txt/from/schedules.js +6 -10
- 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 +1 -0
- package/dist/Skola24/txt/to/index.d.ts +1 -0
- package/dist/Skola24/txt/to/schedules.js +5 -12
- package/dist/Skola24/txt/to/schedules.js.map +1 -1
- package/dist/common/constants.js.map +1 -1
- 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 +1 -3
- 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 +1 -0
- package/dist/core/interfaces/index.d.ts +23 -0
- package/dist/core/interfaces/other/companies.d.ts +1 -0
- package/dist/core/interfaces/other/companies.js.map +1 -1
- package/dist/core/interfaces/other/index.d.ts +6 -0
- package/dist/core/interfaces/other/operations.d.ts +1 -0
- package/dist/core/interfaces/vertices/companies.d.ts +1 -0
- package/dist/core/interfaces/vertices/configurations.d.ts +1 -0
- package/dist/core/interfaces/vertices/courses.d.ts +1 -0
- package/dist/core/interfaces/vertices/division-settings.d.ts +2 -0
- package/dist/core/interfaces/vertices/divisions.d.ts +1 -0
- package/dist/core/interfaces/vertices/events.d.ts +1 -0
- package/dist/core/interfaces/vertices/exceptions.d.ts +1 -0
- package/dist/core/interfaces/vertices/generations.d.ts +2 -0
- package/dist/core/interfaces/vertices/groups.d.ts +1 -0
- package/dist/core/interfaces/vertices/index.d.ts +1 -0
- package/dist/core/interfaces/vertices/locations.d.ts +1 -0
- package/dist/core/interfaces/vertices/locked-times.d.ts +2 -0
- package/dist/core/interfaces/vertices/overlap-groups.d.ts +1 -0
- package/dist/core/interfaces/vertices/periods.d.ts +3 -0
- package/dist/core/interfaces/vertices/persons.d.ts +1 -0
- package/dist/core/interfaces/vertices/properties/belongs-to.d.ts +1 -0
- package/dist/core/interfaces/vertices/properties/coalesced.d.ts +1 -0
- package/dist/core/interfaces/vertices/root-intervals.d.ts +2 -0
- package/dist/core/interfaces/vertices/syllabuses.d.ts +1 -0
- package/dist/core/interfaces/vertices/teachers.d.ts +1 -0
- package/dist/core/interfaces/vertices/threads.d.ts +6 -4
- package/dist/core/interfaces/vertices/users.d.ts +1 -0
- 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 +9 -9
- package/dist/core/interfaces/vertices/util/edges.d.ts +7 -7
- package/dist/core/interfaces/vertices/util/index.d.ts +6 -0
- package/dist/core/interfaces/vertices/util/util.d.ts +20 -24
- package/dist/core/interfaces/vertices/util/vertex-query/index.d.ts +11 -11
- package/dist/core/interfaces/vertices/util/vertex.d.ts +1 -1
- package/dist/core/interfaces/vertices/vertex-query.d.ts +27 -26
- package/dist/core/interfaces/vertices/vertex-query.js.map +1 -1
- package/dist/core/to/configurations.js +1 -2
- package/dist/core/to/configurations.js.map +1 -1
- package/dist/core/to/courses.js +1 -2
- package/dist/core/to/courses.js.map +1 -1
- package/dist/core/to/division.js.map +1 -1
- package/dist/core/to/events.js +1 -2
- package/dist/core/to/events.js.map +1 -1
- package/dist/core/to/exceptions.js +1 -2
- package/dist/core/to/exceptions.js.map +1 -1
- package/dist/core/to/groups.js +1 -2
- package/dist/core/to/groups.js.map +1 -1
- package/dist/core/to/locations.js +1 -2
- package/dist/core/to/locations.js.map +1 -1
- package/dist/core/to/locked-times.js +1 -2
- package/dist/core/to/locked-times.js.map +1 -1
- package/dist/core/to/overlap-groups.js +1 -2
- package/dist/core/to/overlap-groups.js.map +1 -1
- package/dist/core/to/periods.js +1 -2
- package/dist/core/to/periods.js.map +1 -1
- package/dist/core/to/persons.js +1 -2
- package/dist/core/to/persons.js.map +1 -1
- package/dist/core/to/root-intervals.js +1 -2
- package/dist/core/to/root-intervals.js.map +1 -1
- package/dist/core/to/schedules.d.ts +1 -0
- package/dist/core/to/schedules.js.map +1 -1
- package/dist/core/to/settings.js +1 -2
- package/dist/core/to/settings.js.map +1 -1
- package/dist/core/to/syllabuses.js +1 -2
- package/dist/core/to/syllabuses.js.map +1 -1
- package/dist/core/to/teachers.js +1 -2
- package/dist/core/to/teachers.js.map +1 -1
- package/dist/core/to/util.d.ts +2 -0
- package/dist/core/to/util.js +1 -2
- package/dist/core/to/util.js.map +1 -1
- package/dist/core/types/index.d.ts +6 -0
- package/dist/core/util.js +1 -2
- package/dist/core/util.js.map +1 -1
- package/dist/identify/constants/index.js.map +1 -1
- package/dist/identify/index.js +1 -2
- 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 +2 -0
- 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.map +1 -1
- package/dist/sdui/to/hours.js.map +1 -1
- package/dist/sdui/to/index.d.ts +2 -0
- 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.map +1 -1
- package/dist/sdui/to/substitution-plans.js +3 -6
- 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 +1 -0
- package/dist/vKlass/from/schedule.js.map +1 -1
- package/dist/vKlass/to/schedules.js +6 -17
- package/dist/vKlass/to/schedules.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.js","names":["edges: SerializedEdgesOnlyVertexExport<EventVertex>","x"],"sources":["../../../src/core/to/events.ts"],"sourcesContent":["import type { Types } from '../types';\nimport type { OutTypes } from './schedules';\nimport { getVertexId } from '../util';\nimport { omitEdgesAndInternalProperties, type SerializedEdgesOnlyVertexExport, type SerializedEdgesShape } from './util';\nimport type { BaseOptions } from '../../common/types';\nimport type { EventVertex } from '../interfaces/vertices/events';\n\n\n\n\nexport default (\n events: Types.Mixed.Event[],\n options: BaseOptions\n): OutTypes.event[] => {\n return events\n .map(x => {\n const edges: SerializedEdgesOnlyVertexExport<EventVertex> = {\n period: x.period ? getVertexId(x.period, options) : undefined,\n // overlapGroup: x.overlapGroup ? getVertexId(x.overlapGroup, options) : undefined,\n overlapSpecies: x.overlapSpecies ? getVertexId(x.overlapSpecies, options) : undefined,\n course: x.course ? getVertexId(x.course, options) : undefined,\n lockedTimes: x.lockedTimes ?.map(x => getVertexId(x, options)),\n exceptions: x.exceptions ?.map(x => getVertexId(x, options)),\n teachers: x.teachers ?.map(x => ({ ...x, to: getVertexId(x.to, options) })),\n participants: x.participants?.map(x => ({ ...x, to: getVertexId(x.to, options) })),\n groups: x.groups ?.map(x => ({ ...x, to: getVertexId(x.to, options), exclude: x.exclude?.map(y => getVertexId(y, options)) })),\n locations: x.locations ?.map(x => ({ ...x, locations: [getVertexId(x.locations[0], options)] as [string] })),\n inLocations: x.inLocations ?.map(x => x ? getVertexId(x, options) : null),\n threads: undefined\n } satisfies SerializedEdgesShape<SerializedEdgesOnlyVertexExport<EventVertex>>;\n const nonEdges = omitEdgesAndInternalProperties(x, edges);\n\n return { ...nonEdges, ...edges };\n });\n};\n\n"],"mappings":";;;;AAUA,sBACE,QACA,YACqB;AACrB,QAAO,OACJ,KAAI,MAAK;EACR,MAAMA,QAAsD;GAC1D,QAAgB,EAAE,SAAiB,YAAY,EAAE,QAAgB,
|
|
1
|
+
{"version":3,"file":"events.js","names":["edges: SerializedEdgesOnlyVertexExport<EventVertex>","x"],"sources":["../../../src/core/to/events.ts"],"sourcesContent":["import type { Types } from '../types';\nimport type { OutTypes } from './schedules';\nimport { getVertexId } from '../util';\nimport { omitEdgesAndInternalProperties, type SerializedEdgesOnlyVertexExport, type SerializedEdgesShape } from './util';\nimport type { BaseOptions } from '../../common/types';\nimport type { EventVertex } from '../interfaces/vertices/events';\n\n\n\n\nexport default (\n events: Types.Mixed.Event[],\n options: BaseOptions\n): OutTypes.event[] => {\n return events\n .map(x => {\n const edges: SerializedEdgesOnlyVertexExport<EventVertex> = {\n period: x.period ? getVertexId(x.period, options) : undefined,\n // overlapGroup: x.overlapGroup ? getVertexId(x.overlapGroup, options) : undefined,\n overlapSpecies: x.overlapSpecies ? getVertexId(x.overlapSpecies, options) : undefined,\n course: x.course ? getVertexId(x.course, options) : undefined,\n lockedTimes: x.lockedTimes ?.map(x => getVertexId(x, options)),\n exceptions: x.exceptions ?.map(x => getVertexId(x, options)),\n teachers: x.teachers ?.map(x => ({ ...x, to: getVertexId(x.to, options) })),\n participants: x.participants?.map(x => ({ ...x, to: getVertexId(x.to, options) })),\n groups: x.groups ?.map(x => ({ ...x, to: getVertexId(x.to, options), exclude: x.exclude?.map(y => getVertexId(y, options)) })),\n locations: x.locations ?.map(x => ({ ...x, locations: [getVertexId(x.locations[0], options)] as [string] })),\n inLocations: x.inLocations ?.map(x => x ? getVertexId(x, options) : null),\n threads: undefined\n } satisfies SerializedEdgesShape<SerializedEdgesOnlyVertexExport<EventVertex>>;\n const nonEdges = omitEdgesAndInternalProperties(x, edges);\n\n return { ...nonEdges, ...edges };\n });\n};\n\n"],"mappings":";;;;AAUA,sBACE,QACA,YACqB;AACrB,QAAO,OACJ,KAAI,MAAK;EACR,MAAMA,QAAsD;GAC1D,QAAgB,EAAE,SAAiB,YAAY,EAAE,QAAgB,QAAQ,GAAG;GAE5E,gBAAgB,EAAE,iBAAiB,YAAY,EAAE,gBAAgB,QAAQ,GAAG;GAC5E,QAAgB,EAAE,SAAiB,YAAY,EAAE,QAAgB,QAAQ,GAAG;GAC5E,aAAgB,EAAE,aAAc,KAAI,QAAK,YAAYC,KAAG,QAAQ,CAAC;GACjE,YAAgB,EAAE,YAAc,KAAI,QAAK,YAAYA,KAAG,QAAQ,CAAC;GACjE,UAAgB,EAAE,UAAc,KAAI,SAAM;IAAE,GAAGA;IAAG,IAAI,YAAYA,IAAE,IAAI,QAAQ;IAAE,EAAE;GACpF,cAAgB,EAAE,cAAc,KAAI,SAAM;IAAE,GAAGA;IAAG,IAAI,YAAYA,IAAE,IAAI,QAAQ;IAAE,EAAE;GACpF,QAAgB,EAAE,QAAc,KAAI,SAAM;IAAE,GAAGA;IAAG,IAAI,YAAYA,IAAE,IAAI,QAAQ;IAAE,SAASA,IAAE,SAAS,KAAI,MAAK,YAAY,GAAG,QAAQ,CAAC;IAAE,EAAE;GAC3I,WAAgB,EAAE,WAAc,KAAI,SAAM;IAAE,GAAGA;IAAG,WAAW,CAAC,YAAYA,IAAE,UAAU,IAAI,QAAQ,CAAC;IAAc,EAAE;GACnH,aAAgB,EAAE,aAAc,KAAI,QAAKA,MAAI,YAAYA,KAAG,QAAQ,GAAG,KAAK;GAC5E,SAAgB;GACjB;AAGD,SAAO;GAAE,GAFQ,+BAA+B,GAAG,MAAM;GAEnC,GAAG;GAAO;GAChC"}
|
|
@@ -17,9 +17,8 @@ var exceptions_default = (exceptions, options) => {
|
|
|
17
17
|
exceptions: x.exceptions?.map((x$1) => getVertexId(x$1, options)),
|
|
18
18
|
parentExceptions: x.parentExceptions?.map((x$1) => getVertexId(x$1, options))
|
|
19
19
|
};
|
|
20
|
-
const nonEdges = omitEdgesAndInternalProperties(x, edges);
|
|
21
20
|
return {
|
|
22
|
-
...
|
|
21
|
+
...omitEdgesAndInternalProperties(x, edges),
|
|
23
22
|
...edges
|
|
24
23
|
};
|
|
25
24
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exceptions.js","names":["edges: SerializedEdgesOnlyVertexExport<ExceptionVertex>","x"],"sources":["../../../src/core/to/exceptions.ts"],"sourcesContent":["import type { Types } from '../types';\nimport type { OutTypes } from './schedules';\nimport { getVertexId } from '../util';\nimport { omitEdgesAndInternalProperties, type SerializedEdgesOnlyVertexExport, type SerializedEdgesShape } from './util';\nimport type { BaseOptions } from '../../common/types';\nimport type { ExceptionVertex } from '../interfaces/vertices/exceptions';\nimport { omit } from 'lodash-es';\n\n\nexport default (\n exceptions: Types.Mixed.Exception[],\n options: BaseOptions\n): OutTypes.exception[] => {\n return exceptions\n .map(x => {\n const edges: SerializedEdgesOnlyVertexExport<ExceptionVertex> = {\n exception: x.exception\n ? {\n ...omit(x.exception, 'to'),\n ...x.exception.to && { to: getVertexId(x.exception.to, options) }\n }\n : undefined,\n sources: x.sources ?.map(x => ({ toModel: x.toModel, to: getVertexId(x.to, options) })),\n exceptions: x.exceptions ?.map(x => getVertexId(x, options)),\n parentExceptions: x.parentExceptions?.map(x => getVertexId(x, options)),\n } satisfies SerializedEdgesShape<SerializedEdgesOnlyVertexExport<ExceptionVertex>>;\n const nonEdges = omitEdgesAndInternalProperties(x, edges);\n\n return { ...nonEdges, ...edges };\n });\n};\n"],"mappings":";;;;;AASA,0BACE,YACA,YACyB;AACzB,QAAO,WACJ,KAAI,MAAK;EACR,MAAMA,QAA0D;GAC9D,WAAW,EAAE,YACT;IACA,GAAG,KAAK,EAAE,WAAW;
|
|
1
|
+
{"version":3,"file":"exceptions.js","names":["edges: SerializedEdgesOnlyVertexExport<ExceptionVertex>","x"],"sources":["../../../src/core/to/exceptions.ts"],"sourcesContent":["import type { Types } from '../types';\nimport type { OutTypes } from './schedules';\nimport { getVertexId } from '../util';\nimport { omitEdgesAndInternalProperties, type SerializedEdgesOnlyVertexExport, type SerializedEdgesShape } from './util';\nimport type { BaseOptions } from '../../common/types';\nimport type { ExceptionVertex } from '../interfaces/vertices/exceptions';\nimport { omit } from 'lodash-es';\n\n\nexport default (\n exceptions: Types.Mixed.Exception[],\n options: BaseOptions\n): OutTypes.exception[] => {\n return exceptions\n .map(x => {\n const edges: SerializedEdgesOnlyVertexExport<ExceptionVertex> = {\n exception: x.exception\n ? {\n ...omit(x.exception, 'to'),\n ...x.exception.to && { to: getVertexId(x.exception.to, options) }\n }\n : undefined,\n sources: x.sources ?.map(x => ({ toModel: x.toModel, to: getVertexId(x.to, options) })),\n exceptions: x.exceptions ?.map(x => getVertexId(x, options)),\n parentExceptions: x.parentExceptions?.map(x => getVertexId(x, options)),\n } satisfies SerializedEdgesShape<SerializedEdgesOnlyVertexExport<ExceptionVertex>>;\n const nonEdges = omitEdgesAndInternalProperties(x, edges);\n\n return { ...nonEdges, ...edges };\n });\n};\n"],"mappings":";;;;;AASA,0BACE,YACA,YACyB;AACzB,QAAO,WACJ,KAAI,MAAK;EACR,MAAMA,QAA0D;GAC9D,WAAW,EAAE,YACT;IACA,GAAG,KAAK,EAAE,WAAW,KAAK;IAC1B,GAAG,EAAE,UAAU,MAAM,EAAE,IAAI,YAAY,EAAE,UAAU,IAAI,QAAQ,EAAE;IAClE,GACC;GACJ,SAAkB,EAAE,SAAkB,KAAI,SAAM;IAAE,SAASC,IAAE;IAAS,IAAI,YAAYA,IAAE,IAAI,QAAQ;IAAE,EAAE;GACxG,YAAkB,EAAE,YAAkB,KAAI,QAAK,YAAYA,KAAG,QAAQ,CAAC;GACvE,kBAAkB,EAAE,kBAAkB,KAAI,QAAK,YAAYA,KAAG,QAAQ,CAAC;GACxE;AAGD,SAAO;GAAE,GAFQ,+BAA+B,GAAG,MAAM;GAEnC,GAAG;GAAO;GAChC"}
|
package/dist/core/to/groups.js
CHANGED
|
@@ -13,9 +13,8 @@ var groups_default = (groups, options) => {
|
|
|
13
13
|
parentGroups: x.parentGroups?.map((x$1) => getVertexId(x$1, options)),
|
|
14
14
|
subGroups: x.subGroups?.map((x$1) => getVertexId(x$1, options))
|
|
15
15
|
};
|
|
16
|
-
const nonEdges = omitEdgesAndInternalProperties(x, edges);
|
|
17
16
|
return {
|
|
18
|
-
...
|
|
17
|
+
...omitEdgesAndInternalProperties(x, edges),
|
|
19
18
|
...edges
|
|
20
19
|
};
|
|
21
20
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"groups.js","names":["edges: SerializedEdgesOnlyVertexExport<GroupVertex>","x"],"sources":["../../../src/core/to/groups.ts"],"sourcesContent":["import type { Types } from '../types';\nimport type { OutTypes } from './schedules';\nimport { getVertexId } from '../util';\nimport { omitEdgesAndInternalProperties, type SerializedEdgesOnlyVertexExport, type SerializedEdgesShape } from './util';\nimport type { BaseOptions } from '../../common/types';\nimport type { GroupVertex } from '../interfaces/vertices/groups';\n\nexport default (\n groups: Types.Mixed.Group[],\n options: BaseOptions\n): OutTypes.group[] => {\n return groups\n .map(x => {\n const edges: SerializedEdgesOnlyVertexExport<GroupVertex> = {\n rootInterval: x.rootInterval ? getVertexId(x.rootInterval, options) : undefined,\n exceptions: x.exceptions ?.map(x => getVertexId(x, options)),\n lockedTimes: x.lockedTimes ?.map(x => getVertexId(x, options)),\n lunch: x.lunch ?.map(x => getVertexId(x, options)),\n members: x.members ?.map(x => getVertexId(x, options)),\n parentGroups: x.parentGroups?.map(x => getVertexId(x, options)),\n subGroups: x.subGroups ?.map(x => getVertexId(x, options)),\n } satisfies SerializedEdgesShape<SerializedEdgesOnlyVertexExport<GroupVertex>>;\n const nonEdges = omitEdgesAndInternalProperties(x, edges);\n\n return { ...nonEdges, ...edges };\n });\n};\n"],"mappings":";;;;AAOA,sBACE,QACA,YACqB;AACrB,QAAO,OACJ,KAAI,MAAK;EACR,MAAMA,QAAsD;GAC1D,cAAc,EAAE,eAAe,YAAY,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"groups.js","names":["edges: SerializedEdgesOnlyVertexExport<GroupVertex>","x"],"sources":["../../../src/core/to/groups.ts"],"sourcesContent":["import type { Types } from '../types';\nimport type { OutTypes } from './schedules';\nimport { getVertexId } from '../util';\nimport { omitEdgesAndInternalProperties, type SerializedEdgesOnlyVertexExport, type SerializedEdgesShape } from './util';\nimport type { BaseOptions } from '../../common/types';\nimport type { GroupVertex } from '../interfaces/vertices/groups';\n\nexport default (\n groups: Types.Mixed.Group[],\n options: BaseOptions\n): OutTypes.group[] => {\n return groups\n .map(x => {\n const edges: SerializedEdgesOnlyVertexExport<GroupVertex> = {\n rootInterval: x.rootInterval ? getVertexId(x.rootInterval, options) : undefined,\n exceptions: x.exceptions ?.map(x => getVertexId(x, options)),\n lockedTimes: x.lockedTimes ?.map(x => getVertexId(x, options)),\n lunch: x.lunch ?.map(x => getVertexId(x, options)),\n members: x.members ?.map(x => getVertexId(x, options)),\n parentGroups: x.parentGroups?.map(x => getVertexId(x, options)),\n subGroups: x.subGroups ?.map(x => getVertexId(x, options)),\n } satisfies SerializedEdgesShape<SerializedEdgesOnlyVertexExport<GroupVertex>>;\n const nonEdges = omitEdgesAndInternalProperties(x, edges);\n\n return { ...nonEdges, ...edges };\n });\n};\n"],"mappings":";;;;AAOA,sBACE,QACA,YACqB;AACrB,QAAO,OACJ,KAAI,MAAK;EACR,MAAMA,QAAsD;GAC1D,cAAc,EAAE,eAAe,YAAY,EAAE,cAAc,QAAQ,GAAG;GACtE,YAAc,EAAE,YAAc,KAAI,QAAK,YAAYC,KAAG,QAAQ,CAAC;GAC/D,aAAc,EAAE,aAAc,KAAI,QAAK,YAAYA,KAAG,QAAQ,CAAC;GAC/D,OAAc,EAAE,OAAc,KAAI,QAAK,YAAYA,KAAG,QAAQ,CAAC;GAC/D,SAAc,EAAE,SAAc,KAAI,QAAK,YAAYA,KAAG,QAAQ,CAAC;GAC/D,cAAc,EAAE,cAAc,KAAI,QAAK,YAAYA,KAAG,QAAQ,CAAC;GAC/D,WAAc,EAAE,WAAc,KAAI,QAAK,YAAYA,KAAG,QAAQ,CAAC;GAChE;AAGD,SAAO;GAAE,GAFQ,+BAA+B,GAAG,MAAM;GAEnC,GAAG;GAAO;GAChC"}
|
|
@@ -9,9 +9,8 @@ var locations_default = (locations, options) => {
|
|
|
9
9
|
lockedTimes: x.lockedTimes?.map((x$1) => getVertexId(x$1, options)),
|
|
10
10
|
lunch: x.lunch?.map((x$1) => getVertexId(x$1, options))
|
|
11
11
|
};
|
|
12
|
-
const nonEdges = omitEdgesAndInternalProperties(x, edges);
|
|
13
12
|
return {
|
|
14
|
-
...
|
|
13
|
+
...omitEdgesAndInternalProperties(x, edges),
|
|
15
14
|
...edges
|
|
16
15
|
};
|
|
17
16
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locations.js","names":["edges: SerializedEdgesOnlyVertexExport<LocationVertex>","x"],"sources":["../../../src/core/to/locations.ts"],"sourcesContent":["import type { Types } from '../types';\nimport type { OutTypes } from './schedules';\nimport { getVertexId } from '../util';\nimport { omitEdgesAndInternalProperties, type SerializedEdgesOnlyVertexExport, type SerializedEdgesShape } from './util';\nimport type { BaseOptions } from '../../common/types';\nimport type { LocationVertex } from '../interfaces/vertices/locations';\n\nexport default (\n locations: Types.Mixed.Location[],\n options: BaseOptions\n): OutTypes.location[] => {\n return locations\n .map(x => {\n const edges: SerializedEdgesOnlyVertexExport<LocationVertex> = {\n exceptions: x.exceptions ?.map(x => getVertexId(x, options)),\n lockedTimes: x.lockedTimes?.map(x => getVertexId(x, options)),\n lunch: x.lunch ?.map(x => getVertexId(x, options)),\n } satisfies SerializedEdgesShape<SerializedEdgesOnlyVertexExport<LocationVertex>>;\n const nonEdges = omitEdgesAndInternalProperties(x, edges);\n\n return { ...nonEdges, ...edges };\n });\n};\n"],"mappings":";;;;AAOA,yBACE,WACA,YACwB;AACxB,QAAO,UACJ,KAAI,MAAK;EACR,MAAMA,QAAyD;GAC7D,YAAa,EAAE,YAAa,KAAI,QAAK,YAAYC,KAAG;
|
|
1
|
+
{"version":3,"file":"locations.js","names":["edges: SerializedEdgesOnlyVertexExport<LocationVertex>","x"],"sources":["../../../src/core/to/locations.ts"],"sourcesContent":["import type { Types } from '../types';\nimport type { OutTypes } from './schedules';\nimport { getVertexId } from '../util';\nimport { omitEdgesAndInternalProperties, type SerializedEdgesOnlyVertexExport, type SerializedEdgesShape } from './util';\nimport type { BaseOptions } from '../../common/types';\nimport type { LocationVertex } from '../interfaces/vertices/locations';\n\nexport default (\n locations: Types.Mixed.Location[],\n options: BaseOptions\n): OutTypes.location[] => {\n return locations\n .map(x => {\n const edges: SerializedEdgesOnlyVertexExport<LocationVertex> = {\n exceptions: x.exceptions ?.map(x => getVertexId(x, options)),\n lockedTimes: x.lockedTimes?.map(x => getVertexId(x, options)),\n lunch: x.lunch ?.map(x => getVertexId(x, options)),\n } satisfies SerializedEdgesShape<SerializedEdgesOnlyVertexExport<LocationVertex>>;\n const nonEdges = omitEdgesAndInternalProperties(x, edges);\n\n return { ...nonEdges, ...edges };\n });\n};\n"],"mappings":";;;;AAOA,yBACE,WACA,YACwB;AACxB,QAAO,UACJ,KAAI,MAAK;EACR,MAAMA,QAAyD;GAC7D,YAAa,EAAE,YAAa,KAAI,QAAK,YAAYC,KAAG,QAAQ,CAAC;GAC7D,aAAa,EAAE,aAAa,KAAI,QAAK,YAAYA,KAAG,QAAQ,CAAC;GAC7D,OAAa,EAAE,OAAa,KAAI,QAAK,YAAYA,KAAG,QAAQ,CAAC;GAC9D;AAGD,SAAO;GAAE,GAFQ,+BAA+B,GAAG,MAAM;GAEnC,GAAG;GAAO;GAChC"}
|
|
@@ -8,9 +8,8 @@ var locked_times_default = (lockedTimes, options) => {
|
|
|
8
8
|
toModel: x$1.toModel,
|
|
9
9
|
to: getVertexId(x$1.to, options)
|
|
10
10
|
})) };
|
|
11
|
-
const nonEdges = omitEdgesAndInternalProperties(x, edges);
|
|
12
11
|
return {
|
|
13
|
-
...
|
|
12
|
+
...omitEdgesAndInternalProperties(x, edges),
|
|
14
13
|
...edges
|
|
15
14
|
};
|
|
16
15
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locked-times.js","names":["edges: SerializedEdgesOnlyVertexExport<LockedTimeVertex>","x"],"sources":["../../../src/core/to/locked-times.ts"],"sourcesContent":["import type { Types } from '../types';\nimport type { OutTypes } from './schedules';\nimport { getVertexId } from '../util';\nimport { omitEdgesAndInternalProperties, type SerializedEdgesOnlyVertexExport, type SerializedEdgesShape } from './util';\nimport type { BaseOptions } from '../../common/types';\nimport type { LockedTimeVertex } from '../interfaces/vertices/locked-times';\n\nexport default (\n lockedTimes: Types.Mixed.LockedTime[],\n options: BaseOptions\n): OutTypes.lockedTime[] => {\n return lockedTimes\n .map(x => {\n const edges: SerializedEdgesOnlyVertexExport<LockedTimeVertex> = {\n coalesced: x.coalesced?.map(x => ({ toModel: x.toModel, to: getVertexId(x.to, options) })),\n } satisfies SerializedEdgesShape<SerializedEdgesOnlyVertexExport<LockedTimeVertex>>;\n const nonEdges = omitEdgesAndInternalProperties(x, edges);\n\n return { ...nonEdges, ...edges };\n });\n};\n"],"mappings":";;;;AAOA,4BACE,aACA,YAC0B;AAC1B,QAAO,YACJ,KAAI,MAAK;EACR,MAAMA,QAA2D,EAC/D,WAAW,EAAE,WAAW,KAAI,SAAM;GAAE,SAASC,IAAE;GAAS,IAAI,YAAYA,IAAE,IAAI
|
|
1
|
+
{"version":3,"file":"locked-times.js","names":["edges: SerializedEdgesOnlyVertexExport<LockedTimeVertex>","x"],"sources":["../../../src/core/to/locked-times.ts"],"sourcesContent":["import type { Types } from '../types';\nimport type { OutTypes } from './schedules';\nimport { getVertexId } from '../util';\nimport { omitEdgesAndInternalProperties, type SerializedEdgesOnlyVertexExport, type SerializedEdgesShape } from './util';\nimport type { BaseOptions } from '../../common/types';\nimport type { LockedTimeVertex } from '../interfaces/vertices/locked-times';\n\nexport default (\n lockedTimes: Types.Mixed.LockedTime[],\n options: BaseOptions\n): OutTypes.lockedTime[] => {\n return lockedTimes\n .map(x => {\n const edges: SerializedEdgesOnlyVertexExport<LockedTimeVertex> = {\n coalesced: x.coalesced?.map(x => ({ toModel: x.toModel, to: getVertexId(x.to, options) })),\n } satisfies SerializedEdgesShape<SerializedEdgesOnlyVertexExport<LockedTimeVertex>>;\n const nonEdges = omitEdgesAndInternalProperties(x, edges);\n\n return { ...nonEdges, ...edges };\n });\n};\n"],"mappings":";;;;AAOA,4BACE,aACA,YAC0B;AAC1B,QAAO,YACJ,KAAI,MAAK;EACR,MAAMA,QAA2D,EAC/D,WAAW,EAAE,WAAW,KAAI,SAAM;GAAE,SAASC,IAAE;GAAS,IAAI,YAAYA,IAAE,IAAI,QAAQ;GAAE,EAAE,EAC3F;AAGD,SAAO;GAAE,GAFQ,+BAA+B,GAAG,MAAM;GAEnC,GAAG;GAAO;GAChC"}
|
|
@@ -15,9 +15,8 @@ var overlap_groups_default = (overlapGroups, options) => {
|
|
|
15
15
|
to: getVertexId(x$1.to, options)
|
|
16
16
|
}))
|
|
17
17
|
};
|
|
18
|
-
const nonEdges = omitEdgesAndInternalProperties(x, edges);
|
|
19
18
|
return {
|
|
20
|
-
...
|
|
19
|
+
...omitEdgesAndInternalProperties(x, edges),
|
|
21
20
|
...edges
|
|
22
21
|
};
|
|
23
22
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overlap-groups.js","names":["edges: SerializedEdgesOnlyVertexExport<OverlapGroupVertex>","x"],"sources":["../../../src/core/to/overlap-groups.ts"],"sourcesContent":["import type { Types } from '../types';\nimport type { OutTypes } from './schedules';\nimport { getVertexId } from '../util';\nimport { omitEdgesAndInternalProperties, type SerializedEdgesOnlyVertexExport, type SerializedEdgesShape } from './util';\nimport type { BaseOptions } from '../../common/types';\nimport type { OverlapGroupVertex } from '../interfaces/vertices/overlap-groups';\n\nexport default (\n overlapGroups: Types.Mixed.OverlapGroup[],\n options: BaseOptions\n): OutTypes.overlapGroup[] => {\n return overlapGroups\n .map(x => {\n const edges: SerializedEdgesOnlyVertexExport<OverlapGroupVertex> = {\n coalesced: x.coalesced?.map(x => ({ toModel: x.toModel, to: getVertexId(x.to, options) })),\n species: x.species ?.map(x => ({ toModel: x.toModel, id: x.id, to: getVertexId(x.to, options) })),\n } satisfies SerializedEdgesShape<SerializedEdgesOnlyVertexExport<OverlapGroupVertex>>;\n const nonEdges = omitEdgesAndInternalProperties(x, edges);\n\n return { ...nonEdges, ...edges };\n });\n};\n"],"mappings":";;;;AAOA,8BACE,eACA,YAC4B;AAC5B,QAAO,cACJ,KAAI,MAAK;EACR,MAAMA,QAA6D;GACjE,WAAW,EAAE,WAAW,KAAI,SAAM;IAAE,SAASC,IAAE;IAAmB,IAAI,YAAYA,IAAE,IAAI
|
|
1
|
+
{"version":3,"file":"overlap-groups.js","names":["edges: SerializedEdgesOnlyVertexExport<OverlapGroupVertex>","x"],"sources":["../../../src/core/to/overlap-groups.ts"],"sourcesContent":["import type { Types } from '../types';\nimport type { OutTypes } from './schedules';\nimport { getVertexId } from '../util';\nimport { omitEdgesAndInternalProperties, type SerializedEdgesOnlyVertexExport, type SerializedEdgesShape } from './util';\nimport type { BaseOptions } from '../../common/types';\nimport type { OverlapGroupVertex } from '../interfaces/vertices/overlap-groups';\n\nexport default (\n overlapGroups: Types.Mixed.OverlapGroup[],\n options: BaseOptions\n): OutTypes.overlapGroup[] => {\n return overlapGroups\n .map(x => {\n const edges: SerializedEdgesOnlyVertexExport<OverlapGroupVertex> = {\n coalesced: x.coalesced?.map(x => ({ toModel: x.toModel, to: getVertexId(x.to, options) })),\n species: x.species ?.map(x => ({ toModel: x.toModel, id: x.id, to: getVertexId(x.to, options) })),\n } satisfies SerializedEdgesShape<SerializedEdgesOnlyVertexExport<OverlapGroupVertex>>;\n const nonEdges = omitEdgesAndInternalProperties(x, edges);\n\n return { ...nonEdges, ...edges };\n });\n};\n"],"mappings":";;;;AAOA,8BACE,eACA,YAC4B;AAC5B,QAAO,cACJ,KAAI,MAAK;EACR,MAAMA,QAA6D;GACjE,WAAW,EAAE,WAAW,KAAI,SAAM;IAAE,SAASC,IAAE;IAAmB,IAAI,YAAYA,IAAE,IAAI,QAAQ;IAAE,EAAE;GACpG,SAAW,EAAE,SAAW,KAAI,SAAM;IAAE,SAASA,IAAE;IAAS,IAAIA,IAAE;IAAI,IAAI,YAAYA,IAAE,IAAI,QAAQ;IAAE,EAAE;GACrG;AAGD,SAAO;GAAE,GAFQ,+BAA+B,GAAG,MAAM;GAEnC,GAAG;GAAO;GAChC"}
|
package/dist/core/to/periods.js
CHANGED
|
@@ -4,9 +4,8 @@ import { omitEdgesAndInternalProperties } from "./util.js";
|
|
|
4
4
|
var periods_default = (periods, options) => {
|
|
5
5
|
return periods.map((x) => {
|
|
6
6
|
const edges = {};
|
|
7
|
-
const nonEdges = omitEdgesAndInternalProperties(x, edges);
|
|
8
7
|
return {
|
|
9
|
-
...
|
|
8
|
+
...omitEdgesAndInternalProperties(x, edges),
|
|
10
9
|
...edges
|
|
11
10
|
};
|
|
12
11
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"periods.js","names":["edges: SerializedEdgesOnlyVertexExport<PeriodVertex>"],"sources":["../../../src/core/to/periods.ts"],"sourcesContent":["import type { Types } from '../types';\nimport type { OutTypes } from './schedules';\nimport { omitEdgesAndInternalProperties, type SerializedEdgesOnlyVertexExport, type SerializedEdgesShape } from './util';\nimport type { BaseOptions } from '../../common/types';\nimport type { PeriodVertex } from '../interfaces/vertices/periods';\n\nexport default (\n periods: Types.Mixed.Period[],\n options: BaseOptions\n): OutTypes.period[] => {\n return periods\n .map(x => {\n const edges: SerializedEdgesOnlyVertexExport<PeriodVertex> = {\n } satisfies SerializedEdgesShape<SerializedEdgesOnlyVertexExport<PeriodVertex>>;\n const nonEdges = omitEdgesAndInternalProperties(x, edges);\n\n return { ...nonEdges, ...edges };\n });\n};\n"],"mappings":";;;AAMA,uBACE,SACA,YACsB;AACtB,QAAO,QACJ,KAAI,MAAK;EACR,MAAMA,QAAuD;
|
|
1
|
+
{"version":3,"file":"periods.js","names":["edges: SerializedEdgesOnlyVertexExport<PeriodVertex>"],"sources":["../../../src/core/to/periods.ts"],"sourcesContent":["import type { Types } from '../types';\nimport type { OutTypes } from './schedules';\nimport { omitEdgesAndInternalProperties, type SerializedEdgesOnlyVertexExport, type SerializedEdgesShape } from './util';\nimport type { BaseOptions } from '../../common/types';\nimport type { PeriodVertex } from '../interfaces/vertices/periods';\n\nexport default (\n periods: Types.Mixed.Period[],\n options: BaseOptions\n): OutTypes.period[] => {\n return periods\n .map(x => {\n const edges: SerializedEdgesOnlyVertexExport<PeriodVertex> = {\n } satisfies SerializedEdgesShape<SerializedEdgesOnlyVertexExport<PeriodVertex>>;\n const nonEdges = omitEdgesAndInternalProperties(x, edges);\n\n return { ...nonEdges, ...edges };\n });\n};\n"],"mappings":";;;AAMA,uBACE,SACA,YACsB;AACtB,QAAO,QACJ,KAAI,MAAK;EACR,MAAMA,QAAuD,EAC5D;AAGD,SAAO;GAAE,GAFQ,+BAA+B,GAAG,MAAM;GAEnC,GAAG;GAAO;GAChC"}
|
package/dist/core/to/persons.js
CHANGED
|
@@ -5,9 +5,8 @@ import { omitEdgesAndInternalProperties } from "./util.js";
|
|
|
5
5
|
var persons_default = (persons, options) => {
|
|
6
6
|
return persons.map((x) => {
|
|
7
7
|
const edges = { group: x.group ? getVertexId(x.group, options) : void 0 };
|
|
8
|
-
const nonEdges = omitEdgesAndInternalProperties(x, edges);
|
|
9
8
|
return {
|
|
10
|
-
...
|
|
9
|
+
...omitEdgesAndInternalProperties(x, edges),
|
|
11
10
|
...edges
|
|
12
11
|
};
|
|
13
12
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"persons.js","names":["edges: SerializedEdgesOnlyVertexExport<PersonVertex>"],"sources":["../../../src/core/to/persons.ts"],"sourcesContent":["import type { Types } from '../types';\nimport type { OutTypes } from './schedules';\nimport { getVertexId } from '../util';\nimport { omitEdgesAndInternalProperties, type SerializedEdgesOnlyVertexExport, type SerializedEdgesShape } from './util';\nimport type { BaseOptions } from '../../common/types';\nimport type { PersonVertex } from '../interfaces/vertices/persons';\n\nexport default (\n persons: Types.Mixed.Person[],\n options: BaseOptions\n): OutTypes.person[] => {\n return persons\n .map(x => {\n const edges: SerializedEdgesOnlyVertexExport<PersonVertex> = {\n group: x.group ? getVertexId(x.group, options) : undefined,\n } satisfies SerializedEdgesShape<SerializedEdgesOnlyVertexExport<PersonVertex>>;\n const nonEdges = omitEdgesAndInternalProperties(x, edges);\n\n return { ...nonEdges, ...edges };\n });\n};\n"],"mappings":";;;;AAOA,uBACE,SACA,YACsB;AACtB,QAAO,QACJ,KAAI,MAAK;EACR,MAAMA,QAAuD,EAC3D,OAAO,EAAE,QAAQ,YAAY,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"persons.js","names":["edges: SerializedEdgesOnlyVertexExport<PersonVertex>"],"sources":["../../../src/core/to/persons.ts"],"sourcesContent":["import type { Types } from '../types';\nimport type { OutTypes } from './schedules';\nimport { getVertexId } from '../util';\nimport { omitEdgesAndInternalProperties, type SerializedEdgesOnlyVertexExport, type SerializedEdgesShape } from './util';\nimport type { BaseOptions } from '../../common/types';\nimport type { PersonVertex } from '../interfaces/vertices/persons';\n\nexport default (\n persons: Types.Mixed.Person[],\n options: BaseOptions\n): OutTypes.person[] => {\n return persons\n .map(x => {\n const edges: SerializedEdgesOnlyVertexExport<PersonVertex> = {\n group: x.group ? getVertexId(x.group, options) : undefined,\n } satisfies SerializedEdgesShape<SerializedEdgesOnlyVertexExport<PersonVertex>>;\n const nonEdges = omitEdgesAndInternalProperties(x, edges);\n\n return { ...nonEdges, ...edges };\n });\n};\n"],"mappings":";;;;AAOA,uBACE,SACA,YACsB;AACtB,QAAO,QACJ,KAAI,MAAK;EACR,MAAMA,QAAuD,EAC3D,OAAO,EAAE,QAAQ,YAAY,EAAE,OAAO,QAAQ,GAAG,QAClD;AAGD,SAAO;GAAE,GAFQ,+BAA+B,GAAG,MAAM;GAEnC,GAAG;GAAO;GAChC"}
|
|
@@ -4,9 +4,8 @@ import { omitEdgesAndInternalProperties } from "./util.js";
|
|
|
4
4
|
var root_intervals_default = (rootIntervals, options) => {
|
|
5
5
|
return rootIntervals.map((x) => {
|
|
6
6
|
const edges = {};
|
|
7
|
-
const nonEdges = omitEdgesAndInternalProperties(x, edges);
|
|
8
7
|
return {
|
|
9
|
-
...
|
|
8
|
+
...omitEdgesAndInternalProperties(x, edges),
|
|
10
9
|
...edges
|
|
11
10
|
};
|
|
12
11
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"root-intervals.js","names":["edges: SerializedEdgesOnlyVertexExport<RootIntervalVertex>"],"sources":["../../../src/core/to/root-intervals.ts"],"sourcesContent":["import type { Types } from '../types';\nimport type { OutTypes } from './schedules';\nimport { omitEdgesAndInternalProperties, type SerializedEdgesOnlyVertexExport, type SerializedEdgesShape } from './util';\nimport type { BaseOptions } from '../../common/types';\nimport type { RootIntervalVertex } from '../interfaces/vertices/root-intervals';\n\nexport default (\n rootIntervals: Types.Mixed.RootInterval[],\n options: BaseOptions\n): OutTypes.rootInterval[] => {\n return rootIntervals\n .map(x => {\n const edges: SerializedEdgesOnlyVertexExport<RootIntervalVertex> = {\n } satisfies SerializedEdgesShape<SerializedEdgesOnlyVertexExport<RootIntervalVertex>>;\n const nonEdges = omitEdgesAndInternalProperties(x, edges);\n\n return { ...nonEdges, ...edges };\n });\n};\n"],"mappings":";;;AAMA,8BACE,eACA,YAC4B;AAC5B,QAAO,cACJ,KAAI,MAAK;EACR,MAAMA,QAA6D;
|
|
1
|
+
{"version":3,"file":"root-intervals.js","names":["edges: SerializedEdgesOnlyVertexExport<RootIntervalVertex>"],"sources":["../../../src/core/to/root-intervals.ts"],"sourcesContent":["import type { Types } from '../types';\nimport type { OutTypes } from './schedules';\nimport { omitEdgesAndInternalProperties, type SerializedEdgesOnlyVertexExport, type SerializedEdgesShape } from './util';\nimport type { BaseOptions } from '../../common/types';\nimport type { RootIntervalVertex } from '../interfaces/vertices/root-intervals';\n\nexport default (\n rootIntervals: Types.Mixed.RootInterval[],\n options: BaseOptions\n): OutTypes.rootInterval[] => {\n return rootIntervals\n .map(x => {\n const edges: SerializedEdgesOnlyVertexExport<RootIntervalVertex> = {\n } satisfies SerializedEdgesShape<SerializedEdgesOnlyVertexExport<RootIntervalVertex>>;\n const nonEdges = omitEdgesAndInternalProperties(x, edges);\n\n return { ...nonEdges, ...edges };\n });\n};\n"],"mappings":";;;AAMA,8BACE,eACA,YAC4B;AAC5B,QAAO,cACJ,KAAI,MAAK;EACR,MAAMA,QAA6D,EAClE;AAGD,SAAO;GAAE,GAFQ,+BAA+B,GAAG,MAAM;GAEnC,GAAG;GAAO;GAChC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schedules.js","names":["options: BaseOptions","_division","_settings","_exceptions","_periods","_locations","_teachers","_groups","_persons","_courses","_events","_lockedTimes","_overlapGroups","_rootIntervals","_syllabuses","_configurations"],"sources":["../../../src/core/to/schedules.ts"],"sourcesContent":["import type { CoreTypes } from '../';\nimport _exceptions from './exceptions';\nimport _periods from './periods';\nimport _locations from './locations';\nimport _teachers from './teachers';\nimport _groups from './groups';\nimport _persons from './persons';\nimport _courses from './courses';\nimport _events from './events';\nimport _lockedTimes from './locked-times';\nimport _overlapGroups from './overlap-groups';\nimport _rootIntervals from './root-intervals';\nimport _settings from './settings';\nimport _division from './division';\nimport _syllabuses from './syllabuses';\nimport _configurations from './configurations';\nimport type { InternalIdKey } from '../types/common';\nimport type { InternalKeysOmitted } from './util';\nimport type { BaseOptions } from '../../common/types';\n\nexport namespace OutTypes {\n export type division = Omit<InternalKeysOmitted<CoreTypes.Serialized.Division>, InternalIdKey>;\n export type settings = InternalKeysOmitted<CoreTypes.Serialized.Settings>;\n export type configuration = InternalKeysOmitted<CoreTypes.Serialized.Configuration>;\n export type exception = InternalKeysOmitted<CoreTypes.Serialized.Exception>;\n export type period = InternalKeysOmitted<CoreTypes.Serialized.Period>;\n export type location = InternalKeysOmitted<CoreTypes.Serialized.Location>;\n export type teacher = InternalKeysOmitted<CoreTypes.Serialized.Teacher>;\n export type group = InternalKeysOmitted<CoreTypes.Serialized.Group>;\n export type person = InternalKeysOmitted<CoreTypes.Serialized.Person>;\n export type course = InternalKeysOmitted<CoreTypes.Serialized.Course>;\n export type event = InternalKeysOmitted<CoreTypes.Serialized.Event>;\n export type lockedTime = InternalKeysOmitted<CoreTypes.Serialized.LockedTime>;\n export type overlapGroup = InternalKeysOmitted<CoreTypes.Serialized.OverlapGroup>;\n export type rootInterval = InternalKeysOmitted<CoreTypes.Serialized.RootInterval>;\n export type syllabus = InternalKeysOmitted<CoreTypes.Serialized.Syllabus>;\n}\n\ntype Out = {\n division?: OutTypes.division;\n settings?: OutTypes.settings;\n exceptions?: OutTypes.exception[];\n periods?: OutTypes.period[];\n locations?: OutTypes.location[];\n teachers?: OutTypes.teacher[];\n groups?: OutTypes.group[];\n persons?: OutTypes.person[];\n courses?: OutTypes.course[];\n events?: OutTypes.event[];\n lockedTimes?: OutTypes.lockedTime[];\n overlapGroups?: OutTypes.overlapGroup[];\n rootIntervals?: OutTypes.rootInterval[];\n syllabuses?: OutTypes.syllabus[];\n configurations?: OutTypes.configuration[];\n\n meta: { structure: string };\n};\n\nexport default function (\n schedule: Partial<CoreTypes.Mixed.Schedule>\n): Out {\n const options: BaseOptions = {};\n\n return {\n meta: { structure: 'RS/core-2.0.0' },\n ...schedule.divisions && { division: _division (schedule.divisions, options) },\n ...schedule.settings && { settings: _settings (schedule.settings, options) },\n ...schedule.exceptions && { exceptions: _exceptions (schedule.exceptions, options) },\n ...schedule.periods && { periods: _periods (schedule.periods, options) },\n ...schedule.locations && { locations: _locations (schedule.locations, options) },\n ...schedule.teachers && { teachers: _teachers (schedule.teachers, options) },\n ...schedule.groups && { groups: _groups (schedule.groups, options) },\n ...schedule.persons && { persons: _persons (schedule.persons, options) },\n ...schedule.courses && { courses: _courses (schedule.courses, options) },\n ...schedule.events && { events: _events (schedule.events, options) },\n ...schedule.lockedTimes && { lockedTimes: _lockedTimes (schedule.lockedTimes, options) },\n ...schedule.overlapGroups && { overlapGroups: _overlapGroups (schedule.overlapGroups, options) },\n ...schedule.rootIntervals && { rootIntervals: _rootIntervals (schedule.rootIntervals, options) },\n ...schedule.syllabuses && { syllabuses: _syllabuses (schedule.syllabuses, options) },\n ...schedule.configurations && { configurations: _configurations(schedule.configurations, options) },\n };\n}"],"mappings":";;;;;;;;;;;;;;;;;AA0DA,2BACE,UACK;CACL,MAAMA,UAAuB;
|
|
1
|
+
{"version":3,"file":"schedules.js","names":["options: BaseOptions","_division","_settings","_exceptions","_periods","_locations","_teachers","_groups","_persons","_courses","_events","_lockedTimes","_overlapGroups","_rootIntervals","_syllabuses","_configurations"],"sources":["../../../src/core/to/schedules.ts"],"sourcesContent":["import type { CoreTypes } from '../';\nimport _exceptions from './exceptions';\nimport _periods from './periods';\nimport _locations from './locations';\nimport _teachers from './teachers';\nimport _groups from './groups';\nimport _persons from './persons';\nimport _courses from './courses';\nimport _events from './events';\nimport _lockedTimes from './locked-times';\nimport _overlapGroups from './overlap-groups';\nimport _rootIntervals from './root-intervals';\nimport _settings from './settings';\nimport _division from './division';\nimport _syllabuses from './syllabuses';\nimport _configurations from './configurations';\nimport type { InternalIdKey } from '../types/common';\nimport type { InternalKeysOmitted } from './util';\nimport type { BaseOptions } from '../../common/types';\n\nexport namespace OutTypes {\n export type division = Omit<InternalKeysOmitted<CoreTypes.Serialized.Division>, InternalIdKey>;\n export type settings = InternalKeysOmitted<CoreTypes.Serialized.Settings>;\n export type configuration = InternalKeysOmitted<CoreTypes.Serialized.Configuration>;\n export type exception = InternalKeysOmitted<CoreTypes.Serialized.Exception>;\n export type period = InternalKeysOmitted<CoreTypes.Serialized.Period>;\n export type location = InternalKeysOmitted<CoreTypes.Serialized.Location>;\n export type teacher = InternalKeysOmitted<CoreTypes.Serialized.Teacher>;\n export type group = InternalKeysOmitted<CoreTypes.Serialized.Group>;\n export type person = InternalKeysOmitted<CoreTypes.Serialized.Person>;\n export type course = InternalKeysOmitted<CoreTypes.Serialized.Course>;\n export type event = InternalKeysOmitted<CoreTypes.Serialized.Event>;\n export type lockedTime = InternalKeysOmitted<CoreTypes.Serialized.LockedTime>;\n export type overlapGroup = InternalKeysOmitted<CoreTypes.Serialized.OverlapGroup>;\n export type rootInterval = InternalKeysOmitted<CoreTypes.Serialized.RootInterval>;\n export type syllabus = InternalKeysOmitted<CoreTypes.Serialized.Syllabus>;\n}\n\ntype Out = {\n division?: OutTypes.division;\n settings?: OutTypes.settings;\n exceptions?: OutTypes.exception[];\n periods?: OutTypes.period[];\n locations?: OutTypes.location[];\n teachers?: OutTypes.teacher[];\n groups?: OutTypes.group[];\n persons?: OutTypes.person[];\n courses?: OutTypes.course[];\n events?: OutTypes.event[];\n lockedTimes?: OutTypes.lockedTime[];\n overlapGroups?: OutTypes.overlapGroup[];\n rootIntervals?: OutTypes.rootInterval[];\n syllabuses?: OutTypes.syllabus[];\n configurations?: OutTypes.configuration[];\n\n meta: { structure: string };\n};\n\nexport default function (\n schedule: Partial<CoreTypes.Mixed.Schedule>\n): Out {\n const options: BaseOptions = {};\n\n return {\n meta: { structure: 'RS/core-2.0.0' },\n ...schedule.divisions && { division: _division (schedule.divisions, options) },\n ...schedule.settings && { settings: _settings (schedule.settings, options) },\n ...schedule.exceptions && { exceptions: _exceptions (schedule.exceptions, options) },\n ...schedule.periods && { periods: _periods (schedule.periods, options) },\n ...schedule.locations && { locations: _locations (schedule.locations, options) },\n ...schedule.teachers && { teachers: _teachers (schedule.teachers, options) },\n ...schedule.groups && { groups: _groups (schedule.groups, options) },\n ...schedule.persons && { persons: _persons (schedule.persons, options) },\n ...schedule.courses && { courses: _courses (schedule.courses, options) },\n ...schedule.events && { events: _events (schedule.events, options) },\n ...schedule.lockedTimes && { lockedTimes: _lockedTimes (schedule.lockedTimes, options) },\n ...schedule.overlapGroups && { overlapGroups: _overlapGroups (schedule.overlapGroups, options) },\n ...schedule.rootIntervals && { rootIntervals: _rootIntervals (schedule.rootIntervals, options) },\n ...schedule.syllabuses && { syllabuses: _syllabuses (schedule.syllabuses, options) },\n ...schedule.configurations && { configurations: _configurations(schedule.configurations, options) },\n };\n}"],"mappings":";;;;;;;;;;;;;;;;;AA0DA,2BACE,UACK;CACL,MAAMA,UAAuB,EAAE;AAE/B,QAAO;EACL,MAAM,EAAE,WAAW,iBAAiB;EACpC,GAAG,SAAS,aAAkB,EAAE,UAAgBC,iBAAgB,SAAS,WAAgB,QAAQ,EAAE;EACnG,GAAG,SAAS,YAAkB,EAAE,UAAgBC,iBAAgB,SAAS,UAAgB,QAAQ,EAAE;EACnG,GAAG,SAAS,cAAkB,EAAE,YAAgBC,mBAAgB,SAAS,YAAgB,QAAQ,EAAE;EACnG,GAAG,SAAS,WAAkB,EAAE,SAAgBC,gBAAgB,SAAS,SAAgB,QAAQ,EAAE;EACnG,GAAG,SAAS,aAAkB,EAAE,WAAgBC,kBAAgB,SAAS,WAAgB,QAAQ,EAAE;EACnG,GAAG,SAAS,YAAkB,EAAE,UAAgBC,iBAAgB,SAAS,UAAgB,QAAQ,EAAE;EACnG,GAAG,SAAS,UAAkB,EAAE,QAAgBC,eAAgB,SAAS,QAAgB,QAAQ,EAAE;EACnG,GAAG,SAAS,WAAkB,EAAE,SAAgBC,gBAAgB,SAAS,SAAgB,QAAQ,EAAE;EACnG,GAAG,SAAS,WAAkB,EAAE,SAAgBC,gBAAgB,SAAS,SAAgB,QAAQ,EAAE;EACnG,GAAG,SAAS,UAAkB,EAAE,QAAgBC,eAAgB,SAAS,QAAgB,QAAQ,EAAE;EACnG,GAAG,SAAS,eAAkB,EAAE,aAAgBC,qBAAgB,SAAS,aAAgB,QAAQ,EAAE;EACnG,GAAG,SAAS,iBAAkB,EAAE,eAAgBC,uBAAgB,SAAS,eAAgB,QAAQ,EAAE;EACnG,GAAG,SAAS,iBAAkB,EAAE,eAAgBC,uBAAgB,SAAS,eAAgB,QAAQ,EAAE;EACnG,GAAG,SAAS,cAAkB,EAAE,YAAgBC,mBAAgB,SAAS,YAAgB,QAAQ,EAAE;EACnG,GAAG,SAAS,kBAAkB,EAAE,gBAAgBC,uBAAgB,SAAS,gBAAgB,QAAQ,EAAE;EACpG"}
|
package/dist/core/to/settings.js
CHANGED
|
@@ -7,9 +7,8 @@ var settings_default = (settings, options) => {
|
|
|
7
7
|
period: settings.period ? getVertexId(settings.period, options) : void 0,
|
|
8
8
|
defaultRootInterval: settings.defaultRootInterval ? getVertexId(settings.defaultRootInterval, options) : void 0
|
|
9
9
|
};
|
|
10
|
-
const nonEdges = omitEdgesAndInternalProperties(settings, edges);
|
|
11
10
|
return {
|
|
12
|
-
...
|
|
11
|
+
...omitEdgesAndInternalProperties(settings, edges),
|
|
13
12
|
...edges
|
|
14
13
|
};
|
|
15
14
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.js","names":["edges: SerializedEdgesOnlyVertexExport<DivisionSettingsVertex>"],"sources":["../../../src/core/to/settings.ts"],"sourcesContent":["import type { BaseOptions } from '../../common/types';\nimport type { DivisionSettingsVertex } from '../interfaces/vertices/division-settings';\nimport type { Types } from '../types';\nimport { getVertexId } from '../util';\nimport type { OutTypes } from './schedules';\nimport { omitEdgesAndInternalProperties, type SerializedEdgesOnlyVertexExport, type SerializedEdgesShape } from './util';\n\nexport default (\n settings: Types.Mixed.Settings,\n options: BaseOptions\n): OutTypes.settings => {\n const edges: SerializedEdgesOnlyVertexExport<DivisionSettingsVertex> = {\n period: settings.period ? getVertexId(settings.period, options) : undefined,\n defaultRootInterval: settings.defaultRootInterval ? getVertexId(settings.defaultRootInterval, options) : undefined,\n } satisfies SerializedEdgesShape<SerializedEdgesOnlyVertexExport<DivisionSettingsVertex>>;\n const nonEdges = omitEdgesAndInternalProperties(settings, edges);\n\n return { ...nonEdges, ...edges };\n};\n"],"mappings":";;;;AAOA,wBACE,UACA,YACsB;CACtB,MAAMA,QAAiE;EACrE,QAAqB,SAAS,SAAsB,YAAY,SAAS,QAAqB,
|
|
1
|
+
{"version":3,"file":"settings.js","names":["edges: SerializedEdgesOnlyVertexExport<DivisionSettingsVertex>"],"sources":["../../../src/core/to/settings.ts"],"sourcesContent":["import type { BaseOptions } from '../../common/types';\nimport type { DivisionSettingsVertex } from '../interfaces/vertices/division-settings';\nimport type { Types } from '../types';\nimport { getVertexId } from '../util';\nimport type { OutTypes } from './schedules';\nimport { omitEdgesAndInternalProperties, type SerializedEdgesOnlyVertexExport, type SerializedEdgesShape } from './util';\n\nexport default (\n settings: Types.Mixed.Settings,\n options: BaseOptions\n): OutTypes.settings => {\n const edges: SerializedEdgesOnlyVertexExport<DivisionSettingsVertex> = {\n period: settings.period ? getVertexId(settings.period, options) : undefined,\n defaultRootInterval: settings.defaultRootInterval ? getVertexId(settings.defaultRootInterval, options) : undefined,\n } satisfies SerializedEdgesShape<SerializedEdgesOnlyVertexExport<DivisionSettingsVertex>>;\n const nonEdges = omitEdgesAndInternalProperties(settings, edges);\n\n return { ...nonEdges, ...edges };\n};\n"],"mappings":";;;;AAOA,wBACE,UACA,YACsB;CACtB,MAAMA,QAAiE;EACrE,QAAqB,SAAS,SAAsB,YAAY,SAAS,QAAqB,QAAQ,GAAG;EACzG,qBAAqB,SAAS,sBAAsB,YAAY,SAAS,qBAAqB,QAAQ,GAAG;EAC1G;AAGD,QAAO;EAAE,GAFQ,+BAA+B,UAAU,MAAM;EAE1C,GAAG;EAAO"}
|
|
@@ -4,9 +4,8 @@ import { omitEdgesAndInternalProperties } from "./util.js";
|
|
|
4
4
|
var syllabuses_default = (syllabuses, options) => {
|
|
5
5
|
return syllabuses.map((x) => {
|
|
6
6
|
const edges = {};
|
|
7
|
-
const nonEdges = omitEdgesAndInternalProperties(x, edges);
|
|
8
7
|
return {
|
|
9
|
-
...
|
|
8
|
+
...omitEdgesAndInternalProperties(x, edges),
|
|
10
9
|
...edges
|
|
11
10
|
};
|
|
12
11
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"syllabuses.js","names":["edges: SerializedEdgesOnlyVertexExport<SyllabusVertex>"],"sources":["../../../src/core/to/syllabuses.ts"],"sourcesContent":["import type { Types } from '../types';\nimport type { BaseOptions } from '../../common/types';\nimport { omitEdgesAndInternalProperties, type SerializedEdgesOnlyVertexExport, type SerializedEdgesShape } from './util';\nimport type { SyllabusVertex } from '../interfaces/vertices/syllabuses';\nimport type { OutTypes } from './schedules';\n\nexport default (\n syllabuses: Types.Mixed.Syllabus[],\n options: BaseOptions\n): OutTypes.syllabus[] => {\n return syllabuses\n .map(x => {\n const edges: SerializedEdgesOnlyVertexExport<SyllabusVertex> = {\n } satisfies SerializedEdgesShape<SerializedEdgesOnlyVertexExport<SyllabusVertex>>;\n const nonEdges = omitEdgesAndInternalProperties(x, edges);\n\n return { ...nonEdges, ...edges };\n });\n};\n"],"mappings":";;;AAMA,0BACE,YACA,YACwB;AACxB,QAAO,WACJ,KAAI,MAAK;EACR,MAAMA,QAAyD;
|
|
1
|
+
{"version":3,"file":"syllabuses.js","names":["edges: SerializedEdgesOnlyVertexExport<SyllabusVertex>"],"sources":["../../../src/core/to/syllabuses.ts"],"sourcesContent":["import type { Types } from '../types';\nimport type { BaseOptions } from '../../common/types';\nimport { omitEdgesAndInternalProperties, type SerializedEdgesOnlyVertexExport, type SerializedEdgesShape } from './util';\nimport type { SyllabusVertex } from '../interfaces/vertices/syllabuses';\nimport type { OutTypes } from './schedules';\n\nexport default (\n syllabuses: Types.Mixed.Syllabus[],\n options: BaseOptions\n): OutTypes.syllabus[] => {\n return syllabuses\n .map(x => {\n const edges: SerializedEdgesOnlyVertexExport<SyllabusVertex> = {\n } satisfies SerializedEdgesShape<SerializedEdgesOnlyVertexExport<SyllabusVertex>>;\n const nonEdges = omitEdgesAndInternalProperties(x, edges);\n\n return { ...nonEdges, ...edges };\n });\n};\n"],"mappings":";;;AAMA,0BACE,YACA,YACwB;AACxB,QAAO,WACJ,KAAI,MAAK;EACR,MAAMA,QAAyD,EAC9D;AAGD,SAAO;GAAE,GAFQ,+BAA+B,GAAG,MAAM;GAEnC,GAAG;GAAO;GAChC"}
|
package/dist/core/to/teachers.js
CHANGED
|
@@ -12,9 +12,8 @@ var teachers_default = (teachers, options) => {
|
|
|
12
12
|
lunch: x.lunch?.map((x$1) => getVertexId(x$1, options)),
|
|
13
13
|
complementaryTimes: x.complementaryTimes?.map((x$1) => getVertexId(x$1, options))
|
|
14
14
|
};
|
|
15
|
-
const nonEdges = omitEdgesAndInternalProperties(x, edges);
|
|
16
15
|
return {
|
|
17
|
-
...
|
|
16
|
+
...omitEdgesAndInternalProperties(x, edges),
|
|
18
17
|
...edges
|
|
19
18
|
};
|
|
20
19
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"teachers.js","names":["edges: SerializedEdgesOnlyVertexExport<TeacherVertex>","x"],"sources":["../../../src/core/to/teachers.ts"],"sourcesContent":["import type { Types } from '../types';\nimport type { OutTypes } from './schedules';\nimport { getVertexId } from '../util';\nimport { omitEdgesAndInternalProperties, type SerializedEdgesOnlyVertexExport, type SerializedEdgesShape } from './util';\nimport type { BaseOptions } from '../../common/types';\nimport type { TeacherVertex } from '../interfaces/vertices/teachers';\n\nexport default (\n teachers: Types.Mixed.Teacher[],\n options: BaseOptions\n): OutTypes.teacher[] => {\n return teachers\n .map(x => {\n const edges: SerializedEdgesOnlyVertexExport<TeacherVertex> = {\n rootInterval: x.rootInterval ? getVertexId(x.rootInterval, options) : undefined,\n person: x.person ? getVertexId(x.person, options) : undefined,\n exceptions: x.exceptions ?.map(x => getVertexId(x, options)),\n lockedTimes: x.lockedTimes ?.map(x => getVertexId(x, options)),\n lunch: x.lunch ?.map(x => getVertexId(x, options)),\n complementaryTimes: x.complementaryTimes?.map(x => getVertexId(x, options)),\n } satisfies SerializedEdgesShape<SerializedEdgesOnlyVertexExport<TeacherVertex>>;\n const nonEdges = omitEdgesAndInternalProperties(x, edges);\n\n return { ...nonEdges, ...edges };\n });\n};\n"],"mappings":";;;;AAOA,wBACE,UACA,YACuB;AACvB,QAAO,SACJ,KAAI,MAAK;EACR,MAAMA,QAAwD;GAC5D,cAAoB,EAAE,eAAe,YAAY,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"teachers.js","names":["edges: SerializedEdgesOnlyVertexExport<TeacherVertex>","x"],"sources":["../../../src/core/to/teachers.ts"],"sourcesContent":["import type { Types } from '../types';\nimport type { OutTypes } from './schedules';\nimport { getVertexId } from '../util';\nimport { omitEdgesAndInternalProperties, type SerializedEdgesOnlyVertexExport, type SerializedEdgesShape } from './util';\nimport type { BaseOptions } from '../../common/types';\nimport type { TeacherVertex } from '../interfaces/vertices/teachers';\n\nexport default (\n teachers: Types.Mixed.Teacher[],\n options: BaseOptions\n): OutTypes.teacher[] => {\n return teachers\n .map(x => {\n const edges: SerializedEdgesOnlyVertexExport<TeacherVertex> = {\n rootInterval: x.rootInterval ? getVertexId(x.rootInterval, options) : undefined,\n person: x.person ? getVertexId(x.person, options) : undefined,\n exceptions: x.exceptions ?.map(x => getVertexId(x, options)),\n lockedTimes: x.lockedTimes ?.map(x => getVertexId(x, options)),\n lunch: x.lunch ?.map(x => getVertexId(x, options)),\n complementaryTimes: x.complementaryTimes?.map(x => getVertexId(x, options)),\n } satisfies SerializedEdgesShape<SerializedEdgesOnlyVertexExport<TeacherVertex>>;\n const nonEdges = omitEdgesAndInternalProperties(x, edges);\n\n return { ...nonEdges, ...edges };\n });\n};\n"],"mappings":";;;;AAOA,wBACE,UACA,YACuB;AACvB,QAAO,SACJ,KAAI,MAAK;EACR,MAAMA,QAAwD;GAC5D,cAAoB,EAAE,eAAe,YAAY,EAAE,cAAc,QAAQ,GAAG;GAC5E,QAAoB,EAAE,SAAe,YAAY,EAAE,QAAc,QAAQ,GAAG;GAC5E,YAAoB,EAAE,YAAoB,KAAI,QAAK,YAAYC,KAAG,QAAQ,CAAC;GAC3E,aAAoB,EAAE,aAAoB,KAAI,QAAK,YAAYA,KAAG,QAAQ,CAAC;GAC3E,OAAoB,EAAE,OAAoB,KAAI,QAAK,YAAYA,KAAG,QAAQ,CAAC;GAC3E,oBAAoB,EAAE,oBAAoB,KAAI,QAAK,YAAYA,KAAG,QAAQ,CAAC;GAC5E;AAGD,SAAO;GAAE,GAFQ,+BAA+B,GAAG,MAAM;GAEnC,GAAG;GAAO;GAChC"}
|
package/dist/core/to/util.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { Intersect } from "../../common/types.js";
|
|
2
|
+
import "../interfaces/vertices/util/common.js";
|
|
3
|
+
import "../interfaces/vertices/util/index.js";
|
|
2
4
|
|
|
3
5
|
//#region src/core/to/util.d.ts
|
|
4
6
|
declare const keys: readonly ["_id", "createdAt", "updatedAt", "lastModifiedBy", "CONTEXT", "belongsTo", "domain", "derivedParentGroups"];
|
package/dist/core/to/util.js
CHANGED
|
@@ -16,8 +16,7 @@ const keys = [
|
|
|
16
16
|
* The output type also omits all edges for ease of use.
|
|
17
17
|
*/
|
|
18
18
|
function omitEdgesAndInternalProperties(v, edgesRecord) {
|
|
19
|
-
|
|
20
|
-
return omit(a, keys);
|
|
19
|
+
return omit(omit(v, Object.keys(edgesRecord)), keys);
|
|
21
20
|
}
|
|
22
21
|
|
|
23
22
|
//#endregion
|
package/dist/core/to/util.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","names":[],"sources":["../../../src/core/to/util.ts"],"sourcesContent":["import type { Intersect } from '../../common/types';\nimport type { Collection, SerializedVertexExport, Vertex } from '../interfaces/vertices/util';\nimport type { PickEdges } from '../interfaces/vertices/util/common';\nimport { omit } from 'lodash-es';\n\n\nconst keys = ['_id', 'createdAt', 'updatedAt', 'lastModifiedBy', 'CONTEXT', 'belongsTo', 'domain', 'derivedParentGroups'] as const;\nexport type InternalKeysOmitted<V extends object> = Omit<Intersect<V>, typeof keys[number]>;\n\nexport type SerializedEdgesOnlyVertexExport<\n V extends Vertex<Collection>\n> = {\n [K in keyof SerializedVertexExport<V> as K extends keyof InternalKeysOmitted<PickEdges<V>> ? K : never]: SerializedVertexExport<V>[K]\n};\n\n/**\n * Used only as `satisfies` to ensure that no edge property is missing.\n */\nexport type SerializedEdgesShape<V extends object> = Record<keyof Omit<V, 'belongsTo'>, unknown>;\n\n/**\n * Returns a copy of the vertex with internal keys omitted, such as `_id`, `createdAt`, `updatedAt`, etc.\n * The output type also omits all edges for ease of use.\n */\nexport function omitEdgesAndInternalProperties <\n V extends object,\n EdgesRecord extends object\n> (v: V, edgesRecord: EdgesRecord) {\n const a = omit(v, Object.keys(edgesRecord)) as unknown as Omit<V, keyof EdgesRecord>;\n return omit(a, keys) as unknown as InternalKeysOmitted<typeof a>;\n}\n"],"mappings":";;;AAMA,MAAM,OAAQ;CAAC;CAAQ;CAAa;CAAa;CAAkB;CAAW;CAAa;CAAU
|
|
1
|
+
{"version":3,"file":"util.js","names":[],"sources":["../../../src/core/to/util.ts"],"sourcesContent":["import type { Intersect } from '../../common/types';\nimport type { Collection, SerializedVertexExport, Vertex } from '../interfaces/vertices/util';\nimport type { PickEdges } from '../interfaces/vertices/util/common';\nimport { omit } from 'lodash-es';\n\n\nconst keys = ['_id', 'createdAt', 'updatedAt', 'lastModifiedBy', 'CONTEXT', 'belongsTo', 'domain', 'derivedParentGroups'] as const;\nexport type InternalKeysOmitted<V extends object> = Omit<Intersect<V>, typeof keys[number]>;\n\nexport type SerializedEdgesOnlyVertexExport<\n V extends Vertex<Collection>\n> = {\n [K in keyof SerializedVertexExport<V> as K extends keyof InternalKeysOmitted<PickEdges<V>> ? K : never]: SerializedVertexExport<V>[K]\n};\n\n/**\n * Used only as `satisfies` to ensure that no edge property is missing.\n */\nexport type SerializedEdgesShape<V extends object> = Record<keyof Omit<V, 'belongsTo'>, unknown>;\n\n/**\n * Returns a copy of the vertex with internal keys omitted, such as `_id`, `createdAt`, `updatedAt`, etc.\n * The output type also omits all edges for ease of use.\n */\nexport function omitEdgesAndInternalProperties <\n V extends object,\n EdgesRecord extends object\n> (v: V, edgesRecord: EdgesRecord) {\n const a = omit(v, Object.keys(edgesRecord)) as unknown as Omit<V, keyof EdgesRecord>;\n return omit(a, keys) as unknown as InternalKeysOmitted<typeof a>;\n}\n"],"mappings":";;;AAMA,MAAM,OAAQ;CAAC;CAAQ;CAAa;CAAa;CAAkB;CAAW;CAAa;CAAU;CAAsB;;;;;AAkB3H,SAAgB,+BAGb,GAAM,aAA0B;AAEjC,QAAO,KADG,KAAK,GAAG,OAAO,KAAK,YAAY,CAAC,EAC5B,KAAK"}
|
|
@@ -3,6 +3,7 @@ import { Day } from "../interfaces/vertices/properties/days.js";
|
|
|
3
3
|
import { Interval } from "../interfaces/vertices/properties/intervals.js";
|
|
4
4
|
import { MinBreakLength } from "../interfaces/vertices/properties/min-break-length.js";
|
|
5
5
|
import { Deep, Mixed, MixedWithOptionalId, Serialized, SerializedWithOptionalId } from "../interfaces/vertices/index.js";
|
|
6
|
+
import "../interfaces/index.js";
|
|
6
7
|
|
|
7
8
|
//#region src/core/types/index.d.ts
|
|
8
9
|
declare namespace Types {
|
|
@@ -30,6 +31,7 @@ declare namespace Types {
|
|
|
30
31
|
type RootInterval = Deep.RootInterval;
|
|
31
32
|
type Syllabus = Deep.Syllabus;
|
|
32
33
|
type User = Deep.User;
|
|
34
|
+
type Thread = Deep.Thread;
|
|
33
35
|
type Schedule = Deep.Schedule;
|
|
34
36
|
}
|
|
35
37
|
namespace Serialized {
|
|
@@ -52,6 +54,7 @@ declare namespace Types {
|
|
|
52
54
|
type RootInterval = Serialized.RootInterval;
|
|
53
55
|
type Syllabus = Serialized.Syllabus;
|
|
54
56
|
type User = Serialized.User;
|
|
57
|
+
type Thread = Serialized.Thread;
|
|
55
58
|
type Schedule = Serialized.Schedule;
|
|
56
59
|
}
|
|
57
60
|
namespace Mixed {
|
|
@@ -74,6 +77,7 @@ declare namespace Types {
|
|
|
74
77
|
type RootInterval = Mixed.RootInterval;
|
|
75
78
|
type Syllabus = Mixed.Syllabus;
|
|
76
79
|
type User = Mixed.User;
|
|
80
|
+
type Thread = Mixed.Thread;
|
|
77
81
|
type Schedule = Mixed.Schedule;
|
|
78
82
|
}
|
|
79
83
|
namespace MixedWithoutInternalId {
|
|
@@ -96,6 +100,7 @@ declare namespace Types {
|
|
|
96
100
|
type RootInterval = MixedWithOptionalId.RootInterval;
|
|
97
101
|
type Syllabus = MixedWithOptionalId.Syllabus;
|
|
98
102
|
type User = MixedWithOptionalId.User;
|
|
103
|
+
type Thread = MixedWithOptionalId.Thread;
|
|
99
104
|
type Schedule = MixedWithOptionalId.Schedule;
|
|
100
105
|
}
|
|
101
106
|
namespace SerializedWithOptionalId {
|
|
@@ -118,6 +123,7 @@ declare namespace Types {
|
|
|
118
123
|
type RootInterval = SerializedWithOptionalId.RootInterval;
|
|
119
124
|
type Syllabus = SerializedWithOptionalId.Syllabus;
|
|
120
125
|
type User = SerializedWithOptionalId.User;
|
|
126
|
+
type Thread = SerializedWithOptionalId.Thread;
|
|
121
127
|
type Schedule = SerializedWithOptionalId.Schedule;
|
|
122
128
|
}
|
|
123
129
|
}
|
package/dist/core/util.js
CHANGED
|
@@ -24,8 +24,7 @@ function getVertexId(edge, _idKey) {
|
|
|
24
24
|
* Returns the day index in the range 0-6, where 0 is Monday and 6 is Sunday.
|
|
25
25
|
*/
|
|
26
26
|
function getDayIndex(value) {
|
|
27
|
-
|
|
28
|
-
return (day + 6) % 7;
|
|
27
|
+
return ((typeof value === "number" ? value : moment.utc(value).day()) + 6) % 7;
|
|
29
28
|
}
|
|
30
29
|
function parseDateInterval(interval, type) {
|
|
31
30
|
if (!interval.start) throw new Error(`(RS::To::validateInterval) The interval ${type ? `"${type}"` : ""} is missing a start time`);
|
package/dist/core/util.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","names":["MongooseTypes"],"sources":["../../src/core/util.ts"],"sourcesContent":["import moment from 'moment';\nimport { Types as MongooseTypes } from 'mongoose';\nimport type { IdKey } from './types/common';\nimport type { Vertex, Collection } from './interfaces/vertices/util';\nimport type { DateType } from '../common/types';\nimport type { Interval } from './interfaces';\nimport type { IDType, OmitInternalVertexKeys, PrivateIDType } from './interfaces/vertices/util/vertex';\n\n/**\n * Returns the ID key to use for vertices, which can be either `id`, `_id`, or `ids`.\n */\nexport function getIdKey ({ idKey }: { idKey?: IdKey }) {\n return idKey ?? 'id';\n}\n\n/**\n * Returns the ID of a vertex, which can be either `_id`, `id`, or `ids`.\n */\nexport function getVertexId (\n edge: IDType | PrivateIDType | Partial<OmitInternalVertexKeys<Vertex<Collection>>>,\n _idKey: IdKey | { idKey?: IdKey }\n): string {\n if (typeof edge === 'string') return edge;\n if (edge instanceof MongooseTypes.ObjectId) return edge.toString();\n\n const idKey = typeof _idKey === 'string' ? _idKey : getIdKey(_idKey);\n if (idKey == '_id' && idKey in edge && edge[idKey]) return edge[idKey].toString();\n if (idKey == 'id' && idKey in edge && edge[idKey]) return edge[idKey];\n if (idKey == 'ids' && idKey in edge && edge[idKey]) return edge[idKey];\n\n throw new Error(`Unable to get vertex ID \"${idKey}\" from edge: ${JSON.stringify(edge)}`);\n}\n\n\n/**\n * Returns the day index in the range 0-6, where 0 is Monday and 6 is Sunday.\n */\nexport function getDayIndex (value: DateType | number): number {\n const day = typeof value === 'number' ? value : moment.utc(value).day();\n return (day + 6) % 7;\n}\n\nexport function parseDateInterval (interval: Partial<Interval<DateType>>, type?: string): Interval<moment.Moment> {\n if (!interval.start) throw new Error(`(RS::To::validateInterval) The interval ${type ? `\"${type}\"` : ''} is missing a start time`);\n if (!interval.end ) throw new Error(`(RS::To::validateInterval) The interval ${type ? `\"${type}\"` : ''} is missing an end time`);\n\n const start = moment.utc(interval.start);\n const end = moment.utc(interval.end);\n if (!start.isValid()) throw new Error(`(RS::To::validateInterval) The interval ${type ? `\"${type}\"` : ''} has an invalid start time`);\n if (!end .isValid()) throw new Error(`(RS::To::validateInterval) The interval ${type ? `\"${type}\"` : ''} has an invalid end time`);\n\n if (end.isSameOrBefore(start)) throw new Error(`(RS::To::validateInterval) The interval ${type ? `\"${type}\"` : ''} is invalid: end time is before or equal to start time`);\n\n return { start, end };\n}"],"mappings":";;;;;;;AAWA,SAAgB,SAAU,EAAE,SAA4B;AACtD,QAAO,SAAS;;;;;AAMlB,SAAgB,YACd,MACA,QACQ;AACR,KAAI,OAAO,SAAS,SAAU,QAAO;AACrC,KAAI,gBAAgBA,MAAc,SAAU,QAAO,KAAK;
|
|
1
|
+
{"version":3,"file":"util.js","names":["MongooseTypes"],"sources":["../../src/core/util.ts"],"sourcesContent":["import moment from 'moment';\nimport { Types as MongooseTypes } from 'mongoose';\nimport type { IdKey } from './types/common';\nimport type { Vertex, Collection } from './interfaces/vertices/util';\nimport type { DateType } from '../common/types';\nimport type { Interval } from './interfaces';\nimport type { IDType, OmitInternalVertexKeys, PrivateIDType } from './interfaces/vertices/util/vertex';\n\n/**\n * Returns the ID key to use for vertices, which can be either `id`, `_id`, or `ids`.\n */\nexport function getIdKey ({ idKey }: { idKey?: IdKey }) {\n return idKey ?? 'id';\n}\n\n/**\n * Returns the ID of a vertex, which can be either `_id`, `id`, or `ids`.\n */\nexport function getVertexId (\n edge: IDType | PrivateIDType | Partial<OmitInternalVertexKeys<Vertex<Collection>>>,\n _idKey: IdKey | { idKey?: IdKey }\n): string {\n if (typeof edge === 'string') return edge;\n if (edge instanceof MongooseTypes.ObjectId) return edge.toString();\n\n const idKey = typeof _idKey === 'string' ? _idKey : getIdKey(_idKey);\n if (idKey == '_id' && idKey in edge && edge[idKey]) return edge[idKey].toString();\n if (idKey == 'id' && idKey in edge && edge[idKey]) return edge[idKey];\n if (idKey == 'ids' && idKey in edge && edge[idKey]) return edge[idKey];\n\n throw new Error(`Unable to get vertex ID \"${idKey}\" from edge: ${JSON.stringify(edge)}`);\n}\n\n\n/**\n * Returns the day index in the range 0-6, where 0 is Monday and 6 is Sunday.\n */\nexport function getDayIndex (value: DateType | number): number {\n const day = typeof value === 'number' ? value : moment.utc(value).day();\n return (day + 6) % 7;\n}\n\nexport function parseDateInterval (interval: Partial<Interval<DateType>>, type?: string): Interval<moment.Moment> {\n if (!interval.start) throw new Error(`(RS::To::validateInterval) The interval ${type ? `\"${type}\"` : ''} is missing a start time`);\n if (!interval.end ) throw new Error(`(RS::To::validateInterval) The interval ${type ? `\"${type}\"` : ''} is missing an end time`);\n\n const start = moment.utc(interval.start);\n const end = moment.utc(interval.end);\n if (!start.isValid()) throw new Error(`(RS::To::validateInterval) The interval ${type ? `\"${type}\"` : ''} has an invalid start time`);\n if (!end .isValid()) throw new Error(`(RS::To::validateInterval) The interval ${type ? `\"${type}\"` : ''} has an invalid end time`);\n\n if (end.isSameOrBefore(start)) throw new Error(`(RS::To::validateInterval) The interval ${type ? `\"${type}\"` : ''} is invalid: end time is before or equal to start time`);\n\n return { start, end };\n}"],"mappings":";;;;;;;AAWA,SAAgB,SAAU,EAAE,SAA4B;AACtD,QAAO,SAAS;;;;;AAMlB,SAAgB,YACd,MACA,QACQ;AACR,KAAI,OAAO,SAAS,SAAU,QAAO;AACrC,KAAI,gBAAgBA,MAAc,SAAU,QAAO,KAAK,UAAU;CAElE,MAAM,QAAQ,OAAO,WAAW,WAAW,SAAS,SAAS,OAAO;AACpE,KAAI,SAAS,SAAS,SAAS,QAAQ,KAAK,OAAQ,QAAO,KAAK,OAAO,UAAU;AACjF,KAAI,SAAS,QAAS,SAAS,QAAQ,KAAK,OAAQ,QAAO,KAAK;AAChE,KAAI,SAAS,SAAS,SAAS,QAAQ,KAAK,OAAQ,QAAO,KAAK;AAEhE,OAAM,IAAI,MAAM,4BAA4B,MAAM,eAAe,KAAK,UAAU,KAAK,GAAG;;;;;AAO1F,SAAgB,YAAa,OAAkC;AAE7D,UADY,OAAO,UAAU,WAAW,QAAQ,OAAO,IAAI,MAAM,CAAC,KAAK,IACzD,KAAK;;AAGrB,SAAgB,kBAAmB,UAAuC,MAAwC;AAChH,KAAI,CAAC,SAAS,MAAO,OAAM,IAAI,MAAM,2CAA2C,OAAO,IAAI,KAAK,KAAK,GAAG,0BAA0B;AAClI,KAAI,CAAC,SAAS,IAAO,OAAM,IAAI,MAAM,2CAA2C,OAAO,IAAI,KAAK,KAAK,GAAG,yBAAyB;CAEjI,MAAM,QAAQ,OAAO,IAAI,SAAS,MAAM;CACxC,MAAM,MAAQ,OAAO,IAAI,SAAS,IAAI;AACtC,KAAI,CAAC,MAAM,SAAS,CAAE,OAAM,IAAI,MAAM,2CAA2C,OAAO,IAAI,KAAK,KAAK,GAAG,4BAA4B;AACrI,KAAI,CAAC,IAAM,SAAS,CAAE,OAAM,IAAI,MAAM,2CAA2C,OAAO,IAAI,KAAK,KAAK,GAAG,0BAA0B;AAEnI,KAAI,IAAI,eAAe,MAAM,CAAE,OAAM,IAAI,MAAM,2CAA2C,OAAO,IAAI,KAAK,KAAK,GAAG,wDAAwD;AAE1K,QAAO;EAAE;EAAO;EAAK"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["SchoolSoft_structure: (keyof SchoolSoftFileTypes.event)[]","RSstructure"],"sources":["../../../src/identify/constants/index.ts"],"sourcesContent":["import { CoreMap } from '../../core';\nimport type { SchoolSoftFileTypes } from '../../SchoolSoft';\nimport { SchoolSoftMap } from '../../SchoolSoft';\nimport { PlanDigitalMap } from '../../PlanDigital';\nimport { AdmentumMap } from '../../Admentum';\nimport { IdunSoftMap } from '../../IdunSoft';\nimport { Skola24Map } from '../../Skola24';\nimport { RSMap } from '../../RS';\nimport { ExcelMap } from '../../Excel';\nimport { structure as RSstructure } from '../../RS/types/to';\n\n\nconst core_structure = {\n groups: ['id'],\n locations: ['id'],\n teachers: ['id'],\n courses: ['id', 'events', 'groups', 'subject', 'teachers'],\n};\n\nconst excel_structure = {\n meta: [['structure']],\n courses: [],\n groups: [],\n locations: [],\n};\n\nconst RS_structure = {\n events: ['output', 'coreData'],\n};\n\nconst Admentum_structure = {\n schools: ['url', 'id', 'unit_code', 'school_code', 'school_type', 'name'],\n schedule: ['url', 'id', 'school_id', 'school_year', 'start_date', 'end_date', 'start_time', 'end_time', 'is_active', 'archived_at'],\n rooms: ['url', 'id', 'school_id', 'name', 'category', 'capacity'],\n teachers: ['url', 'id', 'school_id', 'email', 'first_name', 'last_name', 'role', 'current_primary_group', 'account_id'],\n principals: ['url', 'id', 'school_id', 'email', 'first_name', 'last_name', 'role', 'current_primary_group', 'account_id'],\n courses: ['url', 'id', 'school_id', 'schedule_id', 'name', 'subject_code', 'start_date', 'end_date', 'teachers', 'gymnasium_course'],\n schedule_groups: ['url', 'id', 'eid', 'school_id', 'schedule', 'name', 'guid', 'teachers', 'users_primary_groups', 'subjects', 'courses'],\n primary_groups: ['url', 'id', 'eid', 'school_id', 'schedule', 'grade', 'name', 'guid', 'teachers', 'start_date', 'end_date', 'start_date_display', 'end_date_display'],\n schedule_events: ['url', 'id', 'eid', 'school_id', 'schedule_id', 'start_time', 'end_time', 'rooms', 'teachers', 'schedule_groups', 'primary_groups', 'weekly_interval'],\n schedule_event_instances: ['url', 'id', 'school_id', 'start_date', 'end_date', 'schedule_event'],\n lessons: ['url', 'id', 'school_id', 'date', 'info', 'teachers', 'room', 'weekday'],\n lesson_infos: ['url', 'id', 'eid', 'school_id', 'schedule_id', 'start', 'end', 'duration', 'room', 'subject', 'teachers', 'groups', 'weekly_interval'],\n};\n\nconst IdunSoft_structure = {\n Grupp: ['ID', 'Klassnamn'],\n Lärare: ['ID', 'Namn'],\n Rum: ['ID', 'Namn'],\n Ämne: ['Ämne', 'Betygskod'],\n Lektion: ['LektionID', 'Ämne', 'Starttid', 'Sluttid', 'Lektionslängd', 'LärareID', 'GruppID', 'RumID', 'VeckodagID']\n};\n\nconst Skola24_txt_structure = null;\n\nconst Skola24_mdb_structure = {\n unit_tblroom: [ 'PK', 'ID' ],\n school_tblsubject: [ 'PK', 'ID' ],\n school_tblteacher: [ 'PK', 'ID' ],\n school_tblgroup: [ 'PK', 'ID', 'bClass' ],\n school_tblplan: [ 'PK', 'FKSubject' ],\n school_tblcourse: [ ],\n school_tblschedule: [ 'PK', 'Length', 'StartTime', 'DayOfWeek', 'FKSubject', 'CalcActualWeeks' ],\n school_tblgroup_group: [ 'FKGroup', 'FKGroupCon' ],\n school_tblplan_period: [ 'FKPlan', 'FKPeriod' ],\n school_tblplan_teacher: [ 'FKPlan', 'FKTeacher' ],\n school_tblplan_group: [ 'FKPlan', 'FKGroup' ],\n unit_tblperiod_date: [ 'FKPeriod', 'StartDate', 'EndDate' ],\n school_tblschedule_period: [ 'FKSchedule', 'FKPeriod' ],\n school_tblschedule_teacher: [ 'FKSchedule', 'FKTeacher' ],\n school_tblschedule_group: [ 'FKSchedule', 'FKGroup' ],\n school_tblschedule_room: [ 'FKSchedule', 'FKRoom' ]\n};\n\n// this is only temporary\nconst PlanDigital_structure = {\n 'Perioder': [ 'Namn', 'Tidsenhet' ],\n 'Tabell Tjänstefördelning': [ 'Gruppnamn', 'Klass', 'Kurskod', 'Sign', 'Poäng', 'Anteckningar', 'Antal', 'Ämne', 'Kursnamn' ]\n};\n\nconst SchoolSoft_structure: (keyof SchoolSoftFileTypes.event)[] = [\n 'id',\n 'group',\n 'dayid',\n 'day',\n 'starttime',\n 'length',\n 'teacher',\n 'subject',\n 'room',\n 'period',\n 'inweek',\n 'exweek',\n 'exclass',\n 'realweeks'\n];\n\nexport const maps = [\n {\n structure: Skola24_txt_structure,\n matchType: 'string',\n name: 'Skola24 (txt)',\n map: Skola24Map.TXT,\n meta: { structure: '' }\n }, {\n structure: Admentum_structure,\n name: 'Admentum',\n map: AdmentumMap,\n meta: { structure: '' }\n }, {\n structure: SchoolSoft_structure,\n name: 'SchoolSoft',\n map: SchoolSoftMap,\n meta: { structure: '' }\n }, {\n structure: PlanDigital_structure,\n name: 'Plan Digital',\n map: PlanDigitalMap,\n meta: { structure: '' }\n }, {\n structure: IdunSoft_structure,\n name: 'IdunSoft',\n map: IdunSoftMap,\n meta: { structure: '' }\n }, {\n structure: Skola24_mdb_structure,\n name: 'Skola24 (mdb)',\n map: Skola24Map.MDB,\n meta: { structure: '' }\n }, {\n structure: RS_structure,\n name: 'Royal Schedule Algorithm',\n map: RSMap,\n meta: { structure: RSstructure }\n }, {\n // structure: core_structure,\n // name: 'Royal Schedule',\n // map: CoreMap.V1,\n // meta: { structure: 'RS/core-1.0.0' }\n // }, {\n structure: core_structure,\n name: 'Royal Schedule',\n map: CoreMap,\n meta: { structure: 'RS/core-2.0.0' }\n }, {\n structure: excel_structure,\n name: 'Royal Schedule Excel',\n map: ExcelMap.V1,\n meta: { structure: 'RS/Excel-1.0.0' }\n }, {\n structure: excel_structure,\n name: 'Royal Schedule Excel',\n map: ExcelMap.V2,\n meta: { structure: 'RS/Excel-2.0.0' }\n }\n] as const;"],"mappings":";;;;;;;;;;;AAYA,MAAM,iBAAiB;CACrB,QAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","names":["SchoolSoft_structure: (keyof SchoolSoftFileTypes.event)[]","RSstructure"],"sources":["../../../src/identify/constants/index.ts"],"sourcesContent":["import { CoreMap } from '../../core';\nimport type { SchoolSoftFileTypes } from '../../SchoolSoft';\nimport { SchoolSoftMap } from '../../SchoolSoft';\nimport { PlanDigitalMap } from '../../PlanDigital';\nimport { AdmentumMap } from '../../Admentum';\nimport { IdunSoftMap } from '../../IdunSoft';\nimport { Skola24Map } from '../../Skola24';\nimport { RSMap } from '../../RS';\nimport { ExcelMap } from '../../Excel';\nimport { structure as RSstructure } from '../../RS/types/to';\n\n\nconst core_structure = {\n groups: ['id'],\n locations: ['id'],\n teachers: ['id'],\n courses: ['id', 'events', 'groups', 'subject', 'teachers'],\n};\n\nconst excel_structure = {\n meta: [['structure']],\n courses: [],\n groups: [],\n locations: [],\n};\n\nconst RS_structure = {\n events: ['output', 'coreData'],\n};\n\nconst Admentum_structure = {\n schools: ['url', 'id', 'unit_code', 'school_code', 'school_type', 'name'],\n schedule: ['url', 'id', 'school_id', 'school_year', 'start_date', 'end_date', 'start_time', 'end_time', 'is_active', 'archived_at'],\n rooms: ['url', 'id', 'school_id', 'name', 'category', 'capacity'],\n teachers: ['url', 'id', 'school_id', 'email', 'first_name', 'last_name', 'role', 'current_primary_group', 'account_id'],\n principals: ['url', 'id', 'school_id', 'email', 'first_name', 'last_name', 'role', 'current_primary_group', 'account_id'],\n courses: ['url', 'id', 'school_id', 'schedule_id', 'name', 'subject_code', 'start_date', 'end_date', 'teachers', 'gymnasium_course'],\n schedule_groups: ['url', 'id', 'eid', 'school_id', 'schedule', 'name', 'guid', 'teachers', 'users_primary_groups', 'subjects', 'courses'],\n primary_groups: ['url', 'id', 'eid', 'school_id', 'schedule', 'grade', 'name', 'guid', 'teachers', 'start_date', 'end_date', 'start_date_display', 'end_date_display'],\n schedule_events: ['url', 'id', 'eid', 'school_id', 'schedule_id', 'start_time', 'end_time', 'rooms', 'teachers', 'schedule_groups', 'primary_groups', 'weekly_interval'],\n schedule_event_instances: ['url', 'id', 'school_id', 'start_date', 'end_date', 'schedule_event'],\n lessons: ['url', 'id', 'school_id', 'date', 'info', 'teachers', 'room', 'weekday'],\n lesson_infos: ['url', 'id', 'eid', 'school_id', 'schedule_id', 'start', 'end', 'duration', 'room', 'subject', 'teachers', 'groups', 'weekly_interval'],\n};\n\nconst IdunSoft_structure = {\n Grupp: ['ID', 'Klassnamn'],\n Lärare: ['ID', 'Namn'],\n Rum: ['ID', 'Namn'],\n Ämne: ['Ämne', 'Betygskod'],\n Lektion: ['LektionID', 'Ämne', 'Starttid', 'Sluttid', 'Lektionslängd', 'LärareID', 'GruppID', 'RumID', 'VeckodagID']\n};\n\nconst Skola24_txt_structure = null;\n\nconst Skola24_mdb_structure = {\n unit_tblroom: [ 'PK', 'ID' ],\n school_tblsubject: [ 'PK', 'ID' ],\n school_tblteacher: [ 'PK', 'ID' ],\n school_tblgroup: [ 'PK', 'ID', 'bClass' ],\n school_tblplan: [ 'PK', 'FKSubject' ],\n school_tblcourse: [ ],\n school_tblschedule: [ 'PK', 'Length', 'StartTime', 'DayOfWeek', 'FKSubject', 'CalcActualWeeks' ],\n school_tblgroup_group: [ 'FKGroup', 'FKGroupCon' ],\n school_tblplan_period: [ 'FKPlan', 'FKPeriod' ],\n school_tblplan_teacher: [ 'FKPlan', 'FKTeacher' ],\n school_tblplan_group: [ 'FKPlan', 'FKGroup' ],\n unit_tblperiod_date: [ 'FKPeriod', 'StartDate', 'EndDate' ],\n school_tblschedule_period: [ 'FKSchedule', 'FKPeriod' ],\n school_tblschedule_teacher: [ 'FKSchedule', 'FKTeacher' ],\n school_tblschedule_group: [ 'FKSchedule', 'FKGroup' ],\n school_tblschedule_room: [ 'FKSchedule', 'FKRoom' ]\n};\n\n// this is only temporary\nconst PlanDigital_structure = {\n 'Perioder': [ 'Namn', 'Tidsenhet' ],\n 'Tabell Tjänstefördelning': [ 'Gruppnamn', 'Klass', 'Kurskod', 'Sign', 'Poäng', 'Anteckningar', 'Antal', 'Ämne', 'Kursnamn' ]\n};\n\nconst SchoolSoft_structure: (keyof SchoolSoftFileTypes.event)[] = [\n 'id',\n 'group',\n 'dayid',\n 'day',\n 'starttime',\n 'length',\n 'teacher',\n 'subject',\n 'room',\n 'period',\n 'inweek',\n 'exweek',\n 'exclass',\n 'realweeks'\n];\n\nexport const maps = [\n {\n structure: Skola24_txt_structure,\n matchType: 'string',\n name: 'Skola24 (txt)',\n map: Skola24Map.TXT,\n meta: { structure: '' }\n }, {\n structure: Admentum_structure,\n name: 'Admentum',\n map: AdmentumMap,\n meta: { structure: '' }\n }, {\n structure: SchoolSoft_structure,\n name: 'SchoolSoft',\n map: SchoolSoftMap,\n meta: { structure: '' }\n }, {\n structure: PlanDigital_structure,\n name: 'Plan Digital',\n map: PlanDigitalMap,\n meta: { structure: '' }\n }, {\n structure: IdunSoft_structure,\n name: 'IdunSoft',\n map: IdunSoftMap,\n meta: { structure: '' }\n }, {\n structure: Skola24_mdb_structure,\n name: 'Skola24 (mdb)',\n map: Skola24Map.MDB,\n meta: { structure: '' }\n }, {\n structure: RS_structure,\n name: 'Royal Schedule Algorithm',\n map: RSMap,\n meta: { structure: RSstructure }\n }, {\n // structure: core_structure,\n // name: 'Royal Schedule',\n // map: CoreMap.V1,\n // meta: { structure: 'RS/core-1.0.0' }\n // }, {\n structure: core_structure,\n name: 'Royal Schedule',\n map: CoreMap,\n meta: { structure: 'RS/core-2.0.0' }\n }, {\n structure: excel_structure,\n name: 'Royal Schedule Excel',\n map: ExcelMap.V1,\n meta: { structure: 'RS/Excel-1.0.0' }\n }, {\n structure: excel_structure,\n name: 'Royal Schedule Excel',\n map: ExcelMap.V2,\n meta: { structure: 'RS/Excel-2.0.0' }\n }\n] as const;"],"mappings":"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"}
|
package/dist/identify/index.js
CHANGED
|
@@ -22,8 +22,7 @@ function identify(schedule) {
|
|
|
22
22
|
error: []
|
|
23
23
|
};
|
|
24
24
|
if (!schedule) return similarities;
|
|
25
|
-
const
|
|
26
|
-
const res = MetaStructure.safeParse(schedule);
|
|
25
|
+
const res = z.object({ meta: z.union([z.object({ structure: z.string() }), z.array(z.unknown()).transform((arr) => arr.at(0)).pipe(z.object({ structure: z.string() }))]) }).safeParse(schedule);
|
|
27
26
|
if (res.data) {
|
|
28
27
|
const determined = maps.find((x) => sameMajorStructure(x.meta.structure, res.data.meta.structure));
|
|
29
28
|
if (determined) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["x","similarities: IdentifiedMaps","collections: string[]","structureKeys: string[]"],"sources":["../../src/identify/index.ts"],"sourcesContent":["import { difference, isEqual, sortBy, uniq } from 'lodash-es';\nimport type { IdentifiedMaps } from './types';\nimport { maps } from './constants';\nimport * as z from 'zod';\nimport { makeChainable } from '../common/make-chainable';\nexport type { MapInstance, MapName, IdentifiedMaps } from './types';\nexport { maps } from './constants';\n\n\nfunction keysOf (docs: unknown): string[] {\n return makeChainable(docs)\n .chain(\n x => Array.isArray(x) ? x as unknown[] : [x],\n x => x.flatMap(x => x && typeof x === 'object' ? Object.keys(x) : []),\n x => uniq(x)\n )\n .value;\n}\n\nfunction sameMajorStructure (a: string, b: string): boolean {\n const normalize = (s: string) => {\n // Matches: \"<prefix>-<major>[.<minor>[.<patch>]]\", optional leading 'v'\n const m = s.match(/^(.*?)-v?(\\d+)(?:\\.\\d+){0,2}$/i);\n return m ? `${m[1]}-${m[2]}` : s;\n };\n return normalize(a) === normalize(b);\n}\n\nexport function identify (schedule: unknown): IdentifiedMaps {\n const similarities: IdentifiedMaps = {\n none: [],\n weak: [],\n strong: [],\n error: [],\n };\n\n if (!schedule) return similarities;\n\n ////\n //// check if the schedule is a meta tagged file and thus identifiable by its structure.\n ////\n const MetaStructure = z.object({\n meta: z.union([\n z.object({\n structure: z.string()\n }),\n z.array(z.unknown())\n .transform(arr => arr.at(0))\n .pipe(z.object({\n structure: z.string()\n }))\n ])\n });\n const res = MetaStructure.safeParse(schedule);\n if (res.data) {\n // structure on the type \"RS/mapName-X.Y.Z\"\n const determined = maps.find(x => sameMajorStructure(x.meta.structure, res.data.meta.structure));\n if (determined) {\n similarities.determined = determined;\n return similarities;\n }\n }\n\n\n ////\n //// not a meta tagged file, so we check the structure.\n ////\n const collections: string[] = Array.isArray(schedule) ? keysOf(schedule) : Object.keys(schedule);\n if (!collections.length) return similarities;\n\n maps.forEach(mapping => {\n const { structure } = mapping;\n\n try {\n if ('matchType' in mapping && typeof schedule === mapping.matchType) {\n similarities.strong.push(mapping);\n return;\n }\n\n if (!structure) {\n similarities.none.push(mapping);\n return;\n }\n\n const _collections = Array.isArray(structure) ? structure : Object.keys(structure);\n\n /*\n is shallow structure .\n */\n if (Array.isArray(schedule)) {\n\n if (!Array.isArray(structure)) {\n similarities.none.push(mapping);\n return;\n }\n\n if (isEqual(sortBy(_collections), sortBy(collections))) {\n similarities.strong.push(mapping);\n return;\n }\n\n if (difference(sortBy(_collections), sortBy(collections)).length < _collections.length) {\n similarities.weak.push(mapping);\n return;\n }\n\n similarities.none.push(mapping);\n return;\n }\n\n /*\n is deep structure .\n */\n\n\n /*\n every key is present in file.\n */\n if (_collections.every(collection => {\n if (!(schedule && typeof schedule == 'object' && collection in schedule)) return false;\n const scheduleKeys = keysOf(schedule[collection as keyof typeof schedule]);\n\n if (!(collection in structure)) return false;\n const structureKeys: string[] = structure[collection as keyof typeof structure] as string[];\n\n return scheduleKeys.every(key => structureKeys.includes(key));\n })) {\n similarities.strong.push(mapping);\n return;\n }\n\n /*\n some keys is present in file.\n */\n if (_collections.some(collection => {\n if (!(schedule && typeof schedule == 'object' && collection in schedule)) return false;\n const scheduleKeys = keysOf(schedule[collection as keyof typeof schedule]);\n\n if (!(collection in structure)) return false;\n const structureKeys: string[] = structure[collection as keyof typeof structure] as string[];\n\n return scheduleKeys.some(key => structureKeys.includes(key));\n })) {\n similarities.weak.push(mapping);\n return;\n }\n\n similarities.none.push(mapping);\n } catch {\n similarities.error.push(mapping);\n }\n });\n\n return similarities;\n}\n"],"mappings":";;;;;;AASA,SAAS,OAAQ,MAAyB;AACxC,QAAO,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","names":["x","similarities: IdentifiedMaps","collections: string[]","structureKeys: string[]"],"sources":["../../src/identify/index.ts"],"sourcesContent":["import { difference, isEqual, sortBy, uniq } from 'lodash-es';\nimport type { IdentifiedMaps } from './types';\nimport { maps } from './constants';\nimport * as z from 'zod';\nimport { makeChainable } from '../common/make-chainable';\nexport type { MapInstance, MapName, IdentifiedMaps } from './types';\nexport { maps } from './constants';\n\n\nfunction keysOf (docs: unknown): string[] {\n return makeChainable(docs)\n .chain(\n x => Array.isArray(x) ? x as unknown[] : [x],\n x => x.flatMap(x => x && typeof x === 'object' ? Object.keys(x) : []),\n x => uniq(x)\n )\n .value;\n}\n\nfunction sameMajorStructure (a: string, b: string): boolean {\n const normalize = (s: string) => {\n // Matches: \"<prefix>-<major>[.<minor>[.<patch>]]\", optional leading 'v'\n const m = s.match(/^(.*?)-v?(\\d+)(?:\\.\\d+){0,2}$/i);\n return m ? `${m[1]}-${m[2]}` : s;\n };\n return normalize(a) === normalize(b);\n}\n\nexport function identify (schedule: unknown): IdentifiedMaps {\n const similarities: IdentifiedMaps = {\n none: [],\n weak: [],\n strong: [],\n error: [],\n };\n\n if (!schedule) return similarities;\n\n ////\n //// check if the schedule is a meta tagged file and thus identifiable by its structure.\n ////\n const MetaStructure = z.object({\n meta: z.union([\n z.object({\n structure: z.string()\n }),\n z.array(z.unknown())\n .transform(arr => arr.at(0))\n .pipe(z.object({\n structure: z.string()\n }))\n ])\n });\n const res = MetaStructure.safeParse(schedule);\n if (res.data) {\n // structure on the type \"RS/mapName-X.Y.Z\"\n const determined = maps.find(x => sameMajorStructure(x.meta.structure, res.data.meta.structure));\n if (determined) {\n similarities.determined = determined;\n return similarities;\n }\n }\n\n\n ////\n //// not a meta tagged file, so we check the structure.\n ////\n const collections: string[] = Array.isArray(schedule) ? keysOf(schedule) : Object.keys(schedule);\n if (!collections.length) return similarities;\n\n maps.forEach(mapping => {\n const { structure } = mapping;\n\n try {\n if ('matchType' in mapping && typeof schedule === mapping.matchType) {\n similarities.strong.push(mapping);\n return;\n }\n\n if (!structure) {\n similarities.none.push(mapping);\n return;\n }\n\n const _collections = Array.isArray(structure) ? structure : Object.keys(structure);\n\n /*\n is shallow structure .\n */\n if (Array.isArray(schedule)) {\n\n if (!Array.isArray(structure)) {\n similarities.none.push(mapping);\n return;\n }\n\n if (isEqual(sortBy(_collections), sortBy(collections))) {\n similarities.strong.push(mapping);\n return;\n }\n\n if (difference(sortBy(_collections), sortBy(collections)).length < _collections.length) {\n similarities.weak.push(mapping);\n return;\n }\n\n similarities.none.push(mapping);\n return;\n }\n\n /*\n is deep structure .\n */\n\n\n /*\n every key is present in file.\n */\n if (_collections.every(collection => {\n if (!(schedule && typeof schedule == 'object' && collection in schedule)) return false;\n const scheduleKeys = keysOf(schedule[collection as keyof typeof schedule]);\n\n if (!(collection in structure)) return false;\n const structureKeys: string[] = structure[collection as keyof typeof structure] as string[];\n\n return scheduleKeys.every(key => structureKeys.includes(key));\n })) {\n similarities.strong.push(mapping);\n return;\n }\n\n /*\n some keys is present in file.\n */\n if (_collections.some(collection => {\n if (!(schedule && typeof schedule == 'object' && collection in schedule)) return false;\n const scheduleKeys = keysOf(schedule[collection as keyof typeof schedule]);\n\n if (!(collection in structure)) return false;\n const structureKeys: string[] = structure[collection as keyof typeof structure] as string[];\n\n return scheduleKeys.some(key => structureKeys.includes(key));\n })) {\n similarities.weak.push(mapping);\n return;\n }\n\n similarities.none.push(mapping);\n } catch {\n similarities.error.push(mapping);\n }\n });\n\n return similarities;\n}\n"],"mappings":";;;;;;AASA,SAAS,OAAQ,MAAyB;AACxC,QAAO,cAAc,KAAK,CACvB,OACC,MAAK,MAAM,QAAQ,EAAE,GAAG,IAAiB,CAAC,EAAE,GAC5C,MAAK,EAAE,SAAQ,QAAKA,OAAK,OAAOA,QAAM,WAAW,OAAO,KAAKA,IAAE,GAAG,EAAE,CAAC,GACrE,MAAK,KAAK,EAAE,CACb,CACA;;AAGL,SAAS,mBAAoB,GAAW,GAAoB;CAC1D,MAAM,aAAa,MAAc;EAE/B,MAAM,IAAI,EAAE,MAAM,iCAAiC;AACnD,SAAO,IAAI,GAAG,EAAE,GAAG,GAAG,EAAE,OAAO;;AAEjC,QAAO,UAAU,EAAE,KAAK,UAAU,EAAE;;AAGtC,SAAgB,SAAU,UAAmC;CAC3D,MAAMC,eAA+B;EACnC,MAAQ,EAAE;EACV,MAAQ,EAAE;EACV,QAAQ,EAAE;EACV,OAAQ,EAAE;EACX;AAED,KAAI,CAAC,SAAU,QAAO;CAiBtB,MAAM,MAZgB,EAAE,OAAO,EAC7B,MAAM,EAAE,MAAM,CACZ,EAAE,OAAO,EACP,WAAW,EAAE,QAAQ,EACtB,CAAC,EACF,EAAE,MAAM,EAAE,SAAS,CAAC,CACjB,WAAU,QAAO,IAAI,GAAG,EAAE,CAAC,CAC3B,KAAK,EAAE,OAAO,EACb,WAAW,EAAE,QAAQ,EACtB,CAAC,CAAC,CACN,CAAC,EACH,CAAC,CACwB,UAAU,SAAS;AAC7C,KAAI,IAAI,MAAM;EAEZ,MAAM,aAAa,KAAK,MAAK,MAAK,mBAAmB,EAAE,KAAK,WAAW,IAAI,KAAK,KAAK,UAAU,CAAC;AAChG,MAAI,YAAY;AACd,gBAAa,aAAa;AAC1B,UAAO;;;CAQX,MAAMC,cAAwB,MAAM,QAAQ,SAAS,GAAG,OAAO,SAAS,GAAG,OAAO,KAAK,SAAS;AAChG,KAAI,CAAC,YAAY,OAAQ,QAAO;AAEhC,MAAK,SAAQ,YAAW;EACtB,MAAM,EAAE,cAAc;AAEtB,MAAI;AACF,OAAI,eAAe,WAAW,OAAO,aAAa,QAAQ,WAAW;AACnE,iBAAa,OAAO,KAAK,QAAQ;AACjC;;AAGF,OAAI,CAAC,WAAW;AACd,iBAAa,KAAK,KAAK,QAAQ;AAC/B;;GAGF,MAAM,eAAe,MAAM,QAAQ,UAAU,GAAG,YAAY,OAAO,KAAK,UAAU;AAKlF,OAAI,MAAM,QAAQ,SAAS,EAAE;AAE3B,QAAI,CAAC,MAAM,QAAQ,UAAU,EAAE;AAC7B,kBAAa,KAAK,KAAK,QAAQ;AAC/B;;AAGF,QAAI,QAAQ,OAAO,aAAa,EAAE,OAAO,YAAY,CAAC,EAAE;AACtD,kBAAa,OAAO,KAAK,QAAQ;AACjC;;AAGF,QAAI,WAAW,OAAO,aAAa,EAAE,OAAO,YAAY,CAAC,CAAC,SAAS,aAAa,QAAQ;AACtF,kBAAa,KAAK,KAAK,QAAQ;AAC/B;;AAGF,iBAAa,KAAK,KAAK,QAAQ;AAC/B;;AAWF,OAAI,aAAa,OAAM,eAAc;AACnC,QAAI,EAAE,YAAY,OAAO,YAAY,YAAY,cAAc,UAAW,QAAO;IACjF,MAAM,eAAe,OAAO,SAAS,YAAqC;AAE1E,QAAI,EAAE,cAAc,WAAY,QAAO;IACvC,MAAMC,gBAA0B,UAAU;AAE1C,WAAO,aAAa,OAAM,QAAO,cAAc,SAAS,IAAI,CAAC;KAC7D,EAAE;AACF,iBAAa,OAAO,KAAK,QAAQ;AACjC;;AAMF,OAAI,aAAa,MAAK,eAAc;AAClC,QAAI,EAAE,YAAY,OAAO,YAAY,YAAY,cAAc,UAAW,QAAO;IACjF,MAAM,eAAe,OAAO,SAAS,YAAqC;AAE1E,QAAI,EAAE,cAAc,WAAY,QAAO;IACvC,MAAMA,gBAA0B,UAAU;AAE1C,WAAO,aAAa,MAAK,QAAO,cAAc,SAAS,IAAI,CAAC;KAC5D,EAAE;AACF,iBAAa,KAAK,KAAK,QAAQ;AAC/B;;AAGF,gBAAa,KAAK,KAAK,QAAQ;UACxB;AACP,gBAAa,MAAM,KAAK,QAAQ;;GAElC;AAEF,QAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"classes.js","names":[],"sources":["../../../src/sdui/from/classes.ts"],"sourcesContent":["import type { Types as SduiTypes } from '../types';\nimport type { OutTypes } from './schedules';\n\nexport default (\n group: SduiTypes.classes\n): OutTypes.group => {\n return {\n ids: group.id\n };\n};\n"],"mappings":";AAGA,uBACE,UACmB;AACnB,QAAO,EACL,KAAK,MAAM"}
|
|
1
|
+
{"version":3,"file":"classes.js","names":[],"sources":["../../../src/sdui/from/classes.ts"],"sourcesContent":["import type { Types as SduiTypes } from '../types';\nimport type { OutTypes } from './schedules';\n\nexport default (\n group: SduiTypes.classes\n): OutTypes.group => {\n return {\n ids: group.id\n };\n};\n"],"mappings":";AAGA,uBACE,UACmB;AACnB,QAAO,EACL,KAAK,MAAM,IACZ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"courses.js","names":[],"sources":["../../../src/sdui/from/courses.ts"],"sourcesContent":["import type { Types as SduiTypes } from '../types';\nimport type { OutTypes } from './schedules';\n\nexport default (\n course: SduiTypes.course\n): OutTypes.course => {\n return {\n ids: course.id,\n displayName: course.name,\n color: course.color,\n teachers: course.teachers.map(to => ({ to })),\n groups: course.classes .map(to => ({ to })),\n };\n};\n"],"mappings":";AAGA,uBACE,WACoB;AACpB,QAAO;EACL,KAAa,OAAO;EACpB,aAAa,OAAO;EACpB,OAAa,OAAO;EACpB,UAAa,OAAO,SAAS,KAAI,QAAO,EAAE;
|
|
1
|
+
{"version":3,"file":"courses.js","names":[],"sources":["../../../src/sdui/from/courses.ts"],"sourcesContent":["import type { Types as SduiTypes } from '../types';\nimport type { OutTypes } from './schedules';\n\nexport default (\n course: SduiTypes.course\n): OutTypes.course => {\n return {\n ids: course.id,\n displayName: course.name,\n color: course.color,\n teachers: course.teachers.map(to => ({ to })),\n groups: course.classes .map(to => ({ to })),\n };\n};\n"],"mappings":";AAGA,uBACE,WACoB;AACpB,QAAO;EACL,KAAa,OAAO;EACpB,aAAa,OAAO;EACpB,OAAa,OAAO;EACpB,UAAa,OAAO,SAAS,KAAI,QAAO,EAAE,IAAI,EAAE;EAChD,QAAa,OAAO,QAAS,KAAI,QAAO,EAAE,IAAI,EAAE;EACjD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"holidays.js","names":[],"sources":["../../../src/sdui/from/holidays.ts"],"sourcesContent":["import type { Types as SduiTypes } from '../types';\nimport type { OutTypes } from './schedules';\n\nexport default (\n holiday: SduiTypes.holiday\n): OutTypes.exception => {\n return {\n // ids: holiday.id\n };\n};\n"],"mappings":";AAGA,wBACE,YACuB;AACvB,QAAO"}
|
|
1
|
+
{"version":3,"file":"holidays.js","names":[],"sources":["../../../src/sdui/from/holidays.ts"],"sourcesContent":["import type { Types as SduiTypes } from '../types';\nimport type { OutTypes } from './schedules';\n\nexport default (\n holiday: SduiTypes.holiday\n): OutTypes.exception => {\n return {\n // ids: holiday.id\n };\n};\n"],"mappings":";AAGA,wBACE,YACuB;AACvB,QAAO,EAEN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_schedules","_hours","_substitutionPlans","_classes","_teachers","_subjects","_rooms","_courses","_lessons","_holidays","_schoolYears"],"sources":["../../../src/sdui/from/index.ts"],"sourcesContent":["import _schedules from './schedules';\nimport _hours from './hours';\nimport _substitutionPlans from './substitution-plans';\nimport _classes from './classes';\nimport _teachers from './teachers';\nimport _subjects from './subjects';\nimport _rooms from './rooms';\nimport _courses from './courses';\nimport _lessons from './lessons';\nimport _holidays from './holidays';\nimport _schoolYears from './school-years';\n\nexport default {\n schedules: _schedules,\n hours: _hours,\n substitutionPlans: _substitutionPlans,\n classes: _classes,\n teachers: _teachers,\n subjects: _subjects,\n rooms: _rooms,\n courses: _courses,\n lessons: _lessons,\n holidays: _holidays,\n schoolYears: _schoolYears\n};"],"mappings":";;;;;;;;;;;;;AAYA,mBAAe;CACb,WAAmBA;CACnB,OAAmBC;CACnB,mBAAmBC;CACnB,SAAmBC;CACnB,UAAmBC;CACnB,UAAmBC;CACnB,OAAmBC;CACnB,SAAmBC;CACnB,SAAmBC;CACnB,UAAmBC;CACnB,aAAmBC"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_schedules","_hours","_substitutionPlans","_classes","_teachers","_subjects","_rooms","_courses","_lessons","_holidays","_schoolYears"],"sources":["../../../src/sdui/from/index.ts"],"sourcesContent":["import _schedules from './schedules';\nimport _hours from './hours';\nimport _substitutionPlans from './substitution-plans';\nimport _classes from './classes';\nimport _teachers from './teachers';\nimport _subjects from './subjects';\nimport _rooms from './rooms';\nimport _courses from './courses';\nimport _lessons from './lessons';\nimport _holidays from './holidays';\nimport _schoolYears from './school-years';\n\nexport default {\n schedules: _schedules,\n hours: _hours,\n substitutionPlans: _substitutionPlans,\n classes: _classes,\n teachers: _teachers,\n subjects: _subjects,\n rooms: _rooms,\n courses: _courses,\n lessons: _lessons,\n holidays: _holidays,\n schoolYears: _schoolYears\n};"],"mappings":";;;;;;;;;;;;;AAYA,mBAAe;CACb,WAAmBA;CACnB,OAAmBC;CACnB,mBAAmBC;CACnB,SAAmBC;CACnB,UAAmBC;CACnB,UAAmBC;CACnB,OAAmBC;CACnB,SAAmBC;CACnB,SAAmBC;CACnB,UAAmBC;CACnB,aAAmBC;CACpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lessons.js","names":[],"sources":["../../../src/sdui/from/lessons.ts"],"sourcesContent":["import type { Types as SduiTypes } from '../types';\nimport type { OutTypes } from './schedules';\n\nexport default (\n lesson: SduiTypes.lesson\n): OutTypes.event => {\n const start = lesson.begins_at;\n const end = lesson.ends_at;\n const duration = Math.floor((new Date(end).getTime() - new Date(start).getTime()) / 60000); // in minutes\n\n return {\n ids: lesson.id,\n course: lesson.course_id,\n start: lesson.begins_at,\n end: lesson.ends_at,\n preferredDuration: duration,\n locations: lesson.rooms?.map((to, i) => ({ locations: [to], groupIndex: i })),\n teachers: lesson.teachers?.map(to => ({ to })),\n groups: lesson.classes.map(to => ({ to })),\n };\n};"],"mappings":";AAGA,uBACE,WACmB;CACnB,MAAM,QAAW,OAAO;CACxB,MAAM,MAAW,OAAO;CACxB,MAAM,WAAW,KAAK,OAAO,IAAI,KAAK,
|
|
1
|
+
{"version":3,"file":"lessons.js","names":[],"sources":["../../../src/sdui/from/lessons.ts"],"sourcesContent":["import type { Types as SduiTypes } from '../types';\nimport type { OutTypes } from './schedules';\n\nexport default (\n lesson: SduiTypes.lesson\n): OutTypes.event => {\n const start = lesson.begins_at;\n const end = lesson.ends_at;\n const duration = Math.floor((new Date(end).getTime() - new Date(start).getTime()) / 60000); // in minutes\n\n return {\n ids: lesson.id,\n course: lesson.course_id,\n start: lesson.begins_at,\n end: lesson.ends_at,\n preferredDuration: duration,\n locations: lesson.rooms?.map((to, i) => ({ locations: [to], groupIndex: i })),\n teachers: lesson.teachers?.map(to => ({ to })),\n groups: lesson.classes.map(to => ({ to })),\n };\n};"],"mappings":";AAGA,uBACE,WACmB;CACnB,MAAM,QAAW,OAAO;CACxB,MAAM,MAAW,OAAO;CACxB,MAAM,WAAW,KAAK,OAAO,IAAI,KAAK,IAAI,CAAC,SAAS,GAAG,IAAI,KAAK,MAAM,CAAC,SAAS,IAAI,IAAM;AAE1F,QAAO;EACL,KAAmB,OAAO;EAC1B,QAAmB,OAAO;EAC1B,OAAmB,OAAO;EAC1B,KAAmB,OAAO;EAC1B,mBAAmB;EACnB,WAAmB,OAAO,OAAO,KAAK,IAAI,OAAO;GAAE,WAAW,CAAC,GAAG;GAAE,YAAY;GAAG,EAAE;EACrF,UAAmB,OAAO,UAAU,KAAI,QAAO,EAAE,IAAI,EAAE;EACvD,QAAmB,OAAO,QAAQ,KAAI,QAAO,EAAE,IAAI,EAAE;EACtD"}
|