@royalschedule/maps 4.0.0 → 4.0.2

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 (87) hide show
  1. package/dist/Additio/types/options.d.ts +8 -0
  2. package/dist/Excel/v1/from/index.js +2 -2
  3. package/dist/Excel/v1/from/index.js.map +1 -1
  4. package/dist/Excel/v2/from/index.js +2 -2
  5. package/dist/Excel/v2/from/index.js.map +1 -1
  6. package/dist/InfoMentor/to/schedules.js +2 -2
  7. package/dist/InfoMentor/to/schedules.js.map +1 -1
  8. package/dist/PlanDigital/index.d.ts +26 -26
  9. package/dist/RS/make-connected.js +2 -2
  10. package/dist/RS/make-connected.js.map +1 -1
  11. package/dist/RS/types/event-configuration.d.ts +3 -0
  12. package/dist/RS/types/groups.d.ts +2 -0
  13. package/dist/RS/types/to.d.ts +15 -0
  14. package/dist/SS12000/from/activities.js +36 -0
  15. package/dist/SS12000/from/activities.js.map +1 -0
  16. package/dist/SS12000/from/calendar-events.js +20 -0
  17. package/dist/SS12000/from/calendar-events.js.map +1 -0
  18. package/dist/SS12000/from/duties.js +21 -0
  19. package/dist/SS12000/from/duties.js.map +1 -0
  20. package/dist/SS12000/from/groups.js +23 -0
  21. package/dist/SS12000/from/groups.js.map +1 -0
  22. package/dist/SS12000/from/index.js +24 -0
  23. package/dist/SS12000/from/index.js.map +1 -0
  24. package/dist/SS12000/from/persons.js +43 -0
  25. package/dist/SS12000/from/persons.js.map +1 -0
  26. package/dist/SS12000/from/resources.js +9 -0
  27. package/dist/SS12000/from/resources.js.map +1 -0
  28. package/dist/SS12000/from/rooms.js +18 -0
  29. package/dist/SS12000/from/rooms.js.map +1 -0
  30. package/dist/SS12000/from/syllabuses.js +21 -0
  31. package/dist/SS12000/from/syllabuses.js.map +1 -0
  32. package/dist/SS12000/index.d.ts +36 -0
  33. package/dist/SS12000/index.js +12 -0
  34. package/dist/SS12000/index.js.map +1 -0
  35. package/dist/SS12000/to/activities.js +63 -0
  36. package/dist/SS12000/to/activities.js.map +1 -0
  37. package/dist/SS12000/to/calendar-events.js +53 -0
  38. package/dist/SS12000/to/calendar-events.js.map +1 -0
  39. package/dist/SS12000/to/common.js +25 -0
  40. package/dist/SS12000/to/common.js.map +1 -0
  41. package/dist/SS12000/to/duties.js +45 -0
  42. package/dist/SS12000/to/duties.js.map +1 -0
  43. package/dist/SS12000/to/groups.js +47 -0
  44. package/dist/SS12000/to/groups.js.map +1 -0
  45. package/dist/SS12000/to/index.d.ts +58 -0
  46. package/dist/SS12000/to/index.js +24 -0
  47. package/dist/SS12000/to/index.js.map +1 -0
  48. package/dist/SS12000/to/persons.js +40 -0
  49. package/dist/SS12000/to/persons.js.map +1 -0
  50. package/dist/SS12000/to/resources.js +27 -0
  51. package/dist/SS12000/to/resources.js.map +1 -0
  52. package/dist/SS12000/to/rooms.js +32 -0
  53. package/dist/SS12000/to/rooms.js.map +1 -0
  54. package/dist/SS12000/to/syllabuses.js +34 -0
  55. package/dist/SS12000/to/syllabuses.js.map +1 -0
  56. package/dist/SS12000/types/activities.d.ts +41 -0
  57. package/dist/SS12000/types/calendar-events.d.ts +23 -0
  58. package/dist/SS12000/types/codes.d.ts +9 -0
  59. package/dist/SS12000/types/duties.d.ts +23 -0
  60. package/dist/SS12000/types/duty-assignments.d.ts +13 -0
  61. package/dist/SS12000/types/groups.d.ts +23 -0
  62. package/dist/SS12000/types/index.d.ts +21 -0
  63. package/dist/SS12000/types/organisation.d.ts +20 -0
  64. package/dist/SS12000/types/persons.d.ts +30 -0
  65. package/dist/SS12000/types/resources.d.ts +13 -0
  66. package/dist/SS12000/types/rooms.d.ts +17 -0
  67. package/dist/SS12000/types/syllabus.d.ts +19 -0
  68. package/dist/Skola24/txt/types/index.d.ts +13 -0
  69. package/dist/common/types.d.ts +7 -0
  70. package/dist/core/to/util.d.ts +5 -1
  71. package/dist/core/types/common/index.d.ts +3 -2
  72. package/dist/core/types/common/intervals.d.ts +6 -0
  73. package/dist/core/types/common/maximum-schedule-span.d.ts +11 -0
  74. package/dist/core/types/common/planned-schedule-duration.d.ts +6 -0
  75. package/dist/core/types/courses.d.ts +3 -1
  76. package/dist/core/types/division-settings.d.ts +3 -1
  77. package/dist/core/types/divisions.d.ts +2 -2
  78. package/dist/core/types/events.d.ts +1 -1
  79. package/dist/core/types/exceptions.d.ts +1 -1
  80. package/dist/core/types/groups.d.ts +2 -0
  81. package/dist/core/types/locked-times.d.ts +2 -2
  82. package/dist/core/types/persons.d.ts +1 -1
  83. package/dist/core/types/teachers.d.ts +2 -0
  84. package/dist/core/vertex-mapping.d.ts +13 -0
  85. package/dist/index.d.ts +9 -7
  86. package/dist/index.js +2 -1
  87. package/package.json +1 -1
@@ -3,10 +3,17 @@ import { Moment } from "moment";
3
3
 
4
4
  //#region src/common/types.d.ts
5
5
  type DateType = Moment | string | Date;
6
+ /**
7
+ * T1 | T2 | ... => T1 & T2 & ...
8
+ */
6
9
  type Intersect<T> = (T extends any ? ((x: T) => 0) : never) extends ((x: infer R) => 0) ? R : never;
7
10
  type BaseOptions = {
8
11
  idKey?: IdKey;
9
12
  };
13
+ /**
14
+ * The interface required for the "from" mapping functions.
15
+ */
16
+
10
17
  //#endregion
11
18
  export { BaseOptions, DateType, Intersect };
12
19
  //# sourceMappingURL=types.d.ts.map
@@ -1,10 +1,14 @@
1
- import { Vertex } from "../types/common/index.js";
2
1
  import { Intersect } from "../../common/types.js";
2
+ import { Vertex } from "../types/common/index.js";
3
3
 
4
4
  //#region src/core/to/util.d.ts
5
5
 
6
6
  declare const keys: readonly ["_id", "createdAt", "updatedAt", "belongsTo", "lastModifiedBy", "CONTEXT"];
7
7
  type InternalKeysOmitted<V extends Vertex> = Omit<Intersect<V>, typeof keys[number]>;
8
+ /**
9
+ * Returns a copy of the vertex with internal keys omitted, such as `_id`, `createdAt`, `updatedAt`, etc.
10
+ * The output type also omits all edges for ease of use.
11
+ */
8
12
  //#endregion
9
13
  export { InternalKeysOmitted };
10
14
  //# sourceMappingURL=util.d.ts.map
@@ -1,3 +1,4 @@
1
+ import { DateType } from "../../../common/types.js";
1
2
  import { Types } from "mongoose";
2
3
 
3
4
  //#region src/core/types/common/index.d.ts
@@ -8,8 +9,8 @@ type Vertex = ({
8
9
  } | {
9
10
  id: ID;
10
11
  }) & {
11
- createdAt?: string;
12
- updatedAt?: string;
12
+ createdAt?: DateType;
13
+ updatedAt?: DateType;
13
14
  lastModifiedBy?: unknown;
14
15
  ids?: ID;
15
16
  };
@@ -6,7 +6,13 @@ type Interval<T = DateType> = {
6
6
  end: T;
7
7
  };
8
8
  interface AllowedInterval<T = DateType> extends Interval<T> {
9
+ /**
10
+ * @deprecated IS THIS REALLY OPTIONAL? ALSO, IS THIS USED ANYWHERE?
11
+ */
9
12
  day?: number;
13
+ /**
14
+ * @deprecated WHAT IS THE VALUE OF THE STRING!?
15
+ */
10
16
  type?: string;
11
17
  }
12
18
  //#endregion
@@ -1,6 +1,17 @@
1
1
  //#region src/core/types/common/maximum-schedule-span.d.ts
2
+ /**
3
+ * The maximum number of minutes a schedule is allowed to span over a day and week
4
+ */
2
5
  type MaximumScheduleSpan = {
6
+ /**
7
+ * The maximum number of minutes a schedule is allowed to span over a day.
8
+ * The daily schedule span is the duration between the start of the first event and the end of the last event that day.
9
+ */
3
10
  daily?: number | null;
11
+ /**
12
+ * The maximum number of minutes a schedule is allowed to span over a week.
13
+ * The weekly schedule span is the sum of the daily schedule spans for each day of the week.
14
+ */
4
15
  weekly?: number | null;
5
16
  };
6
17
  //#endregion
@@ -1,5 +1,11 @@
1
1
  //#region src/core/types/common/planned-schedule-duration.d.ts
2
+ /**
3
+ * The planned/expected total weekly minutes of schedule events assigned to a teacher
4
+ */
2
5
  type PlannedScheduledDuration = {
6
+ /**
7
+ * The planned/expected total weekly minutes of schedule events assigned to a teacher
8
+ */
3
9
  weekly?: number | null;
4
10
  };
5
11
  //#endregion
@@ -1,5 +1,5 @@
1
- import { AvailableLocation, GroupReference, PersonReference, Vertex } from "./common/index.js";
2
1
  import { DateType } from "../../common/types.js";
2
+ import { AvailableLocation, GroupReference, PersonReference, Vertex } from "./common/index.js";
3
3
  import { BreakLength } from "./common/break-lengths.js";
4
4
  import { AllowedInterval } from "./common/intervals.js";
5
5
  import { Day } from "./common/days.js";
@@ -48,7 +48,9 @@ type Course = Vertex & {
48
48
  overlapSpecies?: OverlapGroup | null;
49
49
  plannedDuration?: string;
50
50
  tags?: Tag[];
51
+ /** @deprecated replaced by plannedDuration? */
51
52
  minutesPerWeek?: number;
53
+ /** @deprecated replaced by plannedDuration? */
52
54
  expectedTotalHours?: number;
53
55
  };
54
56
  //#endregion
@@ -1,5 +1,5 @@
1
- import { Vertex } from "./common/index.js";
2
1
  import { DateType } from "../../common/types.js";
2
+ import { Vertex } from "./common/index.js";
3
3
  import { RootInterval } from "./root-intervals.js";
4
4
  import { MaximumScheduleSpan } from "./common/maximum-schedule-span.js";
5
5
  import { PlannedScheduledDuration } from "./common/planned-schedule-duration.js";
@@ -44,7 +44,9 @@ type DivisionSettings = Vertex & {
44
44
  eventTime?: number;
45
45
  eventTimeActive?: boolean;
46
46
  defaultRootInterval?: RootInterval;
47
+ /** @deprecated replaced by defaultMaximumScheduleSpan */
47
48
  defaultMaxNumWorkingHours?: number | null;
49
+ /** @deprecated replaced by defaultMaximumScheduleSpan */
48
50
  defaultMaxNumDailyWorkingHours?: number | null;
49
51
  };
50
52
  //#endregion
@@ -1,5 +1,5 @@
1
- import { Vertex } from "./common/index.js";
2
1
  import { DateType } from "../../common/types.js";
2
+ import { Vertex } from "./common/index.js";
3
3
  import { DivisionSettings } from "./division-settings.js";
4
4
  import { Meta } from "./common/meta.js";
5
5
 
@@ -8,7 +8,7 @@ import { Meta } from "./common/meta.js";
8
8
  type StepGuideProgress = {
9
9
  checked: string[];
10
10
  completed: boolean;
11
- updatedAt?: string;
11
+ updatedAt?: DateType;
12
12
  };
13
13
  type Division = Vertex & {
14
14
  settings?: DivisionSettings;
@@ -1,5 +1,5 @@
1
- import { AvailableLocation, GroupReference, PersonReference, Vertex } from "./common/index.js";
2
1
  import { DateType } from "../../common/types.js";
2
+ import { AvailableLocation, GroupReference, PersonReference, Vertex } from "./common/index.js";
3
3
  import { BreakLength } from "./common/break-lengths.js";
4
4
  import { AllowedInterval } from "./common/intervals.js";
5
5
  import { Day } from "./common/days.js";
@@ -1,5 +1,5 @@
1
- import { Coalesced, Vertex } from "./common/index.js";
2
1
  import { DateType } from "../../common/types.js";
2
+ import { Coalesced, Vertex } from "./common/index.js";
3
3
  import { Group } from "./groups.js";
4
4
  import { Person } from "./persons.js";
5
5
  import { Teacher } from "./teachers.js";
@@ -31,7 +31,9 @@ type Group = Vertex & {
31
31
  rootInterval?: RootInterval;
32
32
  days?: Day[];
33
33
  tags?: Tag[];
34
+ /** @deprecated replaced by maximumScheduleSpan */
34
35
  maxNumWorkingHours?: number | boolean;
36
+ /** @deprecated replaced by maximumScheduleSpan */
35
37
  maxNumDailyWorkingHours?: number | number[] | boolean;
36
38
  };
37
39
  //#endregion
@@ -1,5 +1,5 @@
1
- import { Coalesced, Vertex } from "./common/index.js";
2
1
  import { DateType } from "../../common/types.js";
2
+ import { Coalesced, Vertex } from "./common/index.js";
3
3
  import { AllowedInterval } from "./common/intervals.js";
4
4
  import { Day } from "./common/days.js";
5
5
  import { Tag } from "./common/tag.js";
@@ -11,7 +11,7 @@ import { Course } from "./courses.js";
11
11
  import { Division } from "./divisions.js";
12
12
 
13
13
  //#region src/core/types/locked-times.d.ts
14
- type Type = 'LUNCH' | 'COMPLEMENTARY_TIME';
14
+ type Type = /* 'ANY' | */'LUNCH' | 'COMPLEMENTARY_TIME';
15
15
  type LockedTime = Vertex & {
16
16
  belongsTo?: Division;
17
17
  displayName?: string;
@@ -1,5 +1,5 @@
1
- import { Vertex } from "./common/index.js";
2
1
  import { DateType } from "../../common/types.js";
2
+ import { Vertex } from "./common/index.js";
3
3
  import { Tag } from "./common/tag.js";
4
4
  import { Group } from "./groups.js";
5
5
  import { LockedTime } from "./locked-times.js";
@@ -31,7 +31,9 @@ type Teacher = Vertex & {
31
31
  signature?: string;
32
32
  rank?: number;
33
33
  tags?: Tag[];
34
+ /** @deprecated replaced by maximumScheduleSpan */
34
35
  maxNumWorkingHours?: number | boolean;
36
+ /** @deprecated replaced by maximumScheduleSpan */
35
37
  maxNumDailyWorkingHours?: number | number[] | boolean;
36
38
  };
37
39
  //#endregion
@@ -42,8 +42,17 @@ type _Mixed<T extends Vertex, Depth extends SupportedDepths = MaxDepth, IgnoreIn
42
42
  depth: Depth;
43
43
  ignoreInternalId: IgnoreInternalId;
44
44
  }> };
45
+ /**
46
+ * Given a vertex type, this will return a new type where all references to other vertices are replaced with their mixed type.
47
+ */
45
48
  type Mixed<T extends Vertex> = _Mixed<T>;
49
+ /**
50
+ * Given a vertex type, this will return a new type where all references to other vertices are replaced with their mixed type, but without the internal id (`_id` and `id`)
51
+ */
46
52
  type MixedWithoutInternalId<T extends Vertex> = Omit<_Mixed<T, MaxDepth, true>, InternalIdKey>;
53
+ /**
54
+ * Given a vertex type, this will return a new type where all references to other vertices are replaced with their serialized type at the specified depth.
55
+ */
47
56
  type Serialized<T extends Vertex, DepthIndex extends SupportedDepths = 0> = Vertex & { [K in keyof T]: TransformGeneral<T[K], {
48
57
  type: 'serialized';
49
58
  depth: DepthIndex;
@@ -51,6 +60,10 @@ type Serialized<T extends Vertex, DepthIndex extends SupportedDepths = 0> = Vert
51
60
  type: 'serialized';
52
61
  depth: DepthIndex;
53
62
  }> };
63
+ /**
64
+ * Given a object that contains entries of vertices or arrays of vertices, this will return a new type where all references to other vertices are replaced with their serialized type.
65
+ */
66
+
54
67
  //#endregion
55
68
  export { Mixed, MixedWithoutInternalId, Serialized };
56
69
  //# sourceMappingURL=vertex-mapping.d.ts.map
package/dist/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
- import { Types as Types$14 } from "./Skola24/txt/types/index.js";
1
+ import { Types as Types$15 } from "./Skola24/txt/types/index.js";
2
2
  import { Types as Types$2 } from "./core/types/index.js";
3
3
  import { CoreMap } from "./core/index.js";
4
- import { Types as Types$13 } from "./Skola24/mdb/types/index.js";
4
+ import { Types as Types$14 } from "./Skola24/mdb/types/index.js";
5
5
  import { Types as Types$3 } from "./Excel/v1/types/index.js";
6
6
  import { Types as Types$4 } from "./Excel/v2/types/index.js";
7
- import { Types as Types$10 } from "./SchoolSoft/file/types/index.js";
8
- import { Types as Types$9 } from "./SchoolSoft/api/types/index.js";
7
+ import { Types as Types$11 } from "./SchoolSoft/file/types/index.js";
8
+ import { Types as Types$10 } from "./SchoolSoft/api/types/index.js";
9
9
  import { SchoolSoftMap } from "./SchoolSoft/index.js";
10
10
  import { Types as Types$7 } from "./PlanDigital/types/index.js";
11
11
  import { PlanDigitalMap } from "./PlanDigital/index.js";
@@ -21,13 +21,15 @@ import { identify } from "./identify/index.js";
21
21
  import { Types as Types$6 } from "./InfoMentor/types/index.js";
22
22
  import { InfoMentorMap } from "./InfoMentor/index.js";
23
23
  import { Skola24Map } from "./Skola24/index.js";
24
- import { Types as Types$12 } from "./sdui/types/index.js";
24
+ import { Types as Types$13 } from "./sdui/types/index.js";
25
25
  import { SduiMap } from "./sdui/index.js";
26
+ import { Types as Types$9 } from "./SS12000/types/index.js";
27
+ import { SS12000Map } from "./SS12000/index.js";
26
28
  import { vKlassMap } from "./vKlass/index.js";
27
29
  import { ExcelMap } from "./Excel/index.js";
28
- import { Types as Types$11 } from "./Schoolity/txt/types/index.js";
30
+ import { Types as Types$12 } from "./Schoolity/txt/types/index.js";
29
31
  import { SchoolityMap } from "./Schoolity/index.js";
30
32
  import { QuiculumMap } from "./Quiculum/index.js";
31
33
  import { Types } from "./Additio/types/index.js";
32
34
  import { AdditioMap } from "./Additio/index.js";
33
- export { AdditioMap, Types as AdditioTypes, AdmentumMap, Types$1 as AdmentumTypes, CoreMap, Types$2 as CoreTypes, ExcelMap, Types$3 as ExcelV1Types, Types$4 as ExcelV2Types, IdentifiedMaps, IdunSoftMap, Types$5 as IdunSoftTypes, InfoMentorMap, Types$6 as InfoMentorTypes, MapInstance, MapName, PlanDigitalMap, Types$7 as PlanDigitalTypes, QuiculumMap, RSMap, Types$8 as RSTypes, Types$9 as SchoolSoftApiTypes, Types$10 as SchoolSoftFileTypes, SchoolSoftMap, SchoolityMap, Types$11 as SchoolityTXTTypes, SduiMap, Types$12 as SduiTypes, Types$13 as Skola24MDBTypes, Skola24Map, Types$14 as Skola24TXTTypes, identify, maps, vKlassMap };
35
+ export { AdditioMap, Types as AdditioTypes, AdmentumMap, Types$1 as AdmentumTypes, CoreMap, Types$2 as CoreTypes, ExcelMap, Types$3 as ExcelV1Types, Types$4 as ExcelV2Types, IdentifiedMaps, IdunSoftMap, Types$5 as IdunSoftTypes, InfoMentorMap, Types$6 as InfoMentorTypes, MapInstance, MapName, PlanDigitalMap, Types$7 as PlanDigitalTypes, QuiculumMap, RSMap, Types$8 as RSTypes, SS12000Map, Types$9 as SS12000Types, Types$10 as SchoolSoftApiTypes, Types$11 as SchoolSoftFileTypes, SchoolSoftMap, SchoolityMap, Types$12 as SchoolityTXTTypes, SduiMap, Types$13 as SduiTypes, Types$14 as Skola24MDBTypes, Skola24Map, Types$15 as Skola24TXTTypes, identify, maps, vKlassMap };
package/dist/index.js CHANGED
@@ -10,9 +10,10 @@ import { maps } from "./identify/constants/index.js";
10
10
  import { identify } from "./identify/index.js";
11
11
  import { InfoMentorMap } from "./InfoMentor/index.js";
12
12
  import { SduiMap } from "./sdui/index.js";
13
+ import { SS12000Map } from "./SS12000/index.js";
13
14
  import { vKlassMap } from "./vKlass/index.js";
14
15
  import { SchoolityMap } from "./Schoolity/index.js";
15
16
  import { QuiculumMap } from "./Quiculum/index.js";
16
17
  import { AdditioMap } from "./Additio/index.js";
17
18
 
18
- export { AdditioMap, AdmentumMap, CoreMap, ExcelMap, IdunSoftMap, InfoMentorMap, PlanDigitalMap, QuiculumMap, RSMap, SchoolSoftMap, SchoolityMap, SduiMap, Skola24Map, identify, maps, vKlassMap };
19
+ export { AdditioMap, AdmentumMap, CoreMap, ExcelMap, IdunSoftMap, InfoMentorMap, PlanDigitalMap, QuiculumMap, RSMap, SS12000Map, SchoolSoftMap, SchoolityMap, SduiMap, Skola24Map, identify, maps, vKlassMap };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@royalschedule/maps",
3
3
  "description": "",
4
- "version": "4.0.0",
4
+ "version": "4.0.2",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",