@royalschedule/maps 4.0.18 → 4.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Excel/v1/index.d.ts +3 -3
- package/dist/Excel/v2/index.d.ts +3 -3
- package/dist/RS/to/schedules.js +4 -1
- package/dist/RS/to/schedules.js.map +1 -1
- package/dist/RS/types/algorithm-parameters.d.ts +13 -1
- package/dist/RS/types/to.d.ts +3 -4
- package/dist/RS/types/to.js.map +1 -1
- package/dist/core/from/schedules.js +2 -1
- package/dist/core/from/schedules.js.map +1 -1
- package/dist/core/from/settings.js +21 -0
- package/dist/core/from/settings.js.map +1 -0
- package/dist/core/interfaces/vertices/vertex-query.d.ts +2 -0
- package/dist/core/interfaces/vertices/vertex-query.js +8 -0
- package/dist/core/interfaces/vertices/vertex-query.js.map +1 -1
- package/package.json +1 -1
package/dist/Excel/v1/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { PlannedScheduledDuration } from "../../core/interfaces/vertices/propert
|
|
|
7
7
|
import { MinBreakLength } from "../../core/interfaces/vertices/properties/min-break-length.js";
|
|
8
8
|
import { Types } from "./types/index.js";
|
|
9
9
|
import "../../index.js";
|
|
10
|
-
import * as
|
|
10
|
+
import * as moment197 from "moment";
|
|
11
11
|
|
|
12
12
|
//#region src/Excel/v1/index.d.ts
|
|
13
13
|
declare class Map {
|
|
@@ -200,8 +200,8 @@ declare class Map {
|
|
|
200
200
|
lastModifiedBy?: string | undefined;
|
|
201
201
|
course?: string | undefined;
|
|
202
202
|
period?: string | undefined;
|
|
203
|
-
start?: (
|
|
204
|
-
end?: (
|
|
203
|
+
start?: (moment197.Moment | string) | undefined;
|
|
204
|
+
end?: (moment197.Moment | string) | undefined;
|
|
205
205
|
belongsTo?: string | undefined;
|
|
206
206
|
potentialCenter?: string | undefined;
|
|
207
207
|
type?: string | undefined;
|
package/dist/Excel/v2/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { PlannedScheduledDuration } from "../../core/interfaces/vertices/propert
|
|
|
7
7
|
import { MinBreakLength } from "../../core/interfaces/vertices/properties/min-break-length.js";
|
|
8
8
|
import { Types } from "./types/index.js";
|
|
9
9
|
import "../../index.js";
|
|
10
|
-
import * as
|
|
10
|
+
import * as moment199 from "moment";
|
|
11
11
|
|
|
12
12
|
//#region src/Excel/v2/index.d.ts
|
|
13
13
|
declare class Map {
|
|
@@ -198,8 +198,8 @@ declare class Map {
|
|
|
198
198
|
createdAt?: string | undefined;
|
|
199
199
|
updatedAt?: string | undefined;
|
|
200
200
|
lastModifiedBy?: string | undefined;
|
|
201
|
-
start?: (
|
|
202
|
-
end?: (
|
|
201
|
+
start?: (moment199.Moment | string) | undefined;
|
|
202
|
+
end?: (moment199.Moment | string) | undefined;
|
|
203
203
|
potentialCenter?: string | undefined;
|
|
204
204
|
type?: string | undefined;
|
|
205
205
|
tags?: Tag[] | undefined;
|
package/dist/RS/to/schedules.js
CHANGED
|
@@ -29,7 +29,10 @@ function schedules(data, _options = {}) {
|
|
|
29
29
|
structure,
|
|
30
30
|
division: pick(connectedData.division, "displayName", "start", "end")
|
|
31
31
|
},
|
|
32
|
-
algorithmParameters: {
|
|
32
|
+
algorithmParameters: {
|
|
33
|
+
weights: options.algorithmWeightParameters,
|
|
34
|
+
computeTimeMultiplier: options.computeTimeMultiplier
|
|
35
|
+
},
|
|
33
36
|
input: parseInput(connectedData, options),
|
|
34
37
|
...options.appendCoreData && { coreData: CoreMap.to.schedules(data) },
|
|
35
38
|
...options.appendOutput && { output: initialConfiguration(connectedData.events, connectedData.lockedTimes, options) }
|
|
@@ -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';\nimport { structure } from '../types/to';\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: structure,\n division: pick(connectedData.division, 'displayName', 'start', 'end'),\n },\n algorithmParameters: {\n weights:
|
|
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';\nimport { structure } from '../types/to';\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: structure,\n division: pick(connectedData.division, 'displayName', 'start', 'end'),\n },\n algorithmParameters: {\n weights: options.algorithmWeightParameters,\n computeTimeMultiplier: options.computeTimeMultiplier\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":";;;;;;;;AAQA,SAAgB,UACd,MACA,WAA4B,EAAE,EACd;CAIhB,MAAM,iBAAwC;EAC5C,MAAM,IAAI,SAAS;EACnB,MAAMA,yBAA0E,IAC5E;GACA,gBAAuB,EAAE,iBAAoB,IAAI,IAAI,EAAE,eAAe,GAAM;GAC5E,mBAAuB,EAAE,oBAAoB,IAAI,IAAI,EAAE,kBAAkB,GAAG;GAC5E,uBAAuB,EAAE;GAC1B,GACC;AAEJ,SAAO;GAAE,GAAG;GAAU;GAAwB;KAC5C;AAKJ,KAAI,QAAQ,wBAAwB,gBAAgB,KAClD,SAAQ,uBAAuB,iBAAiB,IAAI,IAClD,CAAC,GAAG,QAAQ,uBAAuB,eAAe,CAC/C,KAAI,MAAK;AAER,MAAI,EAAE,WAAW,UAAU,IAAI,EAAE,WAAW,eAAe,CAAE,QAAO;AACpE,SAAO,UAAU;GACjB,CACL;CAKH,MAAM,gBAAgB,cAAc,KAAK;AAEzC,QAAO;EACL,MAAM;GACO;GACX,UAAW,KAAK,cAAc,UAAU,eAAe,SAAS,MAAM;GACvE;EACD,qBAAqB;GACnB,SAAuB,QAAQ;GAC/B,uBAAuB,QAAQ;GAChC;EACD,OAAO,WAAW,eAAe,QAAQ;EACzC,GAAG,QAAQ,kBAAkB,EAAE,UAAU,QAAQ,GAAG,UAAU,KAAK,EAAE;EACrE,GAAG,QAAQ,gBAAkB,EAAE,QAAQ,qBAAqB,cAAc,QAAQ,cAAc,aAAa,QAAQ,EAAE;EACxH"}
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
//#region src/RS/types/algorithm-parameters.d.ts
|
|
2
2
|
type ParameterName = 'overlap' | 'doubleBooking' | 'timeFrame' | 'breakLength' | 'clustering' | 'dailyOvertime' | 'position' | 'gap' | 'dependencyAlternation' | 'overtime' | 'dependencyRank' | 'dayRank' | 'groupRank';
|
|
3
3
|
type AlgorithmWeightParameters = Record<ParameterName, number | false>;
|
|
4
|
+
type AlgorithmParameters = {
|
|
5
|
+
/**
|
|
6
|
+
* Weights for different features used in the scheduling algorithm.
|
|
7
|
+
*/
|
|
8
|
+
weights?: AlgorithmWeightParameters;
|
|
9
|
+
/**
|
|
10
|
+
* A multiplier that lets the schedule algorithm run for a longer time to find better solutions.
|
|
11
|
+
*
|
|
12
|
+
* @default 1
|
|
13
|
+
*/
|
|
14
|
+
computeTimeMultiplier?: number;
|
|
15
|
+
};
|
|
4
16
|
//#endregion
|
|
5
|
-
export { AlgorithmWeightParameters };
|
|
17
|
+
export { AlgorithmParameters, AlgorithmWeightParameters };
|
|
6
18
|
//# sourceMappingURL=algorithm-parameters.d.ts.map
|
package/dist/RS/types/to.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { BaseOptions } from "../../common/types.js";
|
|
|
2
2
|
import { Types } from "../../core/types/index.js";
|
|
3
3
|
import "../../core/index.js";
|
|
4
4
|
import { MixedScheduleData } from "../make-connected.js";
|
|
5
|
-
import { AlgorithmWeightParameters } from "./algorithm-parameters.js";
|
|
5
|
+
import { AlgorithmParameters, AlgorithmWeightParameters } from "./algorithm-parameters.js";
|
|
6
6
|
import { Types as Types$1 } from "./index.js";
|
|
7
7
|
|
|
8
8
|
//#region src/RS/types/to.d.ts
|
|
@@ -46,6 +46,7 @@ interface ToOptions extends BaseOptions {
|
|
|
46
46
|
oldFormat?: boolean;
|
|
47
47
|
partialScheduleOptions?: PartialScheduleOptions<Array<string> | Set<string>>;
|
|
48
48
|
algorithmWeightParameters?: AlgorithmWeightParameters;
|
|
49
|
+
computeTimeMultiplier?: number;
|
|
49
50
|
/**
|
|
50
51
|
* to be used before whe have migrated from "maxNumWorkingHours" and "maxNumDailyWorkingHours" to "maximumScheduleSpan"
|
|
51
52
|
*/
|
|
@@ -61,9 +62,7 @@ interface ToOutput {
|
|
|
61
62
|
structure?: Structure;
|
|
62
63
|
division: Pick<Types.Deep.Division, 'displayName' | 'start' | 'end'>;
|
|
63
64
|
};
|
|
64
|
-
algorithmParameters:
|
|
65
|
-
weights?: AlgorithmWeightParameters;
|
|
66
|
-
};
|
|
65
|
+
algorithmParameters: AlgorithmParameters;
|
|
67
66
|
score?: [number, number, number, number];
|
|
68
67
|
input: Types$1.scheduleData;
|
|
69
68
|
output?: Types$1.configuration[];
|
package/dist/RS/types/to.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"to.js","names":[],"sources":["../../../src/RS/types/to.ts"],"sourcesContent":["import type { BaseOptions } from '../../common/types';\nimport type { CoreTypes } from '../../core';\nimport type { MixedScheduleData } from '../make-connected';\nimport type { Types } from './';\nimport type { AlgorithmWeightParameters } from './algorithm-parameters';\n\n\nexport type ToInput = MixedScheduleData;\n\ntype PartialScheduleOptions<IDs extends Array<string> | Set<string>> = {\n /** @description undefined means all included */\n includedEvents?: IDs;\n /** @description undefined means all included */\n includedLocations?: IDs;\n omittedEventsHandling: 'ignore' | 'freeze';\n};\n\nexport interface ToOptions extends BaseOptions {\n /**\n * If enabled, each entity in the output (such as groups, dependencies, collections, events, etc.)\n * will include a `meta` object containing details like original IDs and display names.\n * Note: This is distinct from the root-level `meta` object in the mapped output which is always included.\n * @default false\n */\n includeEntityMeta?: boolean;\n\n /**\n * If true, the output will include the full core data. This enables the resulting output file to be uploaded as a new schedule.\n * @default false\n */\n appendCoreData?: boolean;\n\n /**\n * If true, the output will include current configuration of events and locked times as `output` entry.\n * @default false\n */\n appendOutput?: boolean;\n\n /**\n * @deprecated the only purpose of this backwards compatibility is to support the input-analyzer module\n *\n * If not set to true, these new features are taken into account:\n *\n * - New root level entries: `intervals` and `individuals`\n * - As the there is now a root level `intervals` the former may be references from `Collection.intervals`, `Group.intervals` etc.\n * - The `Collection.groups` and `Event.groups` supports referencing `individuals` (and `individuals sets`) in addition to `groups`\n * - The `Group.forbidOverlappingEvents` has been removed.\n * - The `Group.disableDayLengthPunishment` has been replaced by `Group.minimizeGaps`\n */\n oldFormat?: boolean;\n\n partialScheduleOptions?: PartialScheduleOptions<Array<string> | Set<string>>\n\n algorithmWeightParameters?: AlgorithmWeightParameters;\n\n /**\n * to be used before whe have migrated from \"maxNumWorkingHours\" and \"maxNumDailyWorkingHours\" to \"maximumScheduleSpan\"\n */\n useMaximumScheduleSpan?: boolean;\n}\n\nexport interface ParsedToOptions extends Omit<ToOptions, 'partialScheduleOptions'> {\n partialScheduleOptions?: PartialScheduleOptions<Set<string>>\n}\n\nexport const structure = 'RS/algorithm-5.0.2';\nexport type Structure = typeof structure;\nexport interface ToOutput {\n meta: {\n structure?: Structure;\n division: Pick<CoreTypes.Deep.Division, 'displayName' | 'start' | 'end'>;\n };\n algorithmParameters:
|
|
1
|
+
{"version":3,"file":"to.js","names":[],"sources":["../../../src/RS/types/to.ts"],"sourcesContent":["import type { BaseOptions } from '../../common/types';\nimport type { CoreTypes } from '../../core';\nimport type { MixedScheduleData } from '../make-connected';\nimport type { Types } from './';\nimport type { AlgorithmParameters, AlgorithmWeightParameters } from './algorithm-parameters';\n\n\nexport type ToInput = MixedScheduleData;\n\ntype PartialScheduleOptions<IDs extends Array<string> | Set<string>> = {\n /** @description undefined means all included */\n includedEvents?: IDs;\n /** @description undefined means all included */\n includedLocations?: IDs;\n omittedEventsHandling: 'ignore' | 'freeze';\n};\n\nexport interface ToOptions extends BaseOptions {\n /**\n * If enabled, each entity in the output (such as groups, dependencies, collections, events, etc.)\n * will include a `meta` object containing details like original IDs and display names.\n * Note: This is distinct from the root-level `meta` object in the mapped output which is always included.\n * @default false\n */\n includeEntityMeta?: boolean;\n\n /**\n * If true, the output will include the full core data. This enables the resulting output file to be uploaded as a new schedule.\n * @default false\n */\n appendCoreData?: boolean;\n\n /**\n * If true, the output will include current configuration of events and locked times as `output` entry.\n * @default false\n */\n appendOutput?: boolean;\n\n /**\n * @deprecated the only purpose of this backwards compatibility is to support the input-analyzer module\n *\n * If not set to true, these new features are taken into account:\n *\n * - New root level entries: `intervals` and `individuals`\n * - As the there is now a root level `intervals` the former may be references from `Collection.intervals`, `Group.intervals` etc.\n * - The `Collection.groups` and `Event.groups` supports referencing `individuals` (and `individuals sets`) in addition to `groups`\n * - The `Group.forbidOverlappingEvents` has been removed.\n * - The `Group.disableDayLengthPunishment` has been replaced by `Group.minimizeGaps`\n */\n oldFormat?: boolean;\n\n partialScheduleOptions?: PartialScheduleOptions<Array<string> | Set<string>>\n\n algorithmWeightParameters?: AlgorithmWeightParameters;\n\n computeTimeMultiplier?: number;\n\n /**\n * to be used before whe have migrated from \"maxNumWorkingHours\" and \"maxNumDailyWorkingHours\" to \"maximumScheduleSpan\"\n */\n useMaximumScheduleSpan?: boolean;\n}\n\nexport interface ParsedToOptions extends Omit<ToOptions, 'partialScheduleOptions'> {\n partialScheduleOptions?: PartialScheduleOptions<Set<string>>\n}\n\nexport const structure = 'RS/algorithm-5.0.2';\nexport type Structure = typeof structure;\nexport interface ToOutput {\n meta: {\n structure?: Structure;\n division: Pick<CoreTypes.Deep.Division, 'displayName' | 'start' | 'end'>;\n };\n algorithmParameters: AlgorithmParameters;\n score?: [number, number, number, number];\n input: Types.scheduleData;\n output?: Types.configuration[];\n coreData?: Partial<CoreTypes.SerializedWithOptionalId.Schedule>;\n}"],"mappings":";AAmEA,MAAa,YAAY"}
|
|
@@ -11,11 +11,12 @@ 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
13
|
import configurations_default from "./configurations.js";
|
|
14
|
+
import settings_default from "./settings.js";
|
|
14
15
|
|
|
15
16
|
//#region src/core/from/schedules.ts
|
|
16
17
|
function schedules_default(schedule) {
|
|
17
18
|
return {
|
|
18
|
-
...schedule.settings && { settings: schedule.settings },
|
|
19
|
+
...schedule.settings && { settings: settings_default(schedule.settings) },
|
|
19
20
|
...schedule.periods && { periods: periods_default(schedule.periods) },
|
|
20
21
|
...schedule.groups && { groups: groups_default(schedule.groups) },
|
|
21
22
|
...schedule.teachers && { teachers: teachers_default(schedule.teachers) },
|
|
@@ -1 +1 @@
|
|
|
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:
|
|
1
|
+
{"version":3,"file":"schedules.js","names":["_settings","_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 _settings from './settings';\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: _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":";;;;;;;;;;;;;;;;AAgBA,2BAAyB,UAAoF;AAC3G,QAAO;EACL,GAAG,SAAS,YAAkB,EAAE,UAAgBA,iBAAgB,SAAS,SAAe,EAAE;EAC1F,GAAG,SAAS,WAAkB,EAAE,SAAgBC,gBAAgB,SAAS,QAAe,EAAE;EAC1F,GAAG,SAAS,UAAkB,EAAE,QAAgBC,eAAgB,SAAS,OAAe,EAAE;EAC1F,GAAG,SAAS,YAAkB,EAAE,UAAgBC,iBAAgB,SAAS,SAAe,EAAE;EAC1F,GAAG,SAAS,WAAkB,EAAE,SAAgBC,gBAAgB,SAAS,QAAe,EAAE;EAC1F,GAAG,SAAS,aAAkB,EAAE,WAAgBC,kBAAgB,SAAS,UAAe,EAAE;EAC1F,GAAG,SAAS,WAAkB,EAAE,SAAgBC,gBAAgB,SAAS,QAAe,EAAE;EAC1F,GAAG,SAAS,UAAkB,EAAE,QAAgBC,eAAgB,SAAS,OAAe,EAAE;EAC1F,GAAG,SAAS,iBAAkB,EAAE,eAAgBC,uBAAgB,SAAS,cAAe,EAAE;EAC1F,GAAG,SAAS,eAAkB,EAAE,aAAgBC,qBAAgB,SAAS,YAAe,EAAE;EAC1F,GAAG,SAAS,iBAAkB,EAAE,eAAgBC,uBAAgB,SAAS,cAAe,EAAE;EAC1F,GAAG,SAAS,cAAkB,EAAE,YAAgBC,mBAAgB,SAAS,WAAe,EAAE;EAC1F,GAAG,SAAS,cAAkB,EAAE,YAAgBC,mBAAgB,SAAS,WAAe,EAAE;EAC1F,GAAG,SAAS,kBAAkB,EAAE,gBAAgBC,uBAAgB,SAAS,eAAe,EAAE;EAC3F"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import moment from "moment";
|
|
2
|
+
|
|
3
|
+
//#region src/core/from/settings.ts
|
|
4
|
+
var settings_default = (settings) => {
|
|
5
|
+
settings.calendarExceptions = settings.calendarExceptions?.map((exception) => {
|
|
6
|
+
let start = moment.utc(exception.start);
|
|
7
|
+
if (start.hour() === 23 && start.minute() > 55) start = start.minute(55);
|
|
8
|
+
let end = moment.utc(exception.end);
|
|
9
|
+
if (end.hour() === 0 && end.minute() < 5) end = end.endOf("day");
|
|
10
|
+
return {
|
|
11
|
+
...exception,
|
|
12
|
+
start,
|
|
13
|
+
end
|
|
14
|
+
};
|
|
15
|
+
});
|
|
16
|
+
return settings;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
export { settings_default as default };
|
|
21
|
+
//# sourceMappingURL=settings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings.js","names":[],"sources":["../../../src/core/from/settings.ts"],"sourcesContent":["import moment from 'moment';\nimport type transform from '../to/settings';\n\nexport default (settings: ReturnType<typeof transform>) => {\n\n settings.calendarExceptions = settings.calendarExceptions?.map(exception => {\n // the start time should not be later than 23:55 of the specified date\n let start = moment.utc(exception.start);\n if (start.hour() === 23 && start.minute() > 55) start = start.minute(55);\n\n // the end time should not be before 00:05 of the specified date, in such a case set it to the end of day\n // (this has to do with backwards compatibility with older versions)\n let end = moment.utc(exception.end);\n if (end.hour() === 0 && end.minute() < 5) end = end.endOf('day');\n\n return { ...exception, start, end };\n });\n\n return settings;\n};\n"],"mappings":";;;AAGA,wBAAgB,aAA2C;AAEzD,UAAS,qBAAqB,SAAS,oBAAoB,KAAI,cAAa;EAE1E,IAAI,QAAQ,OAAO,IAAI,UAAU,MAAM;AACvC,MAAI,MAAM,MAAM,KAAK,MAAM,MAAM,QAAQ,GAAG,GAAI,SAAQ,MAAM,OAAO,GAAG;EAIxE,IAAI,MAAM,OAAO,IAAI,UAAU,IAAI;AACnC,MAAI,IAAI,MAAM,KAAK,KAAK,IAAI,QAAQ,GAAG,EAAG,OAAM,IAAI,MAAM,MAAM;AAEhE,SAAO;GAAE,GAAG;GAAW;GAAO;GAAK;GACnC;AAEF,QAAO"}
|
|
@@ -92,10 +92,12 @@ declare namespace createVertexQuery {
|
|
|
92
92
|
function overlapGroup<Q$1 extends VertexQuery<OverlapGroupVertex>>(query: Q$1): VertexQuery$1<"overlapGroups", Q$1>;
|
|
93
93
|
function period<Q$1 extends VertexQuery<PeriodVertex>>(query: Q$1): VertexQuery$1<"periods", Q$1>;
|
|
94
94
|
function person<Q$1 extends VertexQuery<PersonVertex>>(query: Q$1): VertexQuery$1<"persons", Q$1>;
|
|
95
|
+
function student<Q$1 extends VertexQuery<PersonVertex>>(query: Q$1): VertexQuery$1<"students", Q$1>;
|
|
95
96
|
function rootInterval<Q$1 extends VertexQuery<RootIntervalVertex>>(query: Q$1): VertexQuery$1<"rootIntervals", Q$1>;
|
|
96
97
|
function syllabus<Q$1 extends VertexQuery<SyllabusVertex>>(query: Q$1): VertexQuery$1<"syllabuses", Q$1>;
|
|
97
98
|
function group<Q$1 extends VertexQuery<GroupVertex>>(query: Q$1): VertexQuery$1<"groups", Q$1>;
|
|
98
99
|
function teacher<Q$1 extends VertexQuery<TeacherVertex>>(query: Q$1): VertexQuery$1<"teachers", Q$1>;
|
|
100
|
+
function configuration<Q$1 extends VertexQuery<ConfigurationVertex>>(query: Q$1): VertexQuery$1<"configurations", Q$1>;
|
|
99
101
|
}
|
|
100
102
|
//#endregion
|
|
101
103
|
export { Infer, VertexQuery$1 as VertexQuery, createVertexQuery };
|
|
@@ -71,6 +71,10 @@ let createVertexQuery;
|
|
|
71
71
|
return new VertexQuery("persons", query);
|
|
72
72
|
}
|
|
73
73
|
_createVertexQuery.person = person;
|
|
74
|
+
function student(query) {
|
|
75
|
+
return new VertexQuery("students", query);
|
|
76
|
+
}
|
|
77
|
+
_createVertexQuery.student = student;
|
|
74
78
|
function rootInterval(query) {
|
|
75
79
|
return new VertexQuery("rootIntervals", query);
|
|
76
80
|
}
|
|
@@ -87,6 +91,10 @@ let createVertexQuery;
|
|
|
87
91
|
return new VertexQuery("teachers", query);
|
|
88
92
|
}
|
|
89
93
|
_createVertexQuery.teacher = teacher;
|
|
94
|
+
function configuration(query) {
|
|
95
|
+
return new VertexQuery("configurations", query);
|
|
96
|
+
}
|
|
97
|
+
_createVertexQuery.configuration = configuration;
|
|
90
98
|
})(createVertexQuery || (createVertexQuery = {}));
|
|
91
99
|
|
|
92
100
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vertex-query.js","names":["_collection: C","_query: Q"],"sources":["../../../../src/core/interfaces/vertices/vertex-query.ts"],"sourcesContent":["import type { Collection, CustomVertexExport } from './util';\nimport type { TeacherVertex } from './teachers';\nimport type { ExceptionVertex } from './exceptions';\nimport type { EventVertex, ScheduleEventVertex, CalendarEventVertex } from './events';\nimport type { CourseVertex } from './courses';\nimport type { DivisionSettingsVertex } from './division-settings';\nimport type { DivisionVertex } from './divisions';\nimport type { GenerationVertex } from './generations';\nimport type { GroupVertex } from './groups';\nimport type { LocationVertex } from './locations';\nimport type { LockedTimeVertex } from './locked-times';\nimport type { OverlapGroupVertex } from './overlap-groups';\nimport type { PeriodVertex } from './periods';\nimport type { PersonVertex } from './persons';\nimport type { RootIntervalVertex } from './root-intervals';\nimport type { SyllabusVertex } from './syllabuses';\nimport type { ConfigurationVertex } from './configurations';\nimport type { CompanyVertex } from './companies';\nimport type { UserVertex } from './users';\nimport type { VertexQuery as Query } from './util/vertex-query';\nimport type { TypeEqual } from 'ts-expect';\nimport { expectType } from 'ts-expect';\n\n\ntype VertexRecord = {\n divisions: DivisionVertex;\n divisionSettings: DivisionSettingsVertex;\n settings: DivisionSettingsVertex;\n teachers: TeacherVertex;\n exceptions: ExceptionVertex;\n events: EventVertex;\n scheduleEvents: ScheduleEventVertex;\n calendarEvents: CalendarEventVertex;\n courses: CourseVertex;\n generations: GenerationVertex;\n groups: GroupVertex;\n locations: LocationVertex;\n lockedTimes: LockedTimeVertex;\n overlapGroups: OverlapGroupVertex;\n periods: PeriodVertex;\n persons: PersonVertex;\n students: PersonVertex;\n rootIntervals: RootIntervalVertex;\n syllabuses: SyllabusVertex;\n configurations: ConfigurationVertex;\n companies: CompanyVertex;\n users: UserVertex;\n};\nexport type BaseQueryRecord<C extends keyof VertexRecord> = Query<VertexRecord[C]>;\n{\n // the keys must all be a collection\n type Mismatches = keyof {\n [K in keyof VertexRecord as K extends Collection ? never : K]: true\n };\n expectType<TypeEqual<Mismatches, never>>(true);\n}\n\n/**\n * See {@link createVertexQuery}\n */\nexport class VertexQuery <\n C extends keyof VertexRecord,\n Q extends BaseQueryRecord<C>\n> {\n constructor (\n private readonly _collection: C,\n private readonly _query: Q\n ) {}\n\n get collection () { return this._collection }\n get query () { return this._query }\n}\n\n\n/**\n * Infers the result type for a query created via createVertexQuery.\n *\n * @example\n * const personQuery = createVertexQuery('persons', { select: ['id', 'firstName'] });\n * type PersonType = Infer<typeof personQuery>;\n */\nexport type Infer<T extends VertexQuery<any, any>>
|
|
1
|
+
{"version":3,"file":"vertex-query.js","names":["_collection: C","_query: Q"],"sources":["../../../../src/core/interfaces/vertices/vertex-query.ts"],"sourcesContent":["import type { Collection, CustomVertexExport } from './util';\nimport type { TeacherVertex } from './teachers';\nimport type { ExceptionVertex } from './exceptions';\nimport type { EventVertex, ScheduleEventVertex, CalendarEventVertex } from './events';\nimport type { CourseVertex } from './courses';\nimport type { DivisionSettingsVertex } from './division-settings';\nimport type { DivisionVertex } from './divisions';\nimport type { GenerationVertex } from './generations';\nimport type { GroupVertex } from './groups';\nimport type { LocationVertex } from './locations';\nimport type { LockedTimeVertex } from './locked-times';\nimport type { OverlapGroupVertex } from './overlap-groups';\nimport type { PeriodVertex } from './periods';\nimport type { PersonVertex } from './persons';\nimport type { RootIntervalVertex } from './root-intervals';\nimport type { SyllabusVertex } from './syllabuses';\nimport type { ConfigurationVertex } from './configurations';\nimport type { CompanyVertex } from './companies';\nimport type { UserVertex } from './users';\nimport type { VertexQuery as Query } from './util/vertex-query';\nimport type { TypeEqual } from 'ts-expect';\nimport { expectType } from 'ts-expect';\n\n\ntype VertexRecord = {\n divisions: DivisionVertex;\n divisionSettings: DivisionSettingsVertex;\n settings: DivisionSettingsVertex;\n teachers: TeacherVertex;\n exceptions: ExceptionVertex;\n events: EventVertex;\n scheduleEvents: ScheduleEventVertex;\n calendarEvents: CalendarEventVertex;\n courses: CourseVertex;\n generations: GenerationVertex;\n groups: GroupVertex;\n locations: LocationVertex;\n lockedTimes: LockedTimeVertex;\n overlapGroups: OverlapGroupVertex;\n periods: PeriodVertex;\n persons: PersonVertex;\n students: PersonVertex;\n rootIntervals: RootIntervalVertex;\n syllabuses: SyllabusVertex;\n configurations: ConfigurationVertex;\n companies: CompanyVertex;\n users: UserVertex;\n};\nexport type BaseQueryRecord<C extends keyof VertexRecord> = Query<VertexRecord[C]>;\n{\n // the keys must all be a collection\n type Mismatches = keyof {\n [K in keyof VertexRecord as K extends Collection ? never : K]: true\n };\n expectType<TypeEqual<Mismatches, never>>(true);\n}\n\n/**\n * See {@link createVertexQuery}\n */\nexport class VertexQuery <\n C extends keyof VertexRecord,\n Q extends BaseQueryRecord<C>\n> {\n constructor (\n private readonly _collection: C,\n private readonly _query: Q\n ) {}\n\n get collection () { return this._collection }\n get query () { return this._query }\n}\n\n\n/**\n * Infers the result type for a query created via createVertexQuery.\n *\n * @example\n * const personQuery = createVertexQuery('persons', { select: ['id', 'firstName'] });\n * type PersonType = Infer<typeof personQuery>;\n */\nexport type Infer<T extends VertexQuery<any, any>> = // eslint-disable-line @typescript-eslint/no-explicit-any\n T extends VertexQuery<infer C, infer Q>\n ? CustomVertexExport<VertexRecord[C], Q>\n : never;\n\n\n/**\n * Builds a typed vertex query for a given vertex type using a select/expand shape.\n *\n * Use together with Infer<T> to obtain the serialized result type.\n *\n * @typeParam Q - The select/expand query shape for that vertex.\n *\n * @example\n * const groupQuery = createVertexQuery.group({\n * select: ['id', 'displayName'],\n * expand: { members: { select: ['id'] } }\n * });\n * type GroupType = Infer<typeof groupQuery>;\n */\nexport namespace createVertexQuery {\n //\n // The following did not work: it seems we need to define Q as an completely independent type parameter (?)\n //\n // export function createVertexQuery <\n // C extends keyof VertexRecord,\n // const Q extends Query<VertexRecord[C]>\n // > (\n // collection: C,\n // query: Q\n // ) {\n // return new VertexQuery(collection, query);\n // }\n\n export function division <Q extends Query<DivisionVertex >> (query: Q) { return new VertexQuery('divisions', query) }\n export function settings <Q extends Query<DivisionSettingsVertex>> (query: Q) { return new VertexQuery('settings', query) }\n export function exception <Q extends Query<ExceptionVertex >> (query: Q) { return new VertexQuery('exceptions', query) }\n export function event <Q extends Query<EventVertex >> (query: Q) { return new VertexQuery('events', query) }\n export function scheduleEvent<Q extends Query<ScheduleEventVertex >> (query: Q) { return new VertexQuery('scheduleEvents', query) }\n export function calendarEvent<Q extends Query<CalendarEventVertex >> (query: Q) { return new VertexQuery('calendarEvents', query) }\n export function course <Q extends Query<CourseVertex >> (query: Q) { return new VertexQuery('courses', query) }\n export function generation <Q extends Query<GenerationVertex >> (query: Q) { return new VertexQuery('generations', query) }\n export function location <Q extends Query<LocationVertex >> (query: Q) { return new VertexQuery('locations', query) }\n export function lockedTime <Q extends Query<LockedTimeVertex >> (query: Q) { return new VertexQuery('lockedTimes', query) }\n export function overlapGroup <Q extends Query<OverlapGroupVertex >> (query: Q) { return new VertexQuery('overlapGroups', query) }\n export function period <Q extends Query<PeriodVertex >> (query: Q) { return new VertexQuery('periods', query) }\n export function person <Q extends Query<PersonVertex >> (query: Q) { return new VertexQuery('persons', query) }\n export function student <Q extends Query<PersonVertex >> (query: Q) { return new VertexQuery('students', query) }\n export function rootInterval <Q extends Query<RootIntervalVertex >> (query: Q) { return new VertexQuery('rootIntervals', query) }\n export function syllabus <Q extends Query<SyllabusVertex >> (query: Q) { return new VertexQuery('syllabuses', query) }\n export function group <Q extends Query<GroupVertex >> (query: Q) { return new VertexQuery('groups', query) }\n export function teacher <Q extends Query<TeacherVertex >> (query: Q) { return new VertexQuery('teachers', query) }\n export function configuration<Q extends Query<ConfigurationVertex >> (query: Q) { return new VertexQuery('configurations', query) }\n}"],"mappings":";;;AAsDE,WAAyC,KAAK;;;;AAMhD,IAAa,cAAb,MAGE;CACA,YACE,AAAiBA,aACjB,AAAiBC,QACjB;EAFiB;EACA;;CAGnB,IAAI,aAAc;AAAE,SAAO,KAAK;;CAChC,IAAI,QAAc;AAAE,SAAO,KAAK;;;;;CA6CzB,SAAS,SAAwD,OAAU;AAAE,SAAO,IAAI,YAAY,aAAoB,MAAM;;;CAC9H,SAAS,SAAwD,OAAU;AAAE,SAAO,IAAI,YAAY,YAAoB,MAAM;;;CAC9H,SAAS,UAAwD,OAAU;AAAE,SAAO,IAAI,YAAY,cAAoB,MAAM;;;CAC9H,SAAS,MAAwD,OAAU;AAAE,SAAO,IAAI,YAAY,UAAoB,MAAM;;;CAC9H,SAAS,cAAwD,OAAU;AAAE,SAAO,IAAI,YAAY,kBAAoB,MAAM;;;CAC9H,SAAS,cAAwD,OAAU;AAAE,SAAO,IAAI,YAAY,kBAAoB,MAAM;;;CAC9H,SAAS,OAAwD,OAAU;AAAE,SAAO,IAAI,YAAY,WAAoB,MAAM;;;CAC9H,SAAS,WAAwD,OAAU;AAAE,SAAO,IAAI,YAAY,eAAoB,MAAM;;;CAC9H,SAAS,SAAwD,OAAU;AAAE,SAAO,IAAI,YAAY,aAAoB,MAAM;;;CAC9H,SAAS,WAAwD,OAAU;AAAE,SAAO,IAAI,YAAY,eAAoB,MAAM;;;CAC9H,SAAS,aAAwD,OAAU;AAAE,SAAO,IAAI,YAAY,iBAAoB,MAAM;;;CAC9H,SAAS,OAAwD,OAAU;AAAE,SAAO,IAAI,YAAY,WAAoB,MAAM;;;CAC9H,SAAS,OAAwD,OAAU;AAAE,SAAO,IAAI,YAAY,WAAoB,MAAM;;;CAC9H,SAAS,QAAwD,OAAU;AAAE,SAAO,IAAI,YAAY,YAAoB,MAAM;;;CAC9H,SAAS,aAAwD,OAAU;AAAE,SAAO,IAAI,YAAY,iBAAoB,MAAM;;;CAC9H,SAAS,SAAwD,OAAU;AAAE,SAAO,IAAI,YAAY,cAAoB,MAAM;;;CAC9H,SAAS,MAAwD,OAAU;AAAE,SAAO,IAAI,YAAY,UAAoB,MAAM;;;CAC9H,SAAS,QAAwD,OAAU;AAAE,SAAO,IAAI,YAAY,YAAoB,MAAM;;;CAC9H,SAAS,cAAwD,OAAU;AAAE,SAAO,IAAI,YAAY,kBAAoB,MAAM"}
|