@royalschedule/maps 4.0.12 → 4.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/RS/to/input/collections.js +2 -1
  2. package/dist/RS/to/input/collections.js.map +1 -1
  3. package/dist/RS/to/input/default.js +3 -1
  4. package/dist/RS/to/input/default.js.map +1 -1
  5. package/dist/RS/to/input/events.js +1 -0
  6. package/dist/RS/to/input/events.js.map +1 -1
  7. package/dist/RS/to/input/input.js +2 -1
  8. package/dist/RS/to/input/input.js.map +1 -1
  9. package/dist/RS/to/input/periods.js +47 -4
  10. package/dist/RS/to/input/periods.js.map +1 -1
  11. package/dist/RS/to/input/settings.js +3 -0
  12. package/dist/RS/to/input/settings.js.map +1 -1
  13. package/dist/RS/to/schedules.js +1 -1
  14. package/dist/RS/to/schedules.js.map +1 -1
  15. package/dist/RS/types/collections.d.ts +7 -0
  16. package/dist/RS/types/default.d.ts +7 -0
  17. package/dist/RS/types/events.d.ts +7 -0
  18. package/dist/RS/types/index.d.ts +5 -0
  19. package/dist/RS/types/period.d.ts +27 -0
  20. package/dist/RS/types/schedule-data.d.ts +7 -0
  21. package/dist/RS/types/settings.d.ts +3 -0
  22. package/dist/RS/types/to.d.ts +1 -1
  23. package/dist/core/from/configurations.js +12 -0
  24. package/dist/core/from/configurations.js.map +1 -0
  25. package/dist/core/from/schedules.js +3 -1
  26. package/dist/core/from/schedules.js.map +1 -1
  27. package/dist/core/to/configurations.js +17 -0
  28. package/dist/core/to/configurations.js.map +1 -0
  29. package/dist/core/to/courses.js +0 -1
  30. package/dist/core/to/courses.js.map +1 -1
  31. package/dist/core/to/events.js +0 -1
  32. package/dist/core/to/events.js.map +1 -1
  33. package/dist/core/to/schedules.d.ts +5 -1
  34. package/dist/core/to/schedules.js +3 -1
  35. package/dist/core/to/schedules.js.map +1 -1
  36. package/dist/core/types/configurations.d.ts +31 -0
  37. package/dist/core/types/index.d.ts +5 -0
  38. package/dist/identify/constants/index.d.ts +1 -1
  39. package/dist/identify/constants/index.js +1 -1
  40. package/dist/identify/constants/index.js.map +1 -1
  41. package/package.json +3 -3
@@ -34,7 +34,8 @@ function fromCollections(courses, settings, options, periodsMap) {
34
34
  days: parseDays(course.days, settings),
35
35
  minBreakLength: parseMinimumBreakLength(course.minBreakLength),
36
36
  lockedTimes: attachLockedTimes(course.lockedTimes, options),
37
- period: getPeriodIndex(course.period, periodsMap, options)
37
+ period: getPeriodIndex(course.period, periodsMap, options),
38
+ _period: course.period ? getVertexId(course.period, options) : void 0
38
39
  };
39
40
  if (options.meta) doc.meta = omitBy({
40
41
  color: course.color,
@@ -1 +1 @@
1
- {"version":3,"file":"collections.js","names":["doc: Types.collection & { overlapGroupId?: string }","x"],"sources":["../../../../src/RS/to/input/collections.ts"],"sourcesContent":["import { groupBy, omit, omitBy, values } from 'lodash-es';\nimport { attachLockedTimes } from './util/attach-locked-times';\nimport { parseEvents } from './events';\nimport { parseMinimumBreakLength } from './util/parse-minimum-break-length';\nimport { parseGroupReferences } from './util/parse-group-references';\nimport type { ConnectedTypes } from '../../make-connected';\nimport { getVertexId } from '../../../core/util';\nimport { getPeriodIndex, idOf } from './util/util';\nimport { parseLocationReferences } from './util/parse-location-references';\nimport { parseDays } from './util/parse-days';\nimport { parseIntervals } from './util/parse-intervals';\nimport type { Types } from '../../types';\nimport { makeChainable } from '../../../common/make-chainable';\nimport { getDefaultInterval } from './intervals';\n\nexport function fromCollections (\n courses: ConnectedTypes.course[],\n settings: ConnectedTypes.divisionSettings,\n options: Types.parsedToOptions,\n periodsMap: Map<string | undefined, number>,\n): (Types.collection[] | Types.collection)[] {\n const defaultInterval = getDefaultInterval(settings);\n\n const collections = courses\n .map(course => {\n const id = getVertexId(course, options);\n const intervals = course.intervals ?? defaultInterval;\n\n const doc: Types.collection & { overlapGroupId?: string } = {\n id,\n\n weight: course.weight,\n density: course.density,\n maxEventLengthVariance: course.eventDurationVariance,\n potentialCenter: course.centerOfAttraction ? parseFloat(course.centerOfAttraction.replace(':', '.')) : undefined,\n distributionKey: id,\n\n events: parseEvents (course.events, settings, options, periodsMap),\n dependencies: parseLocationReferences (course.locations, options),\n groups: parseGroupReferences ({ type: 'course', item: course }, options),\n intervals: options.oldFormat\n ? parseIntervals(intervals, undefined, settings)\n : idOf.intervalPairReference(intervals, undefined, options),\n days: parseDays (course.days, settings),\n minBreakLength: parseMinimumBreakLength (course.minBreakLength),\n lockedTimes: attachLockedTimes (course.lockedTimes, options),\n period: getPeriodIndex (course.period, periodsMap, options),\n };\n\n if (options.meta) {\n doc.meta = omitBy({\n color: course.color,\n ids: course.ids,\n name: course.displayName,\n }, x => x == null);\n }\n\n // temporarily attach overlap group\n doc.overlapGroupId = course.overlapGroup\n ? getVertexId(course.overlapGroup, options)\n : undefined;\n\n return omitBy(doc, x => x == null) as Types.collection & { overlapGroupId?: string };\n });\n\n const overlapping = makeChainable(collections)\n .chain(\n x => x.filter(x => x.overlapGroupId != null),\n x => groupBy(x, x => x.overlapGroupId),\n x => values(x)\n .map(xs => xs.map(x => omit(x, 'overlapGroupId') as Types.collection))\n )\n .value;\n\n const plain = collections\n .filter(x => x.overlapGroupId == null)\n .map(x => {\n delete x.overlapGroupId; // remove overlapGroupId from individual collections\n return x as Types.collection;\n });\n\n return overlapping.concat(plain);\n};"],"mappings":";;;;;;;;;;;;;;AAeA,SAAgB,gBACd,SACA,UACA,SACA,YAC2C;CAC3C,MAAM,kBAAkB,mBAAmB;CAE3C,MAAM,cAAc,QACjB,KAAI,WAAU;EACb,MAAM,KAAY,YAAY,QAAQ;EACtC,MAAM,YAAY,OAAO,aAAa;EAEtC,MAAMA,MAAsD;GAC1D;GAEA,QAAwB,OAAO;GAC/B,SAAwB,OAAO;GAC/B,wBAAwB,OAAO;GAC/B,iBAAwB,OAAO,qBAAqB,WAAW,OAAO,mBAAmB,QAAQ,KAAK,QAAQ;GAC9G,iBAAwB;GAExB,QAAc,YAA2B,OAAO,QAAQ,UAAU,SAAS;GAC3E,cAAc,wBAA2B,OAAO,WAAW;GAC3D,QAAc,qBAA2B;IAAE,MAAM;IAAU,MAAM;MAAU;GAC3E,WAAc,QAAQ,YAClB,eAAe,WAAW,QAAW,YACrC,KAAK,sBAAsB,WAAW,QAAW;GACrD,MAAgB,UAA2B,OAAO,MAAM;GACxD,gBAAgB,wBAA2B,OAAO;GAClD,aAAgB,kBAA2B,OAAO,aAAa;GAC/D,QAAgB,eAA2B,OAAO,QAAQ,YAAY;;AAGxE,MAAI,QAAQ,KACV,KAAI,OAAO,OAAO;GAChB,OAAO,OAAO;GACd,KAAO,OAAO;GACd,MAAO,OAAO;MACb,MAAK,KAAK;AAIf,MAAI,iBAAiB,OAAO,eACxB,YAAY,OAAO,cAAc,WACjC;AAEJ,SAAO,OAAO,MAAK,MAAK,KAAK;;CAGjC,MAAM,cAAc,cAAc,aAC/B,OACC,MAAK,EAAE,QAAO,QAAKC,IAAE,kBAAkB,QACvC,MAAK,QAAQ,IAAG,QAAKA,IAAE,kBACvB,MAAK,OAAO,GACT,KAAI,OAAM,GAAG,KAAI,QAAK,KAAKA,KAAG,qBAElC;CAEH,MAAM,QAAQ,YACX,QAAO,MAAK,EAAE,kBAAkB,MAChC,KAAI,MAAK;AACR,SAAO,EAAE;AACT,SAAO;;AAGX,QAAO,YAAY,OAAO"}
1
+ {"version":3,"file":"collections.js","names":["doc: Types.collection & { overlapGroupId?: string }","x"],"sources":["../../../../src/RS/to/input/collections.ts"],"sourcesContent":["import { groupBy, omit, omitBy, values } from 'lodash-es';\nimport { attachLockedTimes } from './util/attach-locked-times';\nimport { parseEvents } from './events';\nimport { parseMinimumBreakLength } from './util/parse-minimum-break-length';\nimport { parseGroupReferences } from './util/parse-group-references';\nimport type { ConnectedTypes } from '../../make-connected';\nimport { getVertexId } from '../../../core/util';\nimport { getPeriodIndex, idOf } from './util/util';\nimport { parseLocationReferences } from './util/parse-location-references';\nimport { parseDays } from './util/parse-days';\nimport { parseIntervals } from './util/parse-intervals';\nimport type { Types } from '../../types';\nimport { makeChainable } from '../../../common/make-chainable';\nimport { getDefaultInterval } from './intervals';\n\nexport function fromCollections (\n courses: ConnectedTypes.course[],\n settings: ConnectedTypes.divisionSettings,\n options: Types.parsedToOptions,\n periodsMap: Map<string | undefined, number>,\n): (Types.collection[] | Types.collection)[] {\n const defaultInterval = getDefaultInterval(settings);\n\n const collections = courses\n .map(course => {\n const id = getVertexId(course, options);\n const intervals = course.intervals ?? defaultInterval;\n\n const doc: Types.collection & { overlapGroupId?: string } = {\n id,\n\n weight: course.weight,\n density: course.density,\n maxEventLengthVariance: course.eventDurationVariance,\n potentialCenter: course.centerOfAttraction ? parseFloat(course.centerOfAttraction.replace(':', '.')) : undefined,\n distributionKey: id,\n\n events: parseEvents (course.events, settings, options, periodsMap),\n dependencies: parseLocationReferences (course.locations, options),\n groups: parseGroupReferences ({ type: 'course', item: course }, options),\n intervals: options.oldFormat\n ? parseIntervals(intervals, undefined, settings)\n : idOf.intervalPairReference(intervals, undefined, options),\n days: parseDays (course.days, settings),\n minBreakLength: parseMinimumBreakLength (course.minBreakLength),\n lockedTimes: attachLockedTimes (course.lockedTimes, options),\n period: getPeriodIndex (course.period, periodsMap, options),\n _period: course.period ? getVertexId(course.period, options) : undefined,\n };\n\n if (options.meta) {\n doc.meta = omitBy({\n color: course.color,\n ids: course.ids,\n name: course.displayName,\n }, x => x == null);\n }\n\n // temporarily attach overlap group\n doc.overlapGroupId = course.overlapGroup\n ? getVertexId(course.overlapGroup, options)\n : undefined;\n\n return omitBy(doc, x => x == null) as Types.collection & { overlapGroupId?: string };\n });\n\n const overlapping = makeChainable(collections)\n .chain(\n x => x.filter(x => x.overlapGroupId != null),\n x => groupBy(x, x => x.overlapGroupId),\n x => values(x)\n .map(xs => xs.map(x => omit(x, 'overlapGroupId') as Types.collection))\n )\n .value;\n\n const plain = collections\n .filter(x => x.overlapGroupId == null)\n .map(x => {\n delete x.overlapGroupId; // remove overlapGroupId from individual collections\n return x as Types.collection;\n });\n\n return overlapping.concat(plain);\n};"],"mappings":";;;;;;;;;;;;;;AAeA,SAAgB,gBACd,SACA,UACA,SACA,YAC2C;CAC3C,MAAM,kBAAkB,mBAAmB;CAE3C,MAAM,cAAc,QACjB,KAAI,WAAU;EACb,MAAM,KAAY,YAAY,QAAQ;EACtC,MAAM,YAAY,OAAO,aAAa;EAEtC,MAAMA,MAAsD;GAC1D;GAEA,QAAwB,OAAO;GAC/B,SAAwB,OAAO;GAC/B,wBAAwB,OAAO;GAC/B,iBAAwB,OAAO,qBAAqB,WAAW,OAAO,mBAAmB,QAAQ,KAAK,QAAQ;GAC9G,iBAAwB;GAExB,QAAc,YAA2B,OAAO,QAAQ,UAAU,SAAS;GAC3E,cAAc,wBAA2B,OAAO,WAAW;GAC3D,QAAc,qBAA2B;IAAE,MAAM;IAAU,MAAM;MAAU;GAC3E,WAAc,QAAQ,YAClB,eAAe,WAAW,QAAW,YACrC,KAAK,sBAAsB,WAAW,QAAW;GACrD,MAAgB,UAA2B,OAAO,MAAM;GACxD,gBAAgB,wBAA2B,OAAO;GAClD,aAAgB,kBAA2B,OAAO,aAAa;GAC/D,QAAgB,eAA2B,OAAO,QAAQ,YAAY;GACtE,SAAgB,OAAO,SAAS,YAAY,OAAO,QAAQ,WAAW;;AAGxE,MAAI,QAAQ,KACV,KAAI,OAAO,OAAO;GAChB,OAAO,OAAO;GACd,KAAO,OAAO;GACd,MAAO,OAAO;MACb,MAAK,KAAK;AAIf,MAAI,iBAAiB,OAAO,eACxB,YAAY,OAAO,cAAc,WACjC;AAEJ,SAAO,OAAO,MAAK,MAAK,KAAK;;CAGjC,MAAM,cAAc,cAAc,aAC/B,OACC,MAAK,EAAE,QAAO,QAAKC,IAAE,kBAAkB,QACvC,MAAK,QAAQ,IAAG,QAAKA,IAAE,kBACvB,MAAK,OAAO,GACT,KAAI,OAAM,GAAG,KAAI,QAAK,KAAKA,KAAG,qBAElC;CAEH,MAAM,QAAQ,YACX,QAAO,MAAK,EAAE,kBAAkB,MAChC,KAAI,MAAK;AACR,SAAO,EAAE;AACT,SAAO;;AAGX,QAAO,YAAY,OAAO"}
@@ -1,3 +1,4 @@
1
+ import { getVertexId } from "../../../core/util.js";
1
2
  import { getPeriodIndex, min2hrs, toTimeFloat } from "./util/util.js";
2
3
  import { computesDefaultIntervalId, getDefaultInterval } from "./intervals.js";
3
4
  import { parseIntervals } from "./util/parse-intervals.js";
@@ -23,7 +24,8 @@ function parseDefault(settings, periodsMap, options) {
23
24
  groupWeight: settings.defaultGroupWeight ?? 0,
24
25
  collectionWeight: settings.defaultCourseWeight ?? 0,
25
26
  eventWeight: settings.defaultEventWeight ?? 0,
26
- period: getPeriodIndex(settings.period ?? DEFAULT_PERIOD_ID, periodsMap, options)
27
+ period: getPeriodIndex(settings.period ?? DEFAULT_PERIOD_ID, periodsMap, options),
28
+ _period: settings.period ? getVertexId(settings.period, options) : void 0
27
29
  };
28
30
  return res;
29
31
  }
@@ -1 +1 @@
1
- {"version":3,"file":"default.js","names":["res: Types.defaultValues"],"sources":["../../../../src/RS/to/input/default.ts"],"sourcesContent":["import type { Types } from '../../types';\nimport { computesDefaultIntervalId, getDefaultInterval } from './intervals';\nimport { parseIntervals } from './util/parse-intervals';\nimport { getPeriodIndex, min2hrs, toTimeFloat } from './util/util';\nimport type { ConnectedTypes } from '../../make-connected';\nimport { DEFAULT_PERIOD_ID } from './periods';\n\nexport function parseDefault (\n settings: ConnectedTypes.divisionSettings,\n periodsMap: Map<string | undefined, number>,\n options: Types.parsedToOptions\n): Types.defaultValues {\n const maxNumWorkingHours = options.useMaximumScheduleSpan\n ? min2hrs(settings.defaultMaximumScheduleSpan?.daily) ?? false\n : settings.defaultMaxNumWorkingHours ?? false;\n\n const maxNumDailyWorkingHours = options.useMaximumScheduleSpan\n ? min2hrs(settings.defaultMaximumScheduleSpan?.daily) ?? false\n : settings.defaultMaxNumDailyWorkingHours ?? false;\n\n const res: Types.defaultValues = {\n intervals: options.oldFormat\n ? parseIntervals(getDefaultInterval(settings), undefined, settings)!\n : computesDefaultIntervalId(settings, options),\n\n groupMinBreakLength: settings.defaultGroupMinimumBreakLength ?? 0,\n dependencyMinBreakLength: settings.defaultDependencyMinimumBreakLength ?? 0,\n eventMinBreakLength: settings.defaultEventMinimumBreakLength ?? 0,\n\n potentialCenter: toTimeFloat(settings.potentialCenter ?? '12:00'),\n eventDensity: settings.defaultEventDensity ?? 0,\n\n maxEventLengthVariance: settings.defaultEventDurationVariance ?? 0,\n\n maxNumWorkingHours: maxNumWorkingHours,\n maxNumDailyWorkingHours: maxNumDailyWorkingHours,\n\n dependencyRank: settings.defaultDependencyRank ?? 0,\n groupRank: settings.defaultGroupRank ?? 0,\n dayRank: settings.defaultDayRank ?? 0,\n\n groupWeight: settings.defaultGroupWeight ?? 0,\n collectionWeight: settings.defaultCourseWeight ?? 0,\n eventWeight: settings.defaultEventWeight ?? 0,\n\n period: getPeriodIndex(settings.period ?? DEFAULT_PERIOD_ID, periodsMap, options)\n };\n\n return res;\n};"],"mappings":";;;;;;AAOA,SAAgB,aACd,UACA,YACA,SACqB;CACrB,MAAM,qBAAqB,QAAQ,yBAC/B,QAAQ,SAAS,4BAA4B,UAAU,QACvD,SAAS,6BAA8C;CAE3D,MAAM,0BAA0B,QAAQ,yBACpC,QAAQ,SAAS,4BAA4B,UAAU,QACvD,SAAS,kCAA8C;CAE3D,MAAMA,MAA2B;EAC/B,WAAW,QAAQ,YACf,eAAe,mBAAmB,WAAW,QAAW,YACxD,0BAA0B,UAAU;EAExC,qBAA0B,SAAS,kCAAuC;EAC1E,0BAA0B,SAAS,uCAAuC;EAC1E,qBAA0B,SAAS,kCAAuC;EAE1E,iBAAiB,YAAY,SAAS,mBAAmB;EACzD,cAAiB,SAAS,uBAAuB;EAEjD,wBAAwB,SAAS,gCAAgC;EAExC;EACA;EAEzB,gBAAgB,SAAS,yBAAyB;EAClD,WAAgB,SAAS,oBAAyB;EAClD,SAAgB,SAAS,kBAAyB;EAElD,aAAkB,SAAS,sBAAuB;EAClD,kBAAkB,SAAS,uBAAuB;EAClD,aAAkB,SAAS,sBAAuB;EAElD,QAAQ,eAAe,SAAS,UAAU,mBAAmB,YAAY;;AAG3E,QAAO"}
1
+ {"version":3,"file":"default.js","names":["res: Types.defaultValues"],"sources":["../../../../src/RS/to/input/default.ts"],"sourcesContent":["import type { Types } from '../../types';\nimport { computesDefaultIntervalId, getDefaultInterval } from './intervals';\nimport { parseIntervals } from './util/parse-intervals';\nimport { getPeriodIndex, min2hrs, toTimeFloat } from './util/util';\nimport type { ConnectedTypes } from '../../make-connected';\nimport { DEFAULT_PERIOD_ID } from './periods';\nimport { getVertexId } from '../../../core/util';\n\nexport function parseDefault (\n settings: ConnectedTypes.divisionSettings,\n periodsMap: Map<string | undefined, number>,\n options: Types.parsedToOptions\n): Types.defaultValues {\n const maxNumWorkingHours = options.useMaximumScheduleSpan\n ? min2hrs(settings.defaultMaximumScheduleSpan?.daily) ?? false\n : settings.defaultMaxNumWorkingHours ?? false;\n\n const maxNumDailyWorkingHours = options.useMaximumScheduleSpan\n ? min2hrs(settings.defaultMaximumScheduleSpan?.daily) ?? false\n : settings.defaultMaxNumDailyWorkingHours ?? false;\n\n const res: Types.defaultValues = {\n intervals: options.oldFormat\n ? parseIntervals(getDefaultInterval(settings), undefined, settings)!\n : computesDefaultIntervalId(settings, options),\n\n groupMinBreakLength: settings.defaultGroupMinimumBreakLength ?? 0,\n dependencyMinBreakLength: settings.defaultDependencyMinimumBreakLength ?? 0,\n eventMinBreakLength: settings.defaultEventMinimumBreakLength ?? 0,\n\n potentialCenter: toTimeFloat(settings.potentialCenter ?? '12:00'),\n eventDensity: settings.defaultEventDensity ?? 0,\n\n maxEventLengthVariance: settings.defaultEventDurationVariance ?? 0,\n\n maxNumWorkingHours: maxNumWorkingHours,\n maxNumDailyWorkingHours: maxNumDailyWorkingHours,\n\n dependencyRank: settings.defaultDependencyRank ?? 0,\n groupRank: settings.defaultGroupRank ?? 0,\n dayRank: settings.defaultDayRank ?? 0,\n\n groupWeight: settings.defaultGroupWeight ?? 0,\n collectionWeight: settings.defaultCourseWeight ?? 0,\n eventWeight: settings.defaultEventWeight ?? 0,\n\n period: getPeriodIndex(settings.period ?? DEFAULT_PERIOD_ID, periodsMap, options),\n _period: settings.period ? getVertexId(settings.period, options) : undefined,\n };\n\n return res;\n};"],"mappings":";;;;;;;AAQA,SAAgB,aACd,UACA,YACA,SACqB;CACrB,MAAM,qBAAqB,QAAQ,yBAC/B,QAAQ,SAAS,4BAA4B,UAAU,QACvD,SAAS,6BAA8C;CAE3D,MAAM,0BAA0B,QAAQ,yBACpC,QAAQ,SAAS,4BAA4B,UAAU,QACvD,SAAS,kCAA8C;CAE3D,MAAMA,MAA2B;EAC/B,WAAW,QAAQ,YACf,eAAe,mBAAmB,WAAW,QAAW,YACxD,0BAA0B,UAAU;EAExC,qBAA0B,SAAS,kCAAuC;EAC1E,0BAA0B,SAAS,uCAAuC;EAC1E,qBAA0B,SAAS,kCAAuC;EAE1E,iBAAiB,YAAY,SAAS,mBAAmB;EACzD,cAAiB,SAAS,uBAAuB;EAEjD,wBAAwB,SAAS,gCAAgC;EAExC;EACA;EAEzB,gBAAgB,SAAS,yBAAyB;EAClD,WAAgB,SAAS,oBAAyB;EAClD,SAAgB,SAAS,kBAAyB;EAElD,aAAkB,SAAS,sBAAuB;EAClD,kBAAkB,SAAS,uBAAuB;EAClD,aAAkB,SAAS,sBAAuB;EAElD,QAAS,eAAe,SAAS,UAAU,mBAAmB,YAAY;EAC1E,SAAS,SAAS,SAAS,YAAY,SAAS,QAAQ,WAAW;;AAGrE,QAAO"}
@@ -33,6 +33,7 @@ function parseEvents(events, settings, options, periodsMap) {
33
33
  potentialCenter: event.centerOfAttraction ? parseFloat(event.centerOfAttraction.replace(":", ".")) : void 0,
34
34
  forcedOverlapId: event.overlapSpecies?.species?.find(({ to }) => to == event)?.id,
35
35
  period: getPeriodIndex(event.period, periodsMap, options),
36
+ _period: event.period ? getVertexId(event.period, options) : void 0,
36
37
  days: parseDays(event.days, settings),
37
38
  dependencies: parseLocationReferences(event.locations, options),
38
39
  groups: parseGroupReferences({
@@ -1 +1 @@
1
- {"version":3,"file":"events.js","names":["doc: Types.event","id"],"sources":["../../../../src/RS/to/input/events.ts"],"sourcesContent":["import moment from 'moment';\nimport { omitBy } from 'lodash-es';\nimport { parseMinimumBreakLength } from './util/parse-minimum-break-length';\nimport { attachLockedTimes } from './util/attach-locked-times';\nimport type { Types } from '../../types';\nimport { parseGroupReferences } from './util/parse-group-references';\nimport { parseLocationReferences, parseSelectedLocations } from './util/parse-location-references';\nimport type { ConnectedTypes } from '../../make-connected';\nimport { getDayIndex, getVertexId } from '../../../core/util';\nimport { getPeriodIndex, idOf } from './util/util';\nimport { parseDays } from './util/parse-days';\nimport type { DateType } from '../../../common/types';\nimport { parseIntervals } from './util/parse-intervals';\nimport { getDefaultInterval } from './intervals';\n\nexport function toDayAndStart (start: DateType) {\n return {\n start: parseFloat(moment.utc(start).format('HH.mm')),\n day: getDayIndex(start)\n };\n}\n\nexport function parseEvents (\n events: ConnectedTypes.event[] | undefined,\n settings: ConnectedTypes.divisionSettings,\n options: Types.parsedToOptions,\n periodsMap: Map<string | undefined, number>\n): Types.event[] {\n const defaultInterval = getDefaultInterval(settings);\n\n return (events ?? [])\n .map((event): Types.event | undefined => {\n const id = getVertexId(event, options);\n const intervals = event.intervals ?? event.course?.intervals ?? defaultInterval;\n\n const duration = event.preferredDuration ?? event.duration; // temporary, should be preferred duration only!\n if (!duration) throw new Error(`(RS::To::Events) Event \"${id}\" has no duration`);\n\n const doc: Types.event = {\n id: idOf.event(event, options),\n length: duration,\n maxLengthVariance: event.durationVariance,\n weight: event.weight,\n density: event.density,\n potentialCenter: event.centerOfAttraction ? parseFloat(event.centerOfAttraction.replace(':', '.')) : undefined,\n forcedOverlapId: event.overlapSpecies?.species?.find(({ to }) => to == event)?.id,\n\n period: getPeriodIndex (event.period, periodsMap, options),\n days: parseDays (event.days, settings),\n dependencies: parseLocationReferences (event.locations, options),\n groups: parseGroupReferences ({ type: 'event', item: event }, options),\n intervals: options.oldFormat\n ? parseIntervals(intervals, undefined, settings)\n : idOf.intervalPairReference(intervals, undefined, options),\n lockedTimes: attachLockedTimes (event.lockedTimes, options),\n minBreakLength: parseMinimumBreakLength (event.minBreakLength),\n };\n\n // if the event has a fixed day and start\n if (event.fixedStart && event.start) {\n Object.assign(doc, toDayAndStart(event.start));\n }\n\n if (options.meta) {\n doc.meta = omitBy({\n name: event.displayName,\n ids: event.ids,\n parked: event.parked,\n visible: event.visible,\n start: event.start ? moment.utc(event.start) : undefined,\n end: event.end ? moment.utc(event.start) : undefined,\n course: event.course ? getVertexId(event.course, options) : undefined,\n inLocations: event.inLocations ? parseSelectedLocations(event, options) : undefined\n }, x => x == null);\n }\n\n ////\n //// filter events based on partialScheduleOptions\n ////\n if (options.partialScheduleOptions) {\n const { includedEvents, omittedEventsHandling } = options.partialScheduleOptions;\n if (includedEvents && !includedEvents.has(doc.id)) { // collection.id => take into account dynamic locked times too!\n\n if (omittedEventsHandling == 'ignore') return;\n\n if (omittedEventsHandling == 'freeze') {\n // must not be parked and have a start and duration to be frozen, otherwise it's ignored\n if (event.parked || !event.start || !event.duration) return;\n\n // fix day, start and end\n Object.assign(doc, toDayAndStart(event.start));\n doc.length = event.duration;\n doc.maxLengthVariance = 0;\n\n // override intervals and days to not cause conflicts\n const numDays = settings.numDays ?? 5;\n doc.days = Array.from({ length: numDays }, (_, i) => i);\n doc.intervals = Array.from({ length: numDays }, () => [{ beg: 0, end: 23.55 }]);\n\n // fix locations\n doc.dependencies = (event.inLocations ?? [])\n .filter((x): x is NonNullable<typeof x> => !!x)\n .map(x => {\n const id = getVertexId(x, options);\n\n // filter location references based on partial schedule options\n const includedLocations = options.partialScheduleOptions?.includedLocations;\n if (includedLocations && !includedLocations.has(id)) return;\n\n return [{ dependency: id }] as Types.availableDependency[];\n })\n .filter(x => x != null);\n }\n\n }\n }\n\n return omitBy(doc, x => x == null) as Types.event;\n })\n .filter((x): x is NonNullable<typeof x> => !!x);\n}"],"mappings":";;;;;;;;;;;;;AAeA,SAAgB,cAAe,OAAiB;AAC9C,QAAO;EACL,OAAO,WAAW,OAAO,IAAI,OAAO,OAAO;EAC3C,KAAO,YAAY;;;AAIvB,SAAgB,YACd,QACA,UACA,SACA,YACe;CACf,MAAM,kBAAkB,mBAAmB;AAE3C,SAAQ,UAAU,IACf,KAAK,UAAmC;EACvC,MAAM,KAAY,YAAY,OAAO;EACrC,MAAM,YAAY,MAAM,aAAa,MAAM,QAAQ,aAAa;EAEhE,MAAM,WAAW,MAAM,qBAAqB,MAAM;AAClD,MAAI,CAAC,SAAU,OAAM,IAAI,MAAM,2BAA2B,GAAG;EAE7D,MAAMA,MAAmB;GACvB,IAAmB,KAAK,MAAM,OAAO;GACrC,QAAmB;GACnB,mBAAmB,MAAM;GACzB,QAAmB,MAAM;GACzB,SAAmB,MAAM;GACzB,iBAAmB,MAAM,qBAAqB,WAAW,MAAM,mBAAmB,QAAQ,KAAK,QAAQ;GACvG,iBAAmB,MAAM,gBAAgB,SAAS,MAAM,EAAE,SAAS,MAAM,QAAQ;GAEjF,QAAc,eAA2B,MAAM,QAAQ,YAAY;GACnE,MAAc,UAA2B,MAAM,MAAM;GACrD,cAAc,wBAA2B,MAAM,WAAW;GAC1D,QAAc,qBAA2B;IAAE,MAAM;IAAS,MAAM;MAAS;GACzE,WAAc,QAAQ,YAClB,eAAe,WAAW,QAAW,YACrC,KAAK,sBAAsB,WAAW,QAAW;GACrD,aAAgB,kBAA2B,MAAM,aAAa;GAC9D,gBAAgB,wBAA2B,MAAM;;AAInD,MAAI,MAAM,cAAc,MAAM,MAC5B,QAAO,OAAO,KAAK,cAAc,MAAM;AAGzC,MAAI,QAAQ,KACV,KAAI,OAAO,OAAO;GAChB,MAAa,MAAM;GACnB,KAAa,MAAM;GACnB,QAAa,MAAM;GACnB,SAAa,MAAM;GACnB,OAAa,MAAM,QAAc,OAAO,IAAI,MAAM,SAAwB;GAC1E,KAAa,MAAM,MAAc,OAAO,IAAI,MAAM,SAAwB;GAC1E,QAAa,MAAM,SAAc,YAAY,MAAM,QAAQ,WAAe;GAC1E,aAAa,MAAM,cAAc,uBAAuB,OAAO,WAAW;MACzE,MAAK,KAAK;AAMf,MAAI,QAAQ,wBAAwB;GAClC,MAAM,EAAE,gBAAgB,0BAA0B,QAAQ;AAC1D,OAAI,kBAAkB,CAAC,eAAe,IAAI,IAAI,KAAK;AAEjD,QAAI,yBAAyB,SAAU;AAEvC,QAAI,yBAAyB,UAAU;AAErC,SAAI,MAAM,UAAU,CAAC,MAAM,SAAS,CAAC,MAAM,SAAU;AAGrD,YAAO,OAAO,KAAK,cAAc,MAAM;AACvC,SAAI,SAAS,MAAM;AACnB,SAAI,oBAAoB;KAGxB,MAAM,UAAU,SAAS,WAAW;AACpC,SAAI,OAAY,MAAM,KAAK,EAAE,QAAQ,YAAY,GAAG,MAAM;AAC1D,SAAI,YAAY,MAAM,KAAK,EAAE,QAAQ,iBAAiB,CAAC;MAAE,KAAK;MAAG,KAAK;;AAGtE,SAAI,gBAAgB,MAAM,eAAe,IACtC,QAAQ,MAAkC,CAAC,CAAC,GAC5C,KAAI,MAAK;MACR,MAAMC,OAAK,YAAY,GAAG;MAG1B,MAAM,oBAAoB,QAAQ,wBAAwB;AAC1D,UAAI,qBAAqB,CAAC,kBAAkB,IAAIA,MAAK;AAErD,aAAO,CAAC,EAAE,YAAYA;QAEvB,QAAO,MAAK,KAAK;;;;AAM1B,SAAO,OAAO,MAAK,MAAK,KAAK;IAE9B,QAAQ,MAAkC,CAAC,CAAC"}
1
+ {"version":3,"file":"events.js","names":["doc: Types.event","id"],"sources":["../../../../src/RS/to/input/events.ts"],"sourcesContent":["import moment from 'moment';\nimport { omitBy } from 'lodash-es';\nimport { parseMinimumBreakLength } from './util/parse-minimum-break-length';\nimport { attachLockedTimes } from './util/attach-locked-times';\nimport type { Types } from '../../types';\nimport { parseGroupReferences } from './util/parse-group-references';\nimport { parseLocationReferences, parseSelectedLocations } from './util/parse-location-references';\nimport type { ConnectedTypes } from '../../make-connected';\nimport { getDayIndex, getVertexId } from '../../../core/util';\nimport { getPeriodIndex, idOf } from './util/util';\nimport { parseDays } from './util/parse-days';\nimport type { DateType } from '../../../common/types';\nimport { parseIntervals } from './util/parse-intervals';\nimport { getDefaultInterval } from './intervals';\n\nexport function toDayAndStart (start: DateType) {\n return {\n start: parseFloat(moment.utc(start).format('HH.mm')),\n day: getDayIndex(start)\n };\n}\n\nexport function parseEvents (\n events: ConnectedTypes.event[] | undefined,\n settings: ConnectedTypes.divisionSettings,\n options: Types.parsedToOptions,\n periodsMap: Map<string | undefined, number>\n): Types.event[] {\n const defaultInterval = getDefaultInterval(settings);\n\n return (events ?? [])\n .map((event): Types.event | undefined => {\n const id = getVertexId(event, options);\n const intervals = event.intervals ?? event.course?.intervals ?? defaultInterval;\n\n const duration = event.preferredDuration ?? event.duration; // temporary, should be preferred duration only!\n if (!duration) throw new Error(`(RS::To::Events) Event \"${id}\" has no duration`);\n\n const doc: Types.event = {\n id: idOf.event(event, options),\n length: duration,\n maxLengthVariance: event.durationVariance,\n weight: event.weight,\n density: event.density,\n potentialCenter: event.centerOfAttraction ? parseFloat(event.centerOfAttraction.replace(':', '.')) : undefined,\n forcedOverlapId: event.overlapSpecies?.species?.find(({ to }) => to == event)?.id,\n\n period: getPeriodIndex (event.period, periodsMap, options),\n _period: event.period ? getVertexId(event.period, options) : undefined,\n days: parseDays (event.days, settings),\n dependencies: parseLocationReferences (event.locations, options),\n groups: parseGroupReferences ({ type: 'event', item: event }, options),\n intervals: options.oldFormat\n ? parseIntervals(intervals, undefined, settings)\n : idOf.intervalPairReference(intervals, undefined, options),\n lockedTimes: attachLockedTimes (event.lockedTimes, options),\n minBreakLength: parseMinimumBreakLength (event.minBreakLength),\n };\n\n // if the event has a fixed day and start\n if (event.fixedStart && event.start) {\n Object.assign(doc, toDayAndStart(event.start));\n }\n\n if (options.meta) {\n doc.meta = omitBy({\n name: event.displayName,\n ids: event.ids,\n parked: event.parked,\n visible: event.visible,\n start: event.start ? moment.utc(event.start) : undefined,\n end: event.end ? moment.utc(event.start) : undefined,\n course: event.course ? getVertexId(event.course, options) : undefined,\n inLocations: event.inLocations ? parseSelectedLocations(event, options) : undefined\n }, x => x == null);\n }\n\n ////\n //// filter events based on partialScheduleOptions\n ////\n if (options.partialScheduleOptions) {\n const { includedEvents, omittedEventsHandling } = options.partialScheduleOptions;\n if (includedEvents && !includedEvents.has(doc.id)) { // collection.id => take into account dynamic locked times too!\n\n if (omittedEventsHandling == 'ignore') return;\n\n if (omittedEventsHandling == 'freeze') {\n // must not be parked and have a start and duration to be frozen, otherwise it's ignored\n if (event.parked || !event.start || !event.duration) return;\n\n // fix day, start and end\n Object.assign(doc, toDayAndStart(event.start));\n doc.length = event.duration;\n doc.maxLengthVariance = 0;\n\n // override intervals and days to not cause conflicts\n const numDays = settings.numDays ?? 5;\n doc.days = Array.from({ length: numDays }, (_, i) => i);\n doc.intervals = Array.from({ length: numDays }, () => [{ beg: 0, end: 23.55 }]);\n\n // fix locations\n doc.dependencies = (event.inLocations ?? [])\n .filter((x): x is NonNullable<typeof x> => !!x)\n .map(x => {\n const id = getVertexId(x, options);\n\n // filter location references based on partial schedule options\n const includedLocations = options.partialScheduleOptions?.includedLocations;\n if (includedLocations && !includedLocations.has(id)) return;\n\n return [{ dependency: id }] as Types.availableDependency[];\n })\n .filter(x => x != null);\n }\n\n }\n }\n\n return omitBy(doc, x => x == null) as Types.event;\n })\n .filter((x): x is NonNullable<typeof x> => !!x);\n}"],"mappings":";;;;;;;;;;;;;AAeA,SAAgB,cAAe,OAAiB;AAC9C,QAAO;EACL,OAAO,WAAW,OAAO,IAAI,OAAO,OAAO;EAC3C,KAAO,YAAY;;;AAIvB,SAAgB,YACd,QACA,UACA,SACA,YACe;CACf,MAAM,kBAAkB,mBAAmB;AAE3C,SAAQ,UAAU,IACf,KAAK,UAAmC;EACvC,MAAM,KAAY,YAAY,OAAO;EACrC,MAAM,YAAY,MAAM,aAAa,MAAM,QAAQ,aAAa;EAEhE,MAAM,WAAW,MAAM,qBAAqB,MAAM;AAClD,MAAI,CAAC,SAAU,OAAM,IAAI,MAAM,2BAA2B,GAAG;EAE7D,MAAMA,MAAmB;GACvB,IAAmB,KAAK,MAAM,OAAO;GACrC,QAAmB;GACnB,mBAAmB,MAAM;GACzB,QAAmB,MAAM;GACzB,SAAmB,MAAM;GACzB,iBAAmB,MAAM,qBAAqB,WAAW,MAAM,mBAAmB,QAAQ,KAAK,QAAQ;GACvG,iBAAmB,MAAM,gBAAgB,SAAS,MAAM,EAAE,SAAS,MAAM,QAAQ;GAEjF,QAAc,eAA2B,MAAM,QAAQ,YAAY;GACnE,SAAc,MAAM,SAAS,YAAY,MAAM,QAAQ,WAAW;GAClE,MAAc,UAA2B,MAAM,MAAM;GACrD,cAAc,wBAA2B,MAAM,WAAW;GAC1D,QAAc,qBAA2B;IAAE,MAAM;IAAS,MAAM;MAAS;GACzE,WAAc,QAAQ,YAClB,eAAe,WAAW,QAAW,YACrC,KAAK,sBAAsB,WAAW,QAAW;GACrD,aAAgB,kBAA2B,MAAM,aAAa;GAC9D,gBAAgB,wBAA2B,MAAM;;AAInD,MAAI,MAAM,cAAc,MAAM,MAC5B,QAAO,OAAO,KAAK,cAAc,MAAM;AAGzC,MAAI,QAAQ,KACV,KAAI,OAAO,OAAO;GAChB,MAAa,MAAM;GACnB,KAAa,MAAM;GACnB,QAAa,MAAM;GACnB,SAAa,MAAM;GACnB,OAAa,MAAM,QAAc,OAAO,IAAI,MAAM,SAAwB;GAC1E,KAAa,MAAM,MAAc,OAAO,IAAI,MAAM,SAAwB;GAC1E,QAAa,MAAM,SAAc,YAAY,MAAM,QAAQ,WAAe;GAC1E,aAAa,MAAM,cAAc,uBAAuB,OAAO,WAAW;MACzE,MAAK,KAAK;AAMf,MAAI,QAAQ,wBAAwB;GAClC,MAAM,EAAE,gBAAgB,0BAA0B,QAAQ;AAC1D,OAAI,kBAAkB,CAAC,eAAe,IAAI,IAAI,KAAK;AAEjD,QAAI,yBAAyB,SAAU;AAEvC,QAAI,yBAAyB,UAAU;AAErC,SAAI,MAAM,UAAU,CAAC,MAAM,SAAS,CAAC,MAAM,SAAU;AAGrD,YAAO,OAAO,KAAK,cAAc,MAAM;AACvC,SAAI,SAAS,MAAM;AACnB,SAAI,oBAAoB;KAGxB,MAAM,UAAU,SAAS,WAAW;AACpC,SAAI,OAAY,MAAM,KAAK,EAAE,QAAQ,YAAY,GAAG,MAAM;AAC1D,SAAI,YAAY,MAAM,KAAK,EAAE,QAAQ,iBAAiB,CAAC;MAAE,KAAK;MAAG,KAAK;;AAGtE,SAAI,gBAAgB,MAAM,eAAe,IACtC,QAAQ,MAAkC,CAAC,CAAC,GAC5C,KAAI,MAAK;MACR,MAAMC,OAAK,YAAY,GAAG;MAG1B,MAAM,oBAAoB,QAAQ,wBAAwB;AAC1D,UAAI,qBAAqB,CAAC,kBAAkB,IAAIA,MAAK;AAErD,aAAO,CAAC,EAAE,YAAYA;QAEvB,QAAO,MAAK,KAAK;;;;AAM1B,SAAO,OAAO,MAAK,MAAK,KAAK;IAE9B,QAAQ,MAAkC,CAAC,CAAC"}
@@ -3,7 +3,7 @@ import { extractUniqueIntervals } from "./intervals.js";
3
3
  import { fromTeachers } from "./teachers.js";
4
4
  import { fromCollections } from "./collections.js";
5
5
  import { parseSettings } from "./settings.js";
6
- import { parsePeriods } from "./periods.js";
6
+ import { _parsePeriods, parsePeriods } from "./periods.js";
7
7
  import { parseDefault } from "./default.js";
8
8
  import { fromDynamicLockedTimes } from "./dynamic-locked-times.js";
9
9
  import { fromGroups } from "./groups.js";
@@ -40,6 +40,7 @@ function parseInput(data, options = {}) {
40
40
  settings: parseSettings(_settings),
41
41
  default: parseDefault(_settings, periodsMap, options),
42
42
  periods,
43
+ _periods: _parsePeriods(_periods, _division, options),
43
44
  intervals: options.oldFormat ? void 0 : extractUniqueIntervals(_settings, _groups, _teachers, _courses, _events, _lockedTimes, options),
44
45
  dependencies: fromLocations(_locations, _settings, options),
45
46
  groups: fromGroups(_groups, _settings, options).concat(fromTeachers(_teachers, _settings, options)),
@@ -1 +1 @@
1
- {"version":3,"file":"input.js","names":["out: Types.scheduleData"],"sources":["../../../../src/RS/to/input/input.ts"],"sourcesContent":["import type { Types } from '../../types';\nimport { fromLocations } from './dependencies';\nimport { fromTeachers } from './teachers';\nimport { fromCollections } from './collections';\nimport { parseSettings } from './settings';\nimport { parseDefault } from './default';\nimport { fromDynamicLockedTimes } from './dynamic-locked-times';\nimport { parsePeriods } from './periods';\nimport type { ConnectedScheduleData } from '../../make-connected';\nimport { fromGroups } from './groups';\nimport { extractUniqueIntervals } from './intervals';\nimport { extractUniqueIndividuals } from './individuals';\n\nexport function parseInput (\n data: ConnectedScheduleData,\n options: Types.parsedToOptions = {}\n): Types.scheduleData {\n\n const _settings = data.settings;\n const _division = data.division;\n const _groups = data.groups ?? [];\n const _teachers = data.teachers ?? [];\n const _locations = data.locations ?? [];\n const _events = data.events ?? [];\n const _lockedTimes = data.lockedTimes ?? [];\n const _courses = data.courses ?? [];\n const _persons = data.persons ?? [];\n const _periods = data.periods ?? [];\n\n\n ////\n //// replace empty/null intervals with undefined\n ////\n [_groups, _teachers, _locations, _courses, _events, _lockedTimes].forEach(entities => {\n entities.forEach(entity => {\n if (entity.intervals && entity.intervals.length == 0) entity.intervals = undefined;\n else if (entity.intervals === null ) entity.intervals = undefined;\n });\n });\n\n\n const { map: periodsMap, matrix: periodsMatrix } = parsePeriods(_periods, _division, options);\n const periods = periodsMatrix?.length ? periodsMatrix : undefined; // cannot be an empty string\n\n const out: Types.scheduleData = {\n settings: parseSettings(_settings),\n default: parseDefault (_settings, periodsMap, options),\n\n periods: periods,\n\n intervals: options.oldFormat ? undefined : extractUniqueIntervals(_settings, _groups, _teachers, _courses, _events, _lockedTimes, options),\n\n dependencies: fromLocations(_locations, _settings, options),\n\n groups: fromGroups(_groups, _settings, options)\n .concat(fromTeachers(_teachers, _settings, options)),\n\n individuals: options.oldFormat ? undefined : extractUniqueIndividuals(_persons, _courses, _events, _lockedTimes, options),\n\n events: [\n ...fromCollections(_courses, _settings, options, periodsMap),\n ...fromDynamicLockedTimes(_lockedTimes, _settings, options)\n ]\n };\n return out;\n};"],"mappings":";;;;;;;;;;;;AAaA,SAAgB,WACd,MACA,UAAiC,IACb;CAEpB,MAAM,YAAe,KAAK;CAC1B,MAAM,YAAe,KAAK;CAC1B,MAAM,UAAe,KAAK,UAAe;CACzC,MAAM,YAAe,KAAK,YAAe;CACzC,MAAM,aAAe,KAAK,aAAe;CACzC,MAAM,UAAe,KAAK,UAAe;CACzC,MAAM,eAAe,KAAK,eAAe;CACzC,MAAM,WAAe,KAAK,WAAe;CACzC,MAAM,WAAe,KAAK,WAAe;CACzC,MAAM,WAAe,KAAK,WAAe;AAMzC;EAAC;EAAS;EAAW;EAAY;EAAU;EAAS;GAAc,SAAQ,aAAY;AACpF,WAAS,SAAQ,WAAU;AACzB,OAAS,OAAO,aAAa,OAAO,UAAU,UAAU,EAAG,QAAO,YAAY;YACrE,OAAO,cAAc,KAA6B,QAAO,YAAY;;;CAKlF,MAAM,EAAE,KAAK,YAAY,QAAQ,kBAAkB,aAAa,UAAU,WAAW;CACrF,MAAM,UAAU,eAAe,SAAS,gBAAgB;CAExD,MAAMA,MAA0B;EAC9B,UAAU,cAAc;EACxB,SAAU,aAAc,WAAW,YAAY;EAEtC;EAET,WAAW,QAAQ,YAAY,SAAY,uBAAuB,WAAW,SAAS,WAAW,UAAU,SAAS,cAAc;EAElI,cAAc,cAAc,YAAY,WAAW;EAEnD,QAAQ,WAAW,SAAS,WAAW,SACpC,OAAO,aAAa,WAAW,WAAW;EAE7C,aAAa,QAAQ,YAAY,SAAY,yBAAyB,UAAU,UAAU,SAAS,cAAc;EAEjH,QAAQ,CACN,GAAG,gBAAgB,UAAU,WAAW,SAAS,aACjD,GAAG,uBAAuB,cAAc,WAAW;;AAGvD,QAAO"}
1
+ {"version":3,"file":"input.js","names":["out: Types.scheduleData"],"sources":["../../../../src/RS/to/input/input.ts"],"sourcesContent":["import type { Types } from '../../types';\nimport { fromLocations } from './dependencies';\nimport { fromTeachers } from './teachers';\nimport { fromCollections } from './collections';\nimport { parseSettings } from './settings';\nimport { parseDefault } from './default';\nimport { fromDynamicLockedTimes } from './dynamic-locked-times';\nimport { parsePeriods, _parsePeriods } from './periods';\nimport type { ConnectedScheduleData } from '../../make-connected';\nimport { fromGroups } from './groups';\nimport { extractUniqueIntervals } from './intervals';\nimport { extractUniqueIndividuals } from './individuals';\n\nexport function parseInput (\n data: ConnectedScheduleData,\n options: Types.parsedToOptions = {}\n): Types.scheduleData {\n\n const _settings = data.settings;\n const _division = data.division;\n const _groups = data.groups ?? [];\n const _teachers = data.teachers ?? [];\n const _locations = data.locations ?? [];\n const _events = data.events ?? [];\n const _lockedTimes = data.lockedTimes ?? [];\n const _courses = data.courses ?? [];\n const _persons = data.persons ?? [];\n const _periods = data.periods ?? [];\n\n\n ////\n //// replace empty/null intervals with undefined\n ////\n [_groups, _teachers, _locations, _courses, _events, _lockedTimes].forEach(entities => {\n entities.forEach(entity => {\n if (entity.intervals && entity.intervals.length == 0) entity.intervals = undefined;\n else if (entity.intervals === null ) entity.intervals = undefined;\n });\n });\n\n\n const { map: periodsMap, matrix: periodsMatrix } = parsePeriods(_periods, _division, options);\n const periods = periodsMatrix?.length ? periodsMatrix : undefined; // cannot be an empty string\n\n const out: Types.scheduleData = {\n settings: parseSettings(_settings),\n default: parseDefault (_settings, periodsMap, options),\n\n periods: periods,\n _periods: _parsePeriods(_periods, _division, options),\n\n intervals: options.oldFormat ? undefined : extractUniqueIntervals(_settings, _groups, _teachers, _courses, _events, _lockedTimes, options),\n\n dependencies: fromLocations(_locations, _settings, options),\n\n groups: fromGroups(_groups, _settings, options)\n .concat(fromTeachers(_teachers, _settings, options)),\n\n individuals: options.oldFormat ? undefined : extractUniqueIndividuals(_persons, _courses, _events, _lockedTimes, options),\n\n events: [\n ...fromCollections(_courses, _settings, options, periodsMap),\n ...fromDynamicLockedTimes(_lockedTimes, _settings, options)\n ]\n };\n return out;\n};"],"mappings":";;;;;;;;;;;;AAaA,SAAgB,WACd,MACA,UAAiC,IACb;CAEpB,MAAM,YAAe,KAAK;CAC1B,MAAM,YAAe,KAAK;CAC1B,MAAM,UAAe,KAAK,UAAe;CACzC,MAAM,YAAe,KAAK,YAAe;CACzC,MAAM,aAAe,KAAK,aAAe;CACzC,MAAM,UAAe,KAAK,UAAe;CACzC,MAAM,eAAe,KAAK,eAAe;CACzC,MAAM,WAAe,KAAK,WAAe;CACzC,MAAM,WAAe,KAAK,WAAe;CACzC,MAAM,WAAe,KAAK,WAAe;AAMzC;EAAC;EAAS;EAAW;EAAY;EAAU;EAAS;GAAc,SAAQ,aAAY;AACpF,WAAS,SAAQ,WAAU;AACzB,OAAS,OAAO,aAAa,OAAO,UAAU,UAAU,EAAG,QAAO,YAAY;YACrE,OAAO,cAAc,KAA6B,QAAO,YAAY;;;CAKlF,MAAM,EAAE,KAAK,YAAY,QAAQ,kBAAkB,aAAa,UAAU,WAAW;CACrF,MAAM,UAAU,eAAe,SAAS,gBAAgB;CAExD,MAAMA,MAA0B;EAC9B,UAAU,cAAc;EACxB,SAAU,aAAc,WAAW,YAAY;EAErC;EACV,UAAU,cAAc,UAAU,WAAW;EAE7C,WAAW,QAAQ,YAAY,SAAY,uBAAuB,WAAW,SAAS,WAAW,UAAU,SAAS,cAAc;EAElI,cAAc,cAAc,YAAY,WAAW;EAEnD,QAAQ,WAAW,SAAS,WAAW,SACpC,OAAO,aAAa,WAAW,WAAW;EAE7C,aAAa,QAAQ,YAAY,SAAY,yBAAyB,UAAU,UAAU,SAAS,cAAc;EAEjH,QAAQ,CACN,GAAG,gBAAgB,UAAU,WAAW,SAAS,aACjD,GAAG,uBAAuB,cAAc,WAAW;;AAGvD,QAAO"}
@@ -1,14 +1,14 @@
1
1
  import { getIdKey, getVertexId } from "../../../core/util.js";
2
2
  import { makeChainable } from "../../../common/make-chainable/index.js";
3
- import { anyRangesOverlap } from "../../../common/functions.js";
3
+ import { anyRangesOverlap, rangesOverlap } from "../../../common/functions.js";
4
4
  import { groupBy } from "lodash-es";
5
5
  import moment from "moment";
6
6
 
7
7
  //#region src/RS/to/input/periods.ts
8
8
  function createRange({ start, end }) {
9
9
  return {
10
- start: moment.utc(start).clone().startOf("isoWeek").startOf("day"),
11
- end: moment.utc(end).clone().endOf("isoWeek").endOf("day")
10
+ start: moment.utc(start).clone().startOf("isoWeek"),
11
+ end: moment.utc(end).clone().endOf("isoWeek")
12
12
  };
13
13
  }
14
14
  /**
@@ -42,7 +42,50 @@ function parsePeriods(periods, division, options) {
42
42
  matrix
43
43
  };
44
44
  }
45
+ function _parsePeriods(periods, division, options) {
46
+ const divisionRange = createRange(division);
47
+ const weeksMap = /* @__PURE__ */ new Map();
48
+ for (const x = divisionRange.start.clone(); x.isSameOrBefore(divisionRange.end); x.add(1, "week")) weeksMap.set(x.toISOString(), false);
49
+ const out = periods?.map((p) => {
50
+ const id = getVertexId(p, options);
51
+ const clippedRanges = p.ranges.map((r) => createRange(r)).filter((r) => rangesOverlap(r, divisionRange)).map((r) => ({
52
+ start: moment.max(r.start, divisionRange.start).clone(),
53
+ end: moment.min(r.end, divisionRange.end).clone()
54
+ }));
55
+ const activeWeeksMap = new Map(weeksMap);
56
+ clippedRanges.forEach((r) => {
57
+ for (const x = r.start.clone(); x.isSameOrBefore(r.end); x.add(1, "week")) {
58
+ const key = x.toISOString();
59
+ activeWeeksMap.set(key, true);
60
+ }
61
+ });
62
+ const weeks = Array.from(activeWeeksMap.entries()).sort((a, b) => moment.utc(a[0]).diff(moment.utc(b[0]))).map((x) => x[1] ? "1" : "0").join("");
63
+ const overlaps = weeks.length <= 64 ? weeks : "";
64
+ return {
65
+ id,
66
+ weeks,
67
+ overlaps
68
+ };
69
+ });
70
+ if (weeksMap.size > 64 && out && out.length <= 64) for (let i = 0; i < out.length; i++) {
71
+ let overlaps = "";
72
+ for (let j = 0; j < out.length; j++) {
73
+ if (i == j) {
74
+ overlaps += "1";
75
+ continue;
76
+ }
77
+ let overlap = false;
78
+ for (let k = 0; k < out[i].weeks.length; k++) if (out[i].weeks[k] === "1" && out[j].weeks[k] === "1") {
79
+ overlap = true;
80
+ break;
81
+ }
82
+ overlaps += overlap ? "1" : "0";
83
+ }
84
+ out[i].overlaps = overlaps;
85
+ }
86
+ return out;
87
+ }
45
88
 
46
89
  //#endregion
47
- export { DEFAULT_PERIOD_ID, parsePeriods };
90
+ export { DEFAULT_PERIOD_ID, _parsePeriods, parsePeriods };
48
91
  //# sourceMappingURL=periods.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"periods.js","names":["x"],"sources":["../../../../src/RS/to/input/periods.ts"],"sourcesContent":["import { groupBy } from 'lodash-es';\nimport moment from 'moment';\nimport { getIdKey, getVertexId } from '../../../core/util';\nimport type { Interval } from '../../../core/types/common/intervals';\nimport type { ConnectedTypes } from '../../make-connected';\nimport type { Types } from '../../types';\nimport { anyRangesOverlap } from '../../../common/functions';\nimport { makeChainable } from '../../../common/make-chainable';\n\ntype Range = Partial<Interval<string | moment.Moment | Date>>;\ntype DateRange = Interval<moment.Moment>;\n\nfunction createRange ({ start, end }: Range): DateRange {\n return {\n start: moment.utc(start).clone()\n .startOf('isoWeek')\n .startOf('day'),\n end: moment.utc(end).clone()\n .endOf ('isoWeek')\n .endOf ('day')\n };\n}\n\ntype Out = {\n map: Map<string | undefined, number>,\n matrix?: string\n};\n\n/**\n * Used by the default values as the id if no period is specified.\n */\nexport const DEFAULT_PERIOD_ID = 'DEFAULT_PERIOD';\n\nexport function parsePeriods (\n periods: ConnectedTypes.period[] | undefined,\n division: ConnectedTypes.division,\n options: Types.parsedToOptions\n): Out {\n const idKey = getIdKey(options);\n\n // if empty periods are given, return empty map only\n if (!periods?.length) {\n return { map: new Map<string | undefined, number>() };\n }\n\n // convert the ranges to moment ranges\n const parsedPeriods = periods.map(x => ({ id: getVertexId(x, idKey) as string | undefined, ranges: x.ranges.map(r => createRange(r)) }));\n\n // add default period that includes all weeks\n parsedPeriods.push({ id: DEFAULT_PERIOD_ID, ranges: [createRange(division)] });\n\n // Compute a pairwise binary overlapping string for each periods and group those that have identical such string.\n // The latter so that the number of periods may be reduced by omitting periods that overlap identically\n const grouped = makeChainable(parsedPeriods)\n .chain(\n x => x\n .map(x => ({\n ...x,\n overlap: parsedPeriods.map(y => anyRangesOverlap(x.ranges, y.ranges) ? '1' : '0').join('')\n })),\n x => groupBy(x, x => x.overlap),\n x => Object.values(x)\n .map((x, i) => ({ ids: x.map(x => x.id), index: i, ranges: x[0].ranges }))\n )\n .value;\n\n // Merge the pairwise binary overlapping string and store it as a matrix string.\n const matrix = grouped\n .map(x => grouped\n .map(y => anyRangesOverlap(x.ranges, y.ranges) ? '1' : '0')\n .join('')\n )\n .join('');\n\n if (matrix == '' || matrix == '0') {\n throw new Error('(RS::To::parsePeriods) invalid matrix value: ' + matrix);\n }\n\n // Also store in a map what period id corresponds to which row in the matrix.\n const indexMap = new Map(\n grouped.flatMap(xs => xs.ids.map(id => ([id, xs.index]) as const))\n );\n\n return { map: indexMap, matrix };\n}\n\n"],"mappings":";;;;;;;AAYA,SAAS,YAAa,EAAE,OAAO,OAAyB;AACtD,QAAO;EACL,OAAO,OAAO,IAAI,OAAO,QACtB,QAAQ,WACR,QAAQ;EACX,KAAK,OAAO,IAAI,KAAK,QAClB,MAAQ,WACR,MAAQ;;;;;;AAYf,MAAa,oBAAoB;AAEjC,SAAgB,aACd,SACA,UACA,SACK;CACL,MAAM,QAAQ,SAAS;AAGvB,KAAI,CAAC,SAAS,OACZ,QAAO,EAAE,qBAAK,IAAI;CAIpB,MAAM,gBAAgB,QAAQ,KAAI,OAAM;EAAE,IAAI,YAAY,GAAG;EAA8B,QAAQ,EAAE,OAAO,KAAI,MAAK,YAAY;;AAGjI,eAAc,KAAK;EAAE,IAAI;EAAmB,QAAQ,CAAC,YAAY;;CAIjE,MAAM,UAAU,cAAc,eAC3B,OACC,MAAK,EACF,KAAI,SAAM;EACT,GAAGA;EACH,SAAS,cAAc,KAAI,MAAK,iBAAiBA,IAAE,QAAQ,EAAE,UAAU,MAAM,KAAK,KAAK;OAE3F,MAAK,QAAQ,IAAG,QAAKA,IAAE,WACvB,MAAK,OAAO,OAAO,GAChB,KAAK,KAAG,OAAO;EAAE,KAAKA,IAAE,KAAI,QAAKA,IAAE;EAAK,OAAO;EAAI,QAAQA,IAAE,GAAG;MAEpE;CAGH,MAAM,SAAS,QACZ,KAAI,MAAK,QACP,KAAI,MAAK,iBAAiB,EAAE,QAAQ,EAAE,UAAU,MAAM,KACtD,KAAK,KAEP,KAAK;AAER,KAAI,UAAU,MAAM,UAAU,IAC5B,OAAM,IAAI,MAAM,kDAAkD;CAIpE,MAAM,WAAW,IAAI,IACnB,QAAQ,SAAQ,OAAM,GAAG,IAAI,KAAI,OAAO,CAAC,IAAI,GAAG;AAGlD,QAAO;EAAE,KAAK;EAAU"}
1
+ {"version":3,"file":"periods.js","names":["x"],"sources":["../../../../src/RS/to/input/periods.ts"],"sourcesContent":["import { groupBy } from 'lodash-es';\nimport moment from 'moment';\nimport { getIdKey, getVertexId } from '../../../core/util';\nimport type { Interval } from '../../../core/types/common/intervals';\nimport type { ConnectedTypes } from '../../make-connected';\nimport type { Types } from '../../types';\nimport { anyRangesOverlap, rangesOverlap } from '../../../common/functions';\nimport { makeChainable } from '../../../common/make-chainable';\n\ntype Range = Partial<Interval<string | moment.Moment | Date>>;\ntype DateRange = Interval<moment.Moment>;\n\nfunction createRange ({ start, end }: Range): DateRange {\n return {\n start: moment.utc(start).clone().startOf('isoWeek'),\n end: moment.utc(end ).clone().endOf ('isoWeek')\n };\n}\n\ntype Out = {\n map: Map<string | undefined, number>,\n matrix?: string\n};\n\n/**\n * Used by the default values as the id if no period is specified.\n */\nexport const DEFAULT_PERIOD_ID = 'DEFAULT_PERIOD';\n\nexport function parsePeriods (\n periods: ConnectedTypes.period[] | undefined,\n division: ConnectedTypes.division,\n options: Types.parsedToOptions\n): Out {\n const idKey = getIdKey(options);\n\n // if empty periods are given, return empty map only\n if (!periods?.length) {\n return { map: new Map<string | undefined, number>() };\n }\n\n // convert the ranges to moment ranges\n const parsedPeriods = periods.map(x => ({ id: getVertexId(x, idKey) as string | undefined, ranges: x.ranges.map(r => createRange(r)) }));\n\n // add default period that includes all weeks\n parsedPeriods.push({ id: DEFAULT_PERIOD_ID, ranges: [createRange(division)] });\n\n // Compute a pairwise binary overlapping string for each periods and group those that have identical such string.\n // The latter so that the number of periods may be reduced by omitting periods that overlap identically\n const grouped = makeChainable(parsedPeriods)\n .chain(\n x => x\n .map(x => ({\n ...x,\n overlap: parsedPeriods.map(y => anyRangesOverlap(x.ranges, y.ranges) ? '1' : '0').join('')\n })),\n x => groupBy(x, x => x.overlap),\n x => Object.values(x)\n .map((x, i) => ({ ids: x.map(x => x.id), index: i, ranges: x[0].ranges }))\n )\n .value;\n\n // Merge the pairwise binary overlapping string and store it as a matrix string.\n const matrix = grouped\n .map(x => grouped\n .map(y => anyRangesOverlap(x.ranges, y.ranges) ? '1' : '0')\n .join('')\n )\n .join('');\n\n if (matrix == '' || matrix == '0') {\n throw new Error('(RS::To::parsePeriods) invalid matrix value: ' + matrix);\n }\n\n // Also store in a map what period id corresponds to which row in the matrix.\n const indexMap = new Map(\n grouped.flatMap(xs => xs.ids.map(id => ([id, xs.index]) as const))\n );\n\n return { map: indexMap, matrix };\n}\n\n\nexport function _parsePeriods (\n periods: ConnectedTypes.period[] | undefined,\n division: ConnectedTypes.division,\n options: Types.parsedToOptions\n): Types.period[] | undefined {\n const divisionRange = createRange(division);\n\n // build a mapping of week starts to boolean active flags\n const weeksMap = new Map<string, boolean>();\n for (const x = divisionRange.start.clone(); x.isSameOrBefore(divisionRange.end); x.add(1, 'week')) {\n weeksMap.set(x.toISOString(), false);\n }\n\n const out = periods?.map((p): Types.period => {\n const id = getVertexId(p, options);\n\n // preserve only the ranges that lay within the division range\n const clippedRanges = p.ranges\n .map(r => createRange(r))\n .filter(r => rangesOverlap(r, divisionRange))\n .map(r => ({\n start: moment.max(r.start, divisionRange.start).clone(),\n end: moment.min(r.end, divisionRange.end ).clone()\n }));\n\n // get the active weeks by checking which weeks in the division are covered by the clipped ranges\n const activeWeeksMap = new Map(weeksMap);\n clippedRanges.forEach(r => {\n for (const x = r.start.clone(); x.isSameOrBefore(r.end); x.add(1, 'week')) {\n const key = x.toISOString();\n activeWeeksMap.set(key, true);\n }\n });\n\n // build the active weeks string\n const weeks = Array.from(activeWeeksMap.entries())\n .sort((a, b) => moment.utc(a[0]).diff(moment.utc(b[0])))\n .map(x => x[1] ? '1' : '0')\n .join('');\n\n const overlaps = weeks.length <= 64 ? weeks : '';\n\n return { id, weeks, overlaps };\n });\n\n // If there are more than 64 weeks but less than or equal to 64 periods, we compute the overlap between periods directly.\n if (weeksMap.size > 64 && out && out.length <= 64) {\n for (let i = 0; i < out.length; i++) {\n let overlaps = '';\n for (let j = 0; j < out.length; j++) {\n // self-overlap\n if (i == j) {\n overlaps += '1';\n continue;\n }\n\n // overlap with other periods\n let overlap = false;\n for (let k = 0; k < out[i].weeks.length; k++) {\n if (out[i].weeks[k] === '1' && out[j].weeks[k] === '1') {\n overlap = true;\n break;\n }\n }\n overlaps += overlap ? '1' : '0';\n }\n out[i].overlaps = overlaps;\n }\n }\n\n return out;\n}"],"mappings":"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"}
@@ -5,8 +5,11 @@ function parseSettings(settings) {
5
5
  return {
6
6
  numDays: settings.numDays,
7
7
  discretization: settings.discretization,
8
+ periodIdKey: "id",
9
+ intervalIdKey: "id",
8
10
  dependencyIdKey: "id",
9
11
  groupIdKey: "id",
12
+ individualIdKey: "id",
10
13
  collectionIdKey: "id",
11
14
  eventIdKey: "id"
12
15
  };
@@ -1 +1 @@
1
- {"version":3,"file":"settings.js","names":[],"sources":["../../../../src/RS/to/input/settings.ts"],"sourcesContent":["import type { Types } from '../../types';\nimport type { ConnectedTypes } from '../../make-connected';\n\nexport function parseSettings (settings: ConnectedTypes.divisionSettings): Types.settings {\n\n if (!settings.numDays) throw new Error('(RS::To::parseSettings) numDays is falsy');\n if (!settings.discretization) throw new Error('(RS::To::parseSettings) discretization is falsy');\n\n return {\n numDays: settings.numDays,\n discretization: settings.discretization,\n\n dependencyIdKey: 'id',\n groupIdKey: 'id',\n collectionIdKey: 'id',\n eventIdKey: 'id'\n };\n};"],"mappings":";AAGA,SAAgB,cAAe,UAA2D;AAExF,KAAI,CAAC,SAAS,QAAgB,OAAM,IAAI,MAAM;AAC9C,KAAI,CAAC,SAAS,eAAgB,OAAM,IAAI,MAAM;AAE9C,QAAO;EACL,SAAgB,SAAS;EACzB,gBAAgB,SAAS;EAEzB,iBAAiB;EACjB,YAAiB;EACjB,iBAAiB;EACjB,YAAiB"}
1
+ {"version":3,"file":"settings.js","names":[],"sources":["../../../../src/RS/to/input/settings.ts"],"sourcesContent":["import type { Types } from '../../types';\nimport type { ConnectedTypes } from '../../make-connected';\n\nexport function parseSettings (settings: ConnectedTypes.divisionSettings): Types.settings {\n\n if (!settings.numDays) throw new Error('(RS::To::parseSettings) numDays is falsy');\n if (!settings.discretization) throw new Error('(RS::To::parseSettings) discretization is falsy');\n\n return {\n numDays: settings.numDays,\n discretization: settings.discretization,\n\n periodIdKey: 'id',\n intervalIdKey: 'id',\n dependencyIdKey: 'id',\n groupIdKey: 'id',\n individualIdKey: 'id',\n collectionIdKey: 'id',\n eventIdKey: 'id',\n };\n};"],"mappings":";AAGA,SAAgB,cAAe,UAA2D;AAExF,KAAI,CAAC,SAAS,QAAgB,OAAM,IAAI,MAAM;AAC9C,KAAI,CAAC,SAAS,eAAgB,OAAM,IAAI,MAAM;AAE9C,QAAO;EACL,SAAgB,SAAS;EACzB,gBAAgB,SAAS;EAEzB,aAAiB;EACjB,eAAiB;EACjB,iBAAiB;EACjB,YAAiB;EACjB,iBAAiB;EACjB,iBAAiB;EACjB,YAAiB"}
@@ -25,7 +25,7 @@ function schedules(data, _options = {}) {
25
25
  const connectedData = makeConnected(data);
26
26
  return {
27
27
  meta: {
28
- structure: "RS/algorithm-3.0.0",
28
+ structure: "RS/algorithm-5.0.0",
29
29
  division: pick(data.division, "displayName", "start", "end")
30
30
  },
31
31
  algorithmParameters: { weights: options.algorithmWeightParameters },
@@ -1 +1 @@
1
- {"version":3,"file":"schedules.js","names":["partialScheduleOptions: Types.parsedToOptions['partialScheduleOptions']"],"sources":["../../../src/RS/to/schedules.ts"],"sourcesContent":["import { pick } from 'lodash-es';\nimport { parseInput } from './input/input';\nimport { makeConnected } from '../make-connected';\nimport { initialConfiguration } from './initial-configuration';\nimport type { Types } from '../types';\nimport { CoreMap } from '../../core';\n\nexport function schedules (\n data: Types.toInput,\n _options: Types.toOptions = {}\n): Types.toOutput {\n ////\n //// parse the options\n ////\n const options = ((): Types.parsedToOptions => {\n const x = _options.partialScheduleOptions;\n const partialScheduleOptions: Types.parsedToOptions['partialScheduleOptions'] = x\n ? {\n includedEvents: x.includedEvents ? new Set(x.includedEvents) : undefined,\n includedLocations: x.includedLocations ? new Set(x.includedLocations) : undefined,\n omittedEventsHandling: x.omittedEventsHandling\n }\n : undefined;\n\n return { ..._options, partialScheduleOptions };\n })();\n\n ////\n //// for backward compatibility: add default collection to included events set\n ////\n if (options.partialScheduleOptions?.includedEvents?.size) {\n options.partialScheduleOptions.includedEvents = new Set(\n [...options.partialScheduleOptions.includedEvents]\n .map(x => {\n // should start with 'events.' or 'lockedTimes.' prefix\n if (x.startsWith('events.') || x.startsWith('lockedTimes.')) return x;\n return `events.${x}`;\n })\n );\n }\n\n\n // we will work only with connected schedule data\n const connectedData = makeConnected(data);\n\n return {\n meta: {\n structure: 'RS/algorithm-3.0.0' satisfies Types.structure,\n division: pick(data.division, 'displayName', 'start', 'end'),\n },\n algorithmParameters: {\n weights: options.algorithmWeightParameters,\n },\n input: parseInput(connectedData, options),\n ...options.appendCoreData && { coreData: CoreMap.to.schedules(data) },\n ...options.appendOutput && { output: initialConfiguration(connectedData.events, connectedData.lockedTimes, options) },\n };\n};"],"mappings":";;;;;;;AAOA,SAAgB,UACd,MACA,WAA4B,IACZ;CAIhB,MAAM,iBAAwC;EAC5C,MAAM,IAAI,SAAS;EACnB,MAAMA,yBAA0E,IAC5E;GACA,gBAAuB,EAAE,iBAAoB,IAAI,IAAI,EAAE,kBAAqB;GAC5E,mBAAuB,EAAE,oBAAoB,IAAI,IAAI,EAAE,qBAAqB;GAC5E,uBAAuB,EAAE;MAEzB;AAEJ,SAAO;GAAE,GAAG;GAAU;;;AAMxB,KAAI,QAAQ,wBAAwB,gBAAgB,KAClD,SAAQ,uBAAuB,iBAAiB,IAAI,IAClD,CAAC,GAAG,QAAQ,uBAAuB,gBAChC,KAAI,MAAK;AAER,MAAI,EAAE,WAAW,cAAc,EAAE,WAAW,gBAAiB,QAAO;AACpE,SAAO,UAAU;;CAOzB,MAAM,gBAAgB,cAAc;AAEpC,QAAO;EACL,MAAM;GACJ,WAAW;GACX,UAAW,KAAK,KAAK,UAAU,eAAe,SAAS;;EAEzD,qBAAqB,EACnB,SAAS,QAAQ;EAEnB,OAAO,WAAW,eAAe;EACjC,GAAG,QAAQ,kBAAkB,EAAE,UAAU,QAAQ,GAAG,UAAU;EAC9D,GAAG,QAAQ,gBAAkB,EAAE,QAAQ,qBAAqB,cAAc,QAAQ,cAAc,aAAa"}
1
+ {"version":3,"file":"schedules.js","names":["partialScheduleOptions: Types.parsedToOptions['partialScheduleOptions']"],"sources":["../../../src/RS/to/schedules.ts"],"sourcesContent":["import { pick } from 'lodash-es';\nimport { parseInput } from './input/input';\nimport { makeConnected } from '../make-connected';\nimport { initialConfiguration } from './initial-configuration';\nimport type { Types } from '../types';\nimport { CoreMap } from '../../core';\n\nexport function schedules (\n data: Types.toInput,\n _options: Types.toOptions = {}\n): Types.toOutput {\n ////\n //// parse the options\n ////\n const options = ((): Types.parsedToOptions => {\n const x = _options.partialScheduleOptions;\n const partialScheduleOptions: Types.parsedToOptions['partialScheduleOptions'] = x\n ? {\n includedEvents: x.includedEvents ? new Set(x.includedEvents) : undefined,\n includedLocations: x.includedLocations ? new Set(x.includedLocations) : undefined,\n omittedEventsHandling: x.omittedEventsHandling\n }\n : undefined;\n\n return { ..._options, partialScheduleOptions };\n })();\n\n ////\n //// for backward compatibility: add default collection to included events set\n ////\n if (options.partialScheduleOptions?.includedEvents?.size) {\n options.partialScheduleOptions.includedEvents = new Set(\n [...options.partialScheduleOptions.includedEvents]\n .map(x => {\n // should start with 'events.' or 'lockedTimes.' prefix\n if (x.startsWith('events.') || x.startsWith('lockedTimes.')) return x;\n return `events.${x}`;\n })\n );\n }\n\n\n // we will work only with connected schedule data\n const connectedData = makeConnected(data);\n\n return {\n meta: {\n structure: 'RS/algorithm-5.0.0' satisfies Types.structure,\n division: pick(data.division, 'displayName', 'start', 'end'),\n },\n algorithmParameters: {\n weights: options.algorithmWeightParameters,\n },\n input: parseInput(connectedData, options),\n ...options.appendCoreData && { coreData: CoreMap.to.schedules(data) },\n ...options.appendOutput && { output: initialConfiguration(connectedData.events, connectedData.lockedTimes, options) },\n };\n};"],"mappings":";;;;;;;AAOA,SAAgB,UACd,MACA,WAA4B,IACZ;CAIhB,MAAM,iBAAwC;EAC5C,MAAM,IAAI,SAAS;EACnB,MAAMA,yBAA0E,IAC5E;GACA,gBAAuB,EAAE,iBAAoB,IAAI,IAAI,EAAE,kBAAqB;GAC5E,mBAAuB,EAAE,oBAAoB,IAAI,IAAI,EAAE,qBAAqB;GAC5E,uBAAuB,EAAE;MAEzB;AAEJ,SAAO;GAAE,GAAG;GAAU;;;AAMxB,KAAI,QAAQ,wBAAwB,gBAAgB,KAClD,SAAQ,uBAAuB,iBAAiB,IAAI,IAClD,CAAC,GAAG,QAAQ,uBAAuB,gBAChC,KAAI,MAAK;AAER,MAAI,EAAE,WAAW,cAAc,EAAE,WAAW,gBAAiB,QAAO;AACpE,SAAO,UAAU;;CAOzB,MAAM,gBAAgB,cAAc;AAEpC,QAAO;EACL,MAAM;GACJ,WAAW;GACX,UAAW,KAAK,KAAK,UAAU,eAAe,SAAS;;EAEzD,qBAAqB,EACnB,SAAS,QAAQ;EAEnB,OAAO,WAAW,eAAe;EACjC,GAAG,QAAQ,kBAAkB,EAAE,UAAU,QAAQ,GAAG,UAAU;EAC9D,GAAG,QAAQ,gBAAkB,EAAE,QAAQ,qBAAqB,cAAc,QAAQ,cAAc,aAAa"}
@@ -16,7 +16,14 @@ interface Collection {
16
16
  days?: (Types.day | number)[];
17
17
  groups?: Types.groupReference[][];
18
18
  dependencies?: (Types.availableDependency[] | Types.availableDependency)[];
19
+ /**
20
+ * @deprecated to be replaced by `_period` in future versions
21
+ */
19
22
  period?: number;
23
+ /**
24
+ * @deprecated to be renamed to `period` in future versions
25
+ */
26
+ _period?: string;
20
27
  maxEventLengthVariance?: number;
21
28
  distributionKey?: string | string[];
22
29
  meta?: Record<string, unknown>;
@@ -17,7 +17,14 @@ interface Default {
17
17
  groupWeight: number;
18
18
  collectionWeight: number;
19
19
  eventWeight: number;
20
+ /**
21
+ * @deprecated To be replaced by `_period` in future versions
22
+ */
20
23
  period?: number;
24
+ /**
25
+ * @deprecated To be renamed `period` in future versions
26
+ */
27
+ _period?: string;
21
28
  }
22
29
  //#endregion
23
30
  export { Default };
@@ -17,7 +17,14 @@ interface Event {
17
17
  day?: number;
18
18
  groups?: Types.groupReference[][];
19
19
  dependencies?: (Types.availableDependency[] | Types.availableDependency | string | string[])[];
20
+ /**
21
+ * @deprecated to be replaced by `_period` in future versions
22
+ */
20
23
  period?: number;
24
+ /**
25
+ * @deprecated to be renamed to `period` in future versions
26
+ */
27
+ _period?: string;
21
28
  forcedOverlapId?: string;
22
29
  distributionKey?: string | string[];
23
30
  meta?: Record<string, unknown>;
@@ -7,6 +7,7 @@ import { LockedTime } from "./locked-times.js";
7
7
  import { RootInterval } from "./root-intervals.js";
8
8
  import { Settings } from "./settings.js";
9
9
  import { Event } from "./events.js";
10
+ import { Period } from "./period.js";
10
11
  import { AvailableDependency, BreakLength, Day, GroupReference, Interval } from "./shared.js";
11
12
  import { ParsedToOptions, Structure, ToInput, ToOptions, ToOutput } from "./to.js";
12
13
  import { EventConfiguration } from "./event-configuration.js";
@@ -17,7 +18,11 @@ import { ScheduleData } from "./schedule-data.js";
17
18
  declare namespace Types {
18
19
  type settings = Settings;
19
20
  type defaultValues = Default;
21
+ /**
22
+ * @deprecated To be replaced by `Types.period` in future versions
23
+ */
20
24
  type periods = string;
25
+ type period = Period;
21
26
  type rootInterval = RootInterval;
22
27
  type dependency = Dependency;
23
28
  type group = Group;
@@ -0,0 +1,27 @@
1
+ //#region src/RS/types/period.d.ts
2
+ type Period = {
3
+ id: string;
4
+ /**
5
+ * A binary string (containing only ones and zeros) representing the weeks this period is active in. All periods `weeks` strings
6
+ * have the same length to make it unambiguous which week each position corresponds to.
7
+ */
8
+ weeks: string;
9
+ /**
10
+ * The logical and operation between two period's binary `overlaps` strings is used to determine whether they overlap,
11
+ * i.e., are active during at least one common week.
12
+ *
13
+ * There are three cases for the format of this string:
14
+ *
15
+ * 1. If there are less than 64 weeks this string is simply a copy of the `weeks` string.
16
+ *
17
+ * 2. If there are more than 64 weeks but less than or equal to 64 periods, we compute the overlaps directly. This binary string
18
+ * then has the same length as the number of periods and a '1' at position j indicates that the period overlaps with the one whose
19
+ * index is j. There is at least one '1' in the string at the position corresponding to its own index (self-overlap).
20
+ *
21
+ * 3. If there are more than 64 weeks and more than 64 periods this string is empty, as the overlaps cannot not be stored in 64 bits.
22
+ */
23
+ overlaps: string;
24
+ };
25
+ //#endregion
26
+ export { Period };
27
+ //# sourceMappingURL=period.d.ts.map
@@ -4,7 +4,14 @@ import { Types } from "./index.js";
4
4
  interface ScheduleData {
5
5
  settings?: Types.settings;
6
6
  default?: Types.defaultValues;
7
+ /**
8
+ * @deprecated To be replaced by `periodsList` in future versions
9
+ */
7
10
  periods?: string;
11
+ /**
12
+ * @deprecated To be renamed `periods` in future versions
13
+ */
14
+ _periods?: Types.period[];
8
15
  events?: (Types.event | Types.collection | (Types.event | Types.collection)[])[];
9
16
  groups?: Types.group[];
10
17
  dependencies?: Types.dependency[];
@@ -2,8 +2,11 @@
2
2
  interface Settings {
3
3
  numDays: number;
4
4
  discretization: number;
5
+ periodIdKey: 'id';
6
+ intervalIdKey: 'id';
5
7
  dependencyIdKey: 'id';
6
8
  groupIdKey: 'id';
9
+ individualIdKey: 'id';
7
10
  collectionIdKey: 'id';
8
11
  eventIdKey: 'id';
9
12
  }
@@ -40,7 +40,7 @@ interface ToOptions extends BaseOptions {
40
40
  interface ParsedToOptions extends Omit<ToOptions, 'partialScheduleOptions'> {
41
41
  partialScheduleOptions?: PartialScheduleOptions<Set<string>>;
42
42
  }
43
- type Structure = 'RS/algorithm-3.0.0';
43
+ type Structure = 'RS/algorithm-5.0.0';
44
44
  interface ToOutput {
45
45
  meta: {
46
46
  structure?: Structure;
@@ -0,0 +1,12 @@
1
+ //#region src/core/from/configurations.ts
2
+ var configurations_default = (configurations) => {
3
+ if (configurations.length != new Set(configurations.map((x) => x.id)).size) throw new Error("(Core::From::V2::Configurations) Configuration array have two or more configurations with the same ID");
4
+ return configurations.map((x) => {
5
+ if (!x.id) throw new Error("(Core::From::V2::Configurations) Configuration id is undefined");
6
+ return { ...x };
7
+ });
8
+ };
9
+
10
+ //#endregion
11
+ export { configurations_default as default };
12
+ //# sourceMappingURL=configurations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configurations.js","names":[],"sources":["../../../src/core/from/configurations.ts"],"sourcesContent":["import type transform from '../to/configurations';\n\nexport default (configurations: ReturnType<typeof transform>) => {\n if (configurations.length != new Set(configurations.map(x => x.id)).size)\n throw new Error('(Core::From::V2::Configurations) Configuration array have two or more configurations with the same ID');\n\n return configurations\n .map(x => {\n if (!x.id)\n throw new Error('(Core::From::V2::Configurations) Configuration id is undefined');\n\n return { ...x };\n });\n};\n"],"mappings":";AAEA,8BAAgB,mBAAiD;AAC/D,KAAI,eAAe,UAAU,IAAI,IAAI,eAAe,KAAI,MAAK,EAAE,KAAK,KAClE,OAAM,IAAI,MAAM;AAElB,QAAO,eACJ,KAAI,MAAK;AACR,MAAI,CAAC,EAAE,GACL,OAAM,IAAI,MAAM;AAElB,SAAO,EAAE,GAAG"}
@@ -10,6 +10,7 @@ import locked_times_default from "./locked-times.js";
10
10
  import root_intervals_default from "./root-intervals.js";
11
11
  import events_default from "./events.js";
12
12
  import syllabuses_default from "./syllabuses.js";
13
+ import configurations_default from "./configurations.js";
13
14
 
14
15
  //#region src/core/from/schedules.ts
15
16
  function schedules_default(schedule) {
@@ -26,7 +27,8 @@ function schedules_default(schedule) {
26
27
  ...schedule.lockedTimes && { lockedTimes: locked_times_default(schedule.lockedTimes) },
27
28
  ...schedule.rootIntervals && { rootIntervals: root_intervals_default(schedule.rootIntervals) },
28
29
  ...schedule.exceptions && { exceptions: exceptions_default(schedule.exceptions) },
29
- ...schedule.syllabuses && { syllabuses: syllabuses_default(schedule.syllabuses) }
30
+ ...schedule.syllabuses && { syllabuses: syllabuses_default(schedule.syllabuses) },
31
+ ...schedule.configurations && { configurations: configurations_default(schedule.configurations) }
30
32
  };
31
33
  }
32
34
 
@@ -1 +1 @@
1
- {"version":3,"file":"schedules.js","names":["_periods","_groups","_teachers","_persons","_locations","_courses","_events","_overlapGroups","_lockedTimes","_rootIntervals","_exceptions","_syllabuses"],"sources":["../../../src/core/from/schedules.ts"],"sourcesContent":["import _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 _overlapGroups from './overlap-groups';\nimport _lockedTimes from './locked-times';\nimport _rootIntervals from './root-intervals';\nimport _events from './events';\nimport _syllabuses from './syllabuses';\nimport type transform from '../to/schedules';\n\nexport default function (schedule: ReturnType<typeof transform>): Omit<ReturnType<typeof transform>, 'meta'> {\n return {\n ...schedule.settings && { settings: schedule.settings },\n ...schedule.periods && { periods: _periods (schedule.periods ) },\n ...schedule.groups && { groups: _groups (schedule.groups ) },\n ...schedule.teachers && { teachers: _teachers (schedule.teachers ) },\n ...schedule.persons && { persons: _persons (schedule.persons ) },\n ...schedule.locations && { locations: _locations (schedule.locations ) },\n ...schedule.courses && { courses: _courses (schedule.courses ) },\n ...schedule.events && { events: _events (schedule.events ) },\n ...schedule.overlapGroups && { overlapGroups: _overlapGroups(schedule.overlapGroups) },\n ...schedule.lockedTimes && { lockedTimes: _lockedTimes (schedule.lockedTimes ) },\n ...schedule.rootIntervals && { rootIntervals: _rootIntervals(schedule.rootIntervals) },\n ...schedule.exceptions && { exceptions: _exceptions (schedule.exceptions ) },\n ...schedule.syllabuses && { syllabuses: _syllabuses (schedule.syllabuses ) }\n };\n}"],"mappings":";;;;;;;;;;;;;;AAcA,2BAAyB,UAAoF;AAC3G,QAAO;EACL,GAAG,SAAS,YAAiB,EAAE,UAA8B,SAAS;EACtE,GAAG,SAAS,WAAiB,EAAE,SAAeA,gBAAe,SAAS;EACtE,GAAG,SAAS,UAAiB,EAAE,QAAeC,eAAe,SAAS;EACtE,GAAG,SAAS,YAAiB,EAAE,UAAeC,iBAAe,SAAS;EACtE,GAAG,SAAS,WAAiB,EAAE,SAAeC,gBAAe,SAAS;EACtE,GAAG,SAAS,aAAiB,EAAE,WAAeC,kBAAe,SAAS;EACtE,GAAG,SAAS,WAAiB,EAAE,SAAeC,gBAAe,SAAS;EACtE,GAAG,SAAS,UAAiB,EAAE,QAAeC,eAAe,SAAS;EACtE,GAAG,SAAS,iBAAiB,EAAE,eAAeC,uBAAe,SAAS;EACtE,GAAG,SAAS,eAAiB,EAAE,aAAeC,qBAAe,SAAS;EACtE,GAAG,SAAS,iBAAiB,EAAE,eAAeC,uBAAe,SAAS;EACtE,GAAG,SAAS,cAAiB,EAAE,YAAeC,mBAAe,SAAS;EACtE,GAAG,SAAS,cAAiB,EAAE,YAAeC,mBAAe,SAAS"}
1
+ {"version":3,"file":"schedules.js","names":["_periods","_groups","_teachers","_persons","_locations","_courses","_events","_overlapGroups","_lockedTimes","_rootIntervals","_exceptions","_syllabuses","_configurations"],"sources":["../../../src/core/from/schedules.ts"],"sourcesContent":["import _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 _overlapGroups from './overlap-groups';\nimport _lockedTimes from './locked-times';\nimport _rootIntervals from './root-intervals';\nimport _events from './events';\nimport _syllabuses from './syllabuses';\nimport _configurations from './configurations';\nimport type transform from '../to/schedules';\n\nexport default function (schedule: ReturnType<typeof transform>): Omit<ReturnType<typeof transform>, 'meta'> {\n return {\n ...schedule.settings && { settings: schedule.settings },\n ...schedule.periods && { periods: _periods (schedule.periods ) },\n ...schedule.groups && { groups: _groups (schedule.groups ) },\n ...schedule.teachers && { teachers: _teachers (schedule.teachers ) },\n ...schedule.persons && { persons: _persons (schedule.persons ) },\n ...schedule.locations && { locations: _locations (schedule.locations ) },\n ...schedule.courses && { courses: _courses (schedule.courses ) },\n ...schedule.events && { events: _events (schedule.events ) },\n ...schedule.overlapGroups && { overlapGroups: _overlapGroups (schedule.overlapGroups ) },\n ...schedule.lockedTimes && { lockedTimes: _lockedTimes (schedule.lockedTimes ) },\n ...schedule.rootIntervals && { rootIntervals: _rootIntervals (schedule.rootIntervals ) },\n ...schedule.exceptions && { exceptions: _exceptions (schedule.exceptions ) },\n ...schedule.syllabuses && { syllabuses: _syllabuses (schedule.syllabuses ) },\n ...schedule.configurations && { configurations: _configurations(schedule.configurations) }\n };\n}"],"mappings":";;;;;;;;;;;;;;;AAeA,2BAAyB,UAAoF;AAC3G,QAAO;EACL,GAAG,SAAS,YAAkB,EAAE,UAA+B,SAAS;EACxE,GAAG,SAAS,WAAkB,EAAE,SAAgBA,gBAAgB,SAAS;EACzE,GAAG,SAAS,UAAkB,EAAE,QAAgBC,eAAgB,SAAS;EACzE,GAAG,SAAS,YAAkB,EAAE,UAAgBC,iBAAgB,SAAS;EACzE,GAAG,SAAS,WAAkB,EAAE,SAAgBC,gBAAgB,SAAS;EACzE,GAAG,SAAS,aAAkB,EAAE,WAAgBC,kBAAgB,SAAS;EACzE,GAAG,SAAS,WAAkB,EAAE,SAAgBC,gBAAgB,SAAS;EACzE,GAAG,SAAS,UAAkB,EAAE,QAAgBC,eAAgB,SAAS;EACzE,GAAG,SAAS,iBAAkB,EAAE,eAAgBC,uBAAgB,SAAS;EACzE,GAAG,SAAS,eAAkB,EAAE,aAAgBC,qBAAgB,SAAS;EACzE,GAAG,SAAS,iBAAkB,EAAE,eAAgBC,uBAAgB,SAAS;EACzE,GAAG,SAAS,cAAkB,EAAE,YAAgBC,mBAAgB,SAAS;EACzE,GAAG,SAAS,cAAkB,EAAE,YAAgBC,mBAAgB,SAAS;EACzE,GAAG,SAAS,kBAAkB,EAAE,gBAAgBC,uBAAgB,SAAS"}
@@ -0,0 +1,17 @@
1
+ import { internalKeysOmitted } from "./util.js";
2
+
3
+ //#region src/core/to/configurations.ts
4
+ var configurations_default = (configurations, _options) => {
5
+ return configurations.map((x) => {
6
+ const edges = {};
7
+ const nonEdges = internalKeysOmitted(x, edges);
8
+ return {
9
+ ...nonEdges,
10
+ ...edges
11
+ };
12
+ });
13
+ };
14
+
15
+ //#endregion
16
+ export { configurations_default as default };
17
+ //# sourceMappingURL=configurations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configurations.js","names":["edges: SerializedEdges<Types.period>"],"sources":["../../../src/core/to/configurations.ts"],"sourcesContent":["import type { Types } from '../types';\nimport type { OutTypes } from './schedules';\nimport { internalKeysOmitted } from './util';\nimport type { SerializedEdges, SerializedEdgesShape } from './util';\nimport type { BaseOptions } from '../../common/types';\n\nexport default (\n configurations: Types.mixed.configuration[],\n _options: BaseOptions\n): OutTypes.configuration[] => {\n return configurations\n .map(x => {\n const edges: SerializedEdges<Types.period> = {\n } satisfies SerializedEdgesShape<Types.period>;\n const nonEdges = internalKeysOmitted(x, edges);\n\n return { ...nonEdges, ...edges };\n });\n};\n"],"mappings":";;;AAMA,8BACE,gBACA,aAC6B;AAC7B,QAAO,eACJ,KAAI,MAAK;EACR,MAAMA,QAAuC;EAE7C,MAAM,WAAW,oBAAoB,GAAG;AAExC,SAAO;GAAE,GAAG;GAAU,GAAG"}
@@ -7,7 +7,6 @@ var courses_default = (courses, options) => {
7
7
  const edges = {
8
8
  period: x.period ? getVertexId(x.period, options) : void 0,
9
9
  overlapGroup: x.overlapGroup ? getVertexId(x.overlapGroup, options) : void 0,
10
- overlapSpecies: x.overlapSpecies ? getVertexId(x.overlapSpecies, options) : void 0,
11
10
  syllabus: x.syllabus ? getVertexId(x.syllabus, options) : void 0,
12
11
  events: x.events?.map((x$1) => getVertexId(x$1, options)),
13
12
  lockedTimes: x.lockedTimes?.map((x$1) => getVertexId(x$1, options)),
@@ -1 +1 @@
1
- {"version":3,"file":"courses.js","names":["edges: SerializedEdges<Types.course>","x"],"sources":["../../../src/core/to/courses.ts"],"sourcesContent":["import type { Types } from '../types';\nimport type { OutTypes } from './schedules';\nimport { getVertexId } from '../util';\nimport { internalKeysOmitted } from './util';\nimport type { SerializedEdges, SerializedEdgesShape } from './util';\nimport type { BaseOptions } from '../../common/types';\n\n\nexport default (\n courses: Types.mixed.course[],\n options: BaseOptions\n): OutTypes.course[] => {\n return courses\n .map(x => {\n const edges: SerializedEdges<Types.course> = {\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 syllabus: x.syllabus ? getVertexId(x.syllabus, options) : undefined,\n events: x.events ?.map(x => getVertexId(x, options)),\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 } satisfies SerializedEdgesShape<Types.course>;\n const nonEdges = internalKeysOmitted(x, edges);\n\n return { ...nonEdges, ...edges };\n });\n};\n"],"mappings":";;;;AAQA,uBACE,SACA,YACsB;AACtB,QAAO,QACJ,KAAI,MAAK;EACR,MAAMA,QAAuC;GAC3C,QAAgB,EAAE,SAAiB,YAAY,EAAE,QAAgB,WAAW;GAC5E,cAAgB,EAAE,eAAiB,YAAY,EAAE,cAAgB,WAAW;GAC5E,gBAAgB,EAAE,iBAAiB,YAAY,EAAE,gBAAgB,WAAW;GAC5E,UAAgB,EAAE,WAAiB,YAAY,EAAE,UAAgB,WAAW;GAC5E,QAAgB,EAAE,QAAc,KAAI,QAAK,YAAYC,KAAG;GACxD,aAAgB,EAAE,aAAc,KAAI,QAAK,YAAYA,KAAG;GACxD,YAAgB,EAAE,YAAc,KAAI,QAAK,YAAYA,KAAG;GACxD,UAAgB,EAAE,UAAc,KAAI,SAAM;IAAE,GAAGA;IAAG,IAAI,YAAYA,IAAE,IAAI;;GACxE,cAAgB,EAAE,cAAc,KAAI,SAAM;IAAE,GAAGA;IAAG,IAAI,YAAYA,IAAE,IAAI;;GACxE,QAAgB,EAAE,QAAc,KAAI,SAAM;IAAE,GAAGA;IAAG,IAAI,YAAYA,IAAE,IAAI;IAAU,SAASA,IAAE,SAAS,KAAI,MAAK,YAAY,GAAG;;GAC9H,WAAgB,EAAE,WAAc,KAAI,SAAM;IAAE,GAAGA;IAAG,WAAW,CAAC,YAAYA,IAAE,UAAU,IAAI;;;EAE5F,MAAM,WAAW,oBAAoB,GAAG;AAExC,SAAO;GAAE,GAAG;GAAU,GAAG"}
1
+ {"version":3,"file":"courses.js","names":["edges: SerializedEdges<Types.course>","x"],"sources":["../../../src/core/to/courses.ts"],"sourcesContent":["import type { Types } from '../types';\nimport type { OutTypes } from './schedules';\nimport { getVertexId } from '../util';\nimport { internalKeysOmitted } from './util';\nimport type { SerializedEdges, SerializedEdgesShape } from './util';\nimport type { BaseOptions } from '../../common/types';\n\n\nexport default (\n courses: Types.mixed.course[],\n options: BaseOptions\n): OutTypes.course[] => {\n return courses\n .map(x => {\n const edges: SerializedEdges<Types.course> = {\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 syllabus: x.syllabus ? getVertexId(x.syllabus, options) : undefined,\n events: x.events ?.map(x => getVertexId(x, options)),\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 } satisfies SerializedEdgesShape<Types.course>;\n const nonEdges = internalKeysOmitted(x, edges);\n\n return { ...nonEdges, ...edges };\n });\n};\n"],"mappings":";;;;AAQA,uBACE,SACA,YACsB;AACtB,QAAO,QACJ,KAAI,MAAK;EACR,MAAMA,QAAuC;GAC3C,QAAgB,EAAE,SAAiB,YAAY,EAAE,QAAgB,WAAW;GAC5E,cAAgB,EAAE,eAAiB,YAAY,EAAE,cAAgB,WAAW;GAE5E,UAAgB,EAAE,WAAiB,YAAY,EAAE,UAAgB,WAAW;GAC5E,QAAgB,EAAE,QAAc,KAAI,QAAK,YAAYC,KAAG;GACxD,aAAgB,EAAE,aAAc,KAAI,QAAK,YAAYA,KAAG;GACxD,YAAgB,EAAE,YAAc,KAAI,QAAK,YAAYA,KAAG;GACxD,UAAgB,EAAE,UAAc,KAAI,SAAM;IAAE,GAAGA;IAAG,IAAI,YAAYA,IAAE,IAAI;;GACxE,cAAgB,EAAE,cAAc,KAAI,SAAM;IAAE,GAAGA;IAAG,IAAI,YAAYA,IAAE,IAAI;;GACxE,QAAgB,EAAE,QAAc,KAAI,SAAM;IAAE,GAAGA;IAAG,IAAI,YAAYA,IAAE,IAAI;IAAU,SAASA,IAAE,SAAS,KAAI,MAAK,YAAY,GAAG;;GAC9H,WAAgB,EAAE,WAAc,KAAI,SAAM;IAAE,GAAGA;IAAG,WAAW,CAAC,YAAYA,IAAE,UAAU,IAAI;;;EAE5F,MAAM,WAAW,oBAAoB,GAAG;AAExC,SAAO;GAAE,GAAG;GAAU,GAAG"}
@@ -6,7 +6,6 @@ var events_default = (events, options) => {
6
6
  return events.map((x) => {
7
7
  const edges = {
8
8
  period: x.period ? getVertexId(x.period, options) : void 0,
9
- overlapGroup: x.overlapGroup ? getVertexId(x.overlapGroup, options) : void 0,
10
9
  overlapSpecies: x.overlapSpecies ? getVertexId(x.overlapSpecies, options) : void 0,
11
10
  course: x.course ? getVertexId(x.course, options) : void 0,
12
11
  lockedTimes: x.lockedTimes?.map((x$1) => getVertexId(x$1, options)),
@@ -1 +1 @@
1
- {"version":3,"file":"events.js","names":["edges: SerializedEdges<Types.event>","x"],"sources":["../../../src/core/to/events.ts"],"sourcesContent":["import type { Types } from '../types';\nimport type { OutTypes } from './schedules';\nimport { getVertexId } from '../util';\nimport type { SerializedEdges, SerializedEdgesShape } from './util';\nimport { internalKeysOmitted } from './util';\nimport type { BaseOptions } from '../../common/types';\n\nexport default (\n events: Types.mixed.event[],\n options: BaseOptions\n): OutTypes.event[] => {\n return events\n .map(x => {\n const edges: SerializedEdges<Types.event> = {\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 } satisfies SerializedEdgesShape<Types.event>;\n const nonEdges = internalKeysOmitted(x, edges);\n\n return { ...nonEdges, ...edges };\n });\n};\n\n"],"mappings":";;;;AAOA,sBACE,QACA,YACqB;AACrB,QAAO,OACJ,KAAI,MAAK;EACR,MAAMA,QAAsC;GAC1C,QAAgB,EAAE,SAAiB,YAAY,EAAE,QAAgB,WAAW;GAC5E,cAAgB,EAAE,eAAiB,YAAY,EAAE,cAAgB,WAAW;GAC5E,gBAAgB,EAAE,iBAAiB,YAAY,EAAE,gBAAgB,WAAW;GAC5E,QAAgB,EAAE,SAAiB,YAAY,EAAE,QAAgB,WAAW;GAC5E,aAAgB,EAAE,aAAc,KAAI,QAAK,YAAYC,KAAG;GACxD,YAAgB,EAAE,YAAc,KAAI,QAAK,YAAYA,KAAG;GACxD,UAAgB,EAAE,UAAc,KAAI,SAAM;IAAE,GAAGA;IAAG,IAAI,YAAYA,IAAE,IAAI;;GACxE,cAAgB,EAAE,cAAc,KAAI,SAAM;IAAE,GAAGA;IAAG,IAAI,YAAYA,IAAE,IAAI;;GACxE,QAAgB,EAAE,QAAc,KAAI,SAAM;IAAE,GAAGA;IAAG,IAAI,YAAYA,IAAE,IAAI;IAAU,SAASA,IAAE,SAAS,KAAI,MAAK,YAAY,GAAG;;GAC9H,WAAgB,EAAE,WAAc,KAAI,SAAM;IAAE,GAAGA;IAAG,WAAW,CAAC,YAAYA,IAAE,UAAU,IAAI;;GAC1F,aAAgB,EAAE,aAAc,KAAI,QAAKA,MAAI,YAAYA,KAAG,WAAW;;EAEzE,MAAM,WAAW,oBAAoB,GAAG;AAExC,SAAO;GAAE,GAAG;GAAU,GAAG"}
1
+ {"version":3,"file":"events.js","names":["edges: SerializedEdges<Types.event>","x"],"sources":["../../../src/core/to/events.ts"],"sourcesContent":["import type { Types } from '../types';\nimport type { OutTypes } from './schedules';\nimport { getVertexId } from '../util';\nimport type { SerializedEdges, SerializedEdgesShape } from './util';\nimport { internalKeysOmitted } from './util';\nimport type { BaseOptions } from '../../common/types';\n\nexport default (\n events: Types.mixed.event[],\n options: BaseOptions\n): OutTypes.event[] => {\n return events\n .map(x => {\n const edges: SerializedEdges<Types.event> = {\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 } satisfies SerializedEdgesShape<Types.event>;\n const nonEdges = internalKeysOmitted(x, edges);\n\n return { ...nonEdges, ...edges };\n });\n};\n\n"],"mappings":";;;;AAOA,sBACE,QACA,YACqB;AACrB,QAAO,OACJ,KAAI,MAAK;EACR,MAAMA,QAAsC;GAC1C,QAAgB,EAAE,SAAiB,YAAY,EAAE,QAAgB,WAAW;GAE5E,gBAAgB,EAAE,iBAAiB,YAAY,EAAE,gBAAgB,WAAW;GAC5E,QAAgB,EAAE,SAAiB,YAAY,EAAE,QAAgB,WAAW;GAC5E,aAAgB,EAAE,aAAc,KAAI,QAAK,YAAYC,KAAG;GACxD,YAAgB,EAAE,YAAc,KAAI,QAAK,YAAYA,KAAG;GACxD,UAAgB,EAAE,UAAc,KAAI,SAAM;IAAE,GAAGA;IAAG,IAAI,YAAYA,IAAE,IAAI;;GACxE,cAAgB,EAAE,cAAc,KAAI,SAAM;IAAE,GAAGA;IAAG,IAAI,YAAYA,IAAE,IAAI;;GACxE,QAAgB,EAAE,QAAc,KAAI,SAAM;IAAE,GAAGA;IAAG,IAAI,YAAYA,IAAE,IAAI;IAAU,SAASA,IAAE,SAAS,KAAI,MAAK,YAAY,GAAG;;GAC9H,WAAgB,EAAE,WAAc,KAAI,SAAM;IAAE,GAAGA;IAAG,WAAW,CAAC,YAAYA,IAAE,UAAU,IAAI;;GAC1F,aAAgB,EAAE,aAAc,KAAI,QAAKA,MAAI,YAAYA,KAAG,WAAW;;EAEzE,MAAM,WAAW,oBAAoB,GAAG;AAExC,SAAO;GAAE,GAAG;GAAU,GAAG"}
@@ -6,6 +6,7 @@ import { Types } from "../types/index.js";
6
6
  declare namespace OutTypes {
7
7
  type division = Omit<InternalKeysOmitted<Types.serialized.division>, InternalIdKey>;
8
8
  type settings = InternalKeysOmitted<Types.serialized.divisionSettings>;
9
+ type configuration = InternalKeysOmitted<Types.serialized.configuration>;
9
10
  type exception = InternalKeysOmitted<Types.serialized.exception>;
10
11
  type period = InternalKeysOmitted<Types.serialized.period>;
11
12
  type location = InternalKeysOmitted<Types.serialized.location>;
@@ -34,11 +35,14 @@ type Out = {
34
35
  overlapGroups?: OutTypes.overlapGroup[];
35
36
  rootIntervals?: OutTypes.rootInterval[];
36
37
  syllabuses?: OutTypes.syllabus[];
38
+ configurations?: OutTypes.configuration[];
37
39
  meta: {
38
40
  structure: string;
39
41
  };
40
42
  };
41
- declare function export_default(schedule: Partial<Types.mixed.schedule>): Out;
43
+ declare function export_default(schedule: Partial<Types.mixed.schedule> & {
44
+ configurations?: Types.mixed.configuration[];
45
+ }): Out;
42
46
  //#endregion
43
47
  export { export_default };
44
48
  //# sourceMappingURL=schedules.d.ts.map
@@ -12,6 +12,7 @@ import root_intervals_default from "./root-intervals.js";
12
12
  import settings_default from "./settings.js";
13
13
  import division_default from "./division.js";
14
14
  import syllabuses_default from "./syllabuses.js";
15
+ import configurations_default from "./configurations.js";
15
16
 
16
17
  //#region src/core/to/schedules.ts
17
18
  function schedules_default(schedule) {
@@ -31,7 +32,8 @@ function schedules_default(schedule) {
31
32
  ...schedule.lockedTimes && { lockedTimes: locked_times_default(schedule.lockedTimes, options) },
32
33
  ...schedule.overlapGroups && { overlapGroups: overlap_groups_default(schedule.overlapGroups, options) },
33
34
  ...schedule.rootIntervals && { rootIntervals: root_intervals_default(schedule.rootIntervals, options) },
34
- ...schedule.syllabuses && { syllabuses: syllabuses_default(schedule.syllabuses, options) }
35
+ ...schedule.syllabuses && { syllabuses: syllabuses_default(schedule.syllabuses, options) },
36
+ ...schedule.configurations && { configurations: configurations_default(schedule.configurations, options) }
35
37
  };
36
38
  }
37
39
 
@@ -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"],"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 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.divisionSettings>;\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\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 };\n}"],"mappings":";;;;;;;;;;;;;;;;AAuDA,2BACE,UACK;CACL,MAAMA,UAAuB;AAE7B,QAAO;EACL,MAAM,EAAE,WAAW;EACnB,GAAG,SAAS,aAAiB,EAAE,UAAeC,iBAAe,SAAS,WAAe;EACrF,GAAG,SAAS,YAAiB,EAAE,UAAeC,iBAAe,SAAS,UAAe;EACrF,GAAG,SAAS,cAAiB,EAAE,YAAeC,mBAAe,SAAS,YAAe;EACrF,GAAG,SAAS,WAAiB,EAAE,SAAeC,gBAAe,SAAS,SAAe;EACrF,GAAG,SAAS,aAAiB,EAAE,WAAeC,kBAAe,SAAS,WAAe;EACrF,GAAG,SAAS,YAAiB,EAAE,UAAeC,iBAAe,SAAS,UAAe;EACrF,GAAG,SAAS,UAAiB,EAAE,QAAeC,eAAe,SAAS,QAAe;EACrF,GAAG,SAAS,WAAiB,EAAE,SAAeC,gBAAe,SAAS,SAAe;EACrF,GAAG,SAAS,WAAiB,EAAE,SAAeC,gBAAe,SAAS,SAAe;EACrF,GAAG,SAAS,UAAiB,EAAE,QAAeC,eAAe,SAAS,QAAe;EACrF,GAAG,SAAS,eAAiB,EAAE,aAAeC,qBAAe,SAAS,aAAe;EACrF,GAAG,SAAS,iBAAiB,EAAE,eAAeC,uBAAe,SAAS,eAAe;EACrF,GAAG,SAAS,iBAAiB,EAAE,eAAeC,uBAAe,SAAS,eAAe;EACrF,GAAG,SAAS,cAAiB,EAAE,YAAeC,mBAAe,SAAS,YAAe"}
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.divisionSettings>;\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> & { configurations?: CoreTypes.mixed.configuration[] },\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;AAE7B,QAAO;EACL,MAAM,EAAE,WAAW;EACnB,GAAG,SAAS,aAAkB,EAAE,UAAgBC,iBAAgB,SAAS,WAAgB;EACzF,GAAG,SAAS,YAAkB,EAAE,UAAgBC,iBAAgB,SAAS,UAAgB;EACzF,GAAG,SAAS,cAAkB,EAAE,YAAgBC,mBAAgB,SAAS,YAAgB;EACzF,GAAG,SAAS,WAAkB,EAAE,SAAgBC,gBAAgB,SAAS,SAAgB;EACzF,GAAG,SAAS,aAAkB,EAAE,WAAgBC,kBAAgB,SAAS,WAAgB;EACzF,GAAG,SAAS,YAAkB,EAAE,UAAgBC,iBAAgB,SAAS,UAAgB;EACzF,GAAG,SAAS,UAAkB,EAAE,QAAgBC,eAAgB,SAAS,QAAgB;EACzF,GAAG,SAAS,WAAkB,EAAE,SAAgBC,gBAAgB,SAAS,SAAgB;EACzF,GAAG,SAAS,WAAkB,EAAE,SAAgBC,gBAAgB,SAAS,SAAgB;EACzF,GAAG,SAAS,UAAkB,EAAE,QAAgBC,eAAgB,SAAS,QAAgB;EACzF,GAAG,SAAS,eAAkB,EAAE,aAAgBC,qBAAgB,SAAS,aAAgB;EACzF,GAAG,SAAS,iBAAkB,EAAE,eAAgBC,uBAAgB,SAAS,eAAgB;EACzF,GAAG,SAAS,iBAAkB,EAAE,eAAgBC,uBAAgB,SAAS,eAAgB;EACzF,GAAG,SAAS,cAAkB,EAAE,YAAgBC,mBAAgB,SAAS,YAAgB;EACzF,GAAG,SAAS,kBAAkB,EAAE,gBAAgBC,uBAAgB,SAAS,gBAAgB"}
@@ -0,0 +1,31 @@
1
+ import { Vertex } from "./common/index.js";
2
+ import { Division } from "./divisions.js";
3
+
4
+ //#region src/core/types/configurations.d.ts
5
+ type ConfigurationType = 'filter' | 'template' | 'rule';
6
+ interface ConfigurationDomain {
7
+ to: Division | Vertex;
8
+ toModel: 'companies' | 'divisions';
9
+ }
10
+ interface ConfigurationMetadata {
11
+ active: boolean;
12
+ version: string;
13
+ tags: {
14
+ value: string;
15
+ type?: string;
16
+ }[];
17
+ }
18
+ type Configuration = Vertex & {
19
+ domain: ConfigurationDomain[];
20
+ type: ConfigurationType;
21
+ metadata: ConfigurationMetadata;
22
+ lastModifiedBy?: Vertex;
23
+ data?: any;
24
+ displayName?: string;
25
+ description?: string;
26
+ category?: string;
27
+ enabled?: boolean;
28
+ };
29
+ //#endregion
30
+ export { Configuration };
31
+ //# sourceMappingURL=configurations.d.ts.map
@@ -19,11 +19,13 @@ import { DivisionSettings } from "./division-settings.js";
19
19
  import { Meta } from "./common/meta.js";
20
20
  import { Division } from "./divisions.js";
21
21
  import { Area } from "./areas.js";
22
+ import { Configuration } from "./configurations.js";
22
23
  import { MixedSchedule, MixedScheduleWithoutInternalId, Schedule, SerializedSchedule, SerializedScheduleWithoutInternalId } from "./schedules.js";
23
24
 
24
25
  //#region src/core/types/index.d.ts
25
26
  declare namespace Types {
26
27
  type area = Area;
28
+ type configuration = Configuration;
27
29
  type event = Event;
28
30
  type exception = Exception;
29
31
  type course = Course;
@@ -45,6 +47,7 @@ declare namespace Types {
45
47
  type meta = Meta;
46
48
  namespace serialized {
47
49
  type area = Serialized<Area>;
50
+ type configuration = Serialized<Configuration>;
48
51
  type event = Serialized<Event>;
49
52
  type exception = Serialized<Exception>;
50
53
  type course = Serialized<Course>;
@@ -63,6 +66,7 @@ declare namespace Types {
63
66
  }
64
67
  namespace mixed {
65
68
  type area = Mixed<Area>;
69
+ type configuration = Mixed<Configuration>;
66
70
  type event = Mixed<Event>;
67
71
  type exception = Mixed<Exception>;
68
72
  type course = Mixed<Course>;
@@ -81,6 +85,7 @@ declare namespace Types {
81
85
  }
82
86
  namespace mixedWithoutInternalId {
83
87
  type area = MixedWithoutInternalId<Area>;
88
+ type configuration = MixedWithoutInternalId<Configuration>;
84
89
  type event = MixedWithoutInternalId<Event>;
85
90
  type exception = MixedWithoutInternalId<Exception>;
86
91
  type course = MixedWithoutInternalId<Course>;
@@ -100,7 +100,7 @@ declare const maps: readonly [{
100
100
  readonly name: "Royal Schedule Algorithm";
101
101
  readonly map: typeof RSMap;
102
102
  readonly meta: {
103
- readonly structure: "RS/algorithm-3.0.0";
103
+ readonly structure: "RS/algorithm-5.0.0";
104
104
  };
105
105
  }, {
106
106
  readonly structure: {
@@ -289,7 +289,7 @@ const maps = [
289
289
  structure: RS_structure,
290
290
  name: "Royal Schedule Algorithm",
291
291
  map: RSMap,
292
- meta: { structure: "RS/algorithm-3.0.0" }
292
+ meta: { structure: "RS/algorithm-5.0.0" }
293
293
  },
294
294
  {
295
295
  structure: core_structure,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["SchoolSoft_structure: (keyof SchoolSoftFileTypes.event)[]"],"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 type { Types as RSTypes } from '../../RS/types';\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: 'RS/algorithm-3.0.0' satisfies RSTypes.structure }\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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"}
1
+ {"version":3,"file":"index.js","names":["SchoolSoft_structure: (keyof SchoolSoftFileTypes.event)[]"],"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 type { Types as RSTypes } from '../../RS/types';\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: 'RS/algorithm-5.0.0' satisfies RSTypes.structure }\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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@royalschedule/maps",
3
3
  "description": "",
4
- "version": "4.0.12",
4
+ "version": "4.0.14",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -76,12 +76,12 @@
76
76
  "iconv-lite": "^0.7.0",
77
77
  "lodash-es": "^4.17.21",
78
78
  "moment": "^2.30.1",
79
- "mongoose": "^8.18.0",
79
+ "mongoose": "^8.19.0",
80
80
  "nanoid": "^5.1.5",
81
81
  "papaparse": "^5.5.3",
82
82
  "ts-expect": "^1.3.0",
83
83
  "uuid": "^11.1.0",
84
84
  "xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz",
85
- "zod": "^4.1.5"
85
+ "zod": "^4.1.11"
86
86
  }
87
87
  }