@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.
- package/dist/Additio/types/options.d.ts +8 -0
- package/dist/Excel/v1/from/index.js +2 -2
- package/dist/Excel/v1/from/index.js.map +1 -1
- package/dist/Excel/v2/from/index.js +2 -2
- package/dist/Excel/v2/from/index.js.map +1 -1
- package/dist/InfoMentor/to/schedules.js +2 -2
- package/dist/InfoMentor/to/schedules.js.map +1 -1
- package/dist/PlanDigital/index.d.ts +26 -26
- package/dist/RS/make-connected.js +2 -2
- package/dist/RS/make-connected.js.map +1 -1
- package/dist/RS/types/event-configuration.d.ts +3 -0
- package/dist/RS/types/groups.d.ts +2 -0
- package/dist/RS/types/to.d.ts +15 -0
- package/dist/SS12000/from/activities.js +36 -0
- package/dist/SS12000/from/activities.js.map +1 -0
- package/dist/SS12000/from/calendar-events.js +20 -0
- package/dist/SS12000/from/calendar-events.js.map +1 -0
- package/dist/SS12000/from/duties.js +21 -0
- package/dist/SS12000/from/duties.js.map +1 -0
- package/dist/SS12000/from/groups.js +23 -0
- package/dist/SS12000/from/groups.js.map +1 -0
- package/dist/SS12000/from/index.js +24 -0
- package/dist/SS12000/from/index.js.map +1 -0
- package/dist/SS12000/from/persons.js +43 -0
- package/dist/SS12000/from/persons.js.map +1 -0
- package/dist/SS12000/from/resources.js +9 -0
- package/dist/SS12000/from/resources.js.map +1 -0
- package/dist/SS12000/from/rooms.js +18 -0
- package/dist/SS12000/from/rooms.js.map +1 -0
- package/dist/SS12000/from/syllabuses.js +21 -0
- package/dist/SS12000/from/syllabuses.js.map +1 -0
- package/dist/SS12000/index.d.ts +36 -0
- package/dist/SS12000/index.js +12 -0
- package/dist/SS12000/index.js.map +1 -0
- package/dist/SS12000/to/activities.js +63 -0
- package/dist/SS12000/to/activities.js.map +1 -0
- package/dist/SS12000/to/calendar-events.js +53 -0
- package/dist/SS12000/to/calendar-events.js.map +1 -0
- package/dist/SS12000/to/common.js +25 -0
- package/dist/SS12000/to/common.js.map +1 -0
- package/dist/SS12000/to/duties.js +45 -0
- package/dist/SS12000/to/duties.js.map +1 -0
- package/dist/SS12000/to/groups.js +47 -0
- package/dist/SS12000/to/groups.js.map +1 -0
- package/dist/SS12000/to/index.d.ts +58 -0
- package/dist/SS12000/to/index.js +24 -0
- package/dist/SS12000/to/index.js.map +1 -0
- package/dist/SS12000/to/persons.js +40 -0
- package/dist/SS12000/to/persons.js.map +1 -0
- package/dist/SS12000/to/resources.js +27 -0
- package/dist/SS12000/to/resources.js.map +1 -0
- package/dist/SS12000/to/rooms.js +32 -0
- package/dist/SS12000/to/rooms.js.map +1 -0
- package/dist/SS12000/to/syllabuses.js +34 -0
- package/dist/SS12000/to/syllabuses.js.map +1 -0
- package/dist/SS12000/types/activities.d.ts +41 -0
- package/dist/SS12000/types/calendar-events.d.ts +23 -0
- package/dist/SS12000/types/codes.d.ts +9 -0
- package/dist/SS12000/types/duties.d.ts +23 -0
- package/dist/SS12000/types/duty-assignments.d.ts +13 -0
- package/dist/SS12000/types/groups.d.ts +23 -0
- package/dist/SS12000/types/index.d.ts +21 -0
- package/dist/SS12000/types/organisation.d.ts +20 -0
- package/dist/SS12000/types/persons.d.ts +30 -0
- package/dist/SS12000/types/resources.d.ts +13 -0
- package/dist/SS12000/types/rooms.d.ts +17 -0
- package/dist/SS12000/types/syllabus.d.ts +19 -0
- package/dist/Skola24/txt/types/index.d.ts +13 -0
- package/dist/common/types.d.ts +7 -0
- package/dist/core/to/util.d.ts +5 -1
- package/dist/core/types/common/index.d.ts +3 -2
- package/dist/core/types/common/intervals.d.ts +6 -0
- package/dist/core/types/common/maximum-schedule-span.d.ts +11 -0
- package/dist/core/types/common/planned-schedule-duration.d.ts +6 -0
- package/dist/core/types/courses.d.ts +3 -1
- package/dist/core/types/division-settings.d.ts +3 -1
- package/dist/core/types/divisions.d.ts +2 -2
- package/dist/core/types/events.d.ts +1 -1
- package/dist/core/types/exceptions.d.ts +1 -1
- package/dist/core/types/groups.d.ts +2 -0
- package/dist/core/types/locked-times.d.ts +2 -2
- package/dist/core/types/persons.d.ts +1 -1
- package/dist/core/types/teachers.d.ts +2 -0
- package/dist/core/vertex-mapping.d.ts +13 -0
- package/dist/index.d.ts +9 -7
- package/dist/index.js +2 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"duties.js","names":["toPerson"],"sources":["../../../src/SS12000/to/duties.ts"],"sourcesContent":["import { isString, has, get, omitBy, isNil } from 'lodash-es';\nimport moment from 'moment';\nimport type { CoreTypes } from '../../core';\nimport type { Duty } from '../types/duties';\nimport { getDivisionId, toReference } from './common';\nimport toPerson from './persons';\n\ntype Expand = ('referenceNames' | 'person')[];\n\n/**\n * @deprecated This is only used for SCS. can be removed when scs use v2\n */\nexport default (\n teachers: Extract<CoreTypes.mixed.teacher, { id: string }>[],\n belongsTo?: Extract<CoreTypes.division, { id: string }>,\n expand?: Expand\n): Duty[] => {\n if (!Array.isArray(teachers))\n throw new Error('(SS12000::To::Duty) Teacher input is not of array type', { cause: 'invalid_input' });\n\n if (!teachers.every((teacher) => isString(teacher) || isString(get(teacher, 'id'))))\n throw new Error('(SS12000::To::Duty) Some teachers are missing \"id\" values', { cause: 'invalid_input' });\n\n if (!belongsTo && !teachers.every((teacher) => (isString(teacher) && belongsTo) || has(teacher, 'belongsTo')))\n throw new Error('(SS12000::To::Duty) Some top layer teachers are missing \"belongsTo\" values', { cause: 'invalid_input' });\n\n return teachers.map((teacher) => {\n const division = belongsTo ?? (!isString(teacher) ? teacher.belongsTo : undefined);\n if (!division || isString(division) || !('id' in division && division.id))\n throw new Error('(SS12000::To::Duty) Some teachers members are missing \"belongsTo\" values', { cause: 'invalid_input' });\n if (!('start' in division && division.start) || !('end' in division && division.end))\n throw new Error('(SS12000::To::Duty) Some teachers members are missing \"belongsTo\" start or end values', { cause: 'invalid_input' });\n\n const person = (!isString(teacher) && teacher.person && !isString(teacher.person)) ?\n teacher.person as Extract<CoreTypes.mixed.person, { id: string }>\n : undefined;\n\n return {\n id: `${ getDivisionId(teacher, belongsTo) }.${ isString(teacher) ? teacher : teacher.id }`,\n dutyRole: 'Lärare' as const,\n startDate: moment(division.start).toISOString(),\n endDate: moment(division.end).toISOString(),\n ...typeof teacher != 'string' && {\n meta: {\n created: moment(teacher.createdAt).toISOString(),\n modified: moment(teacher.updatedAt).toISOString()\n },\n ...omitBy({\n foreignId: teacher.ids,\n displayName: teacher.displayName,\n }, isNil),\n ...person && {\n person: {\n // @ts-ignore\n ...toReference([person], belongsTo ?? teacher.belongsTo)[0],\n ...expand?.includes('referenceNames') && {\n displayName: `${ person.firstName ?? '' } ${ person.lastName ?? '' }`\n }\n }\n },\n ...expand?.some(x => ['person'].includes(x)) && {\n _embedded: {\n ...(expand.includes('person') && person) && {\n person: toPerson([person], division as Extract<CoreTypes.division, { id: string }>)[0]\n }\n }\n }\n }\n };\n });\n};"],"mappings":";;;;;;;;;AAYA,sBACE,UACA,WACA,WACW;AACX,KAAI,CAAC,MAAM,QAAQ,UACjB,OAAM,IAAI,MAAM,0DAA0D,EAAE,OAAO;AAErF,KAAI,CAAC,SAAS,OAAO,YAAY,SAAS,YAAY,SAAS,IAAI,SAAS,QAC1E,OAAM,IAAI,MAAM,+DAA6D,EAAE,OAAO;AAExF,KAAI,CAAC,aAAa,CAAC,SAAS,OAAO,YAAa,SAAS,YAAY,aAAc,IAAI,SAAS,cAC9F,OAAM,IAAI,MAAM,gFAA8E,EAAE,OAAO;AAEzG,QAAO,SAAS,KAAK,YAAY;EAC/B,MAAM,WAAW,cAAc,CAAC,SAAS,WAAW,QAAQ,YAAY;AACxE,MAAI,CAAC,YAAY,SAAS,aAAa,EAAE,QAAQ,YAAY,SAAS,IACpE,OAAM,IAAI,MAAM,8EAA4E,EAAE,OAAO;AACvG,MAAI,EAAE,WAAW,YAAY,SAAS,UAAU,EAAE,SAAS,YAAY,SAAS,KAC9E,OAAM,IAAI,MAAM,2FAAyF,EAAE,OAAO;EAEpH,MAAM,SAAU,CAAC,SAAS,YAAY,QAAQ,UAAU,CAAC,SAAS,QAAQ,UACxE,QAAQ,SACN;AAEJ,SAAO;GACL,IAAW,GAAI,cAAc,SAAS,WAAY,GAAI,SAAS,WAAW,UAAU,QAAQ;GAC5F,UAAW;GACX,WAAW,OAAO,SAAS,OAAO;GAClC,SAAW,OAAO,SAAS,KAAK;GAChC,GAAG,OAAO,WAAW,YAAY;IAC/B,MAAM;KACJ,SAAU,OAAO,QAAQ,WAAW;KACpC,UAAU,OAAO,QAAQ,WAAW;;IAEtC,GAAG,OAAO;KACR,WAAa,QAAQ;KACrB,aAAa,QAAQ;OACpB;IACH,GAAG,UAAU,EACX,QAAQ;KAEN,GAAG,YAAY,CAAC,SAAS,aAAa,QAAQ,WAAW;KACzD,GAAG,QAAQ,SAAS,qBAAqB,EACvC,aAAa,GAAI,OAAO,aAAa,GAAI,GAAI,OAAO,YAAY;;IAItE,GAAG,QAAQ,MAAK,MAAK,CAAC,UAAU,SAAS,OAAO,EAC9C,WAAW,EACT,GAAI,OAAO,SAAS,aAAa,UAAW,EAC1C,QAAQA,gBAAS,CAAC,SAAS,UAAyD"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { getDivisionId, toReference } from "./common.js";
|
|
2
|
+
import persons_default from "./persons.js";
|
|
3
|
+
import { get, has, isNil, isString, omitBy } from "lodash-es";
|
|
4
|
+
import moment from "moment";
|
|
5
|
+
|
|
6
|
+
//#region src/SS12000/to/groups.ts
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated This is only used for SCS. can be removed when scs use v2
|
|
9
|
+
*/
|
|
10
|
+
var groups_default = (groups, belongsTo, expand) => {
|
|
11
|
+
if (!Array.isArray(groups)) throw new Error("(SS12000::To::Groups) Group input is not of array type", { cause: "invalid_input" });
|
|
12
|
+
if (!groups.every((group) => isString(group) || isString(get(group, "id")))) throw new Error("(SS12000::To::Groups) Some groups are missing \"id\" values", { cause: "invalid_input" });
|
|
13
|
+
if (!belongsTo && !groups.every((group) => isString(group) && belongsTo || has(group, "belongsTo"))) throw new Error("(SS12000::To::Groups) Some top layer groups are missing \"belongsTo\" values", { cause: "invalid_input" });
|
|
14
|
+
return groups.map((group) => {
|
|
15
|
+
if (!isString(group) && group.members?.some((member) => isString(member))) throw new Error("(SS12000::To::Groups) Some group members are missing \"id\" values", { cause: "invalid_input" });
|
|
16
|
+
const members = !isString(group) && group.members?.length && !isString(group.members[0]) ? group.members : [];
|
|
17
|
+
const division = belongsTo ?? (!isString(group) ? group.belongsTo : void 0);
|
|
18
|
+
if (!division || isString(division) || !("id" in division && division.id)) throw new Error("(SS12000::To::Groups) Some group members are missing \"belongsTo\" values", { cause: "invalid_input" });
|
|
19
|
+
if (!("start" in division && division.start) || !("end" in division && division.end)) throw new Error("(SS12000::To::Groups) Some group members are missing \"belongsTo\" start or end values", { cause: "invalid_input" });
|
|
20
|
+
return {
|
|
21
|
+
id: `${getDivisionId(group, belongsTo)}.${isString(group) ? group : group.id}`,
|
|
22
|
+
groupType: group.species === "class" ? "Klass" : "Undervisning",
|
|
23
|
+
startDate: moment(division.start).toISOString(),
|
|
24
|
+
endDate: moment(division.end).toISOString(),
|
|
25
|
+
...!isString(group) && {
|
|
26
|
+
meta: {
|
|
27
|
+
created: moment(group.createdAt).toISOString(),
|
|
28
|
+
modified: moment(group.updatedAt).toISOString()
|
|
29
|
+
},
|
|
30
|
+
...omitBy({
|
|
31
|
+
foreignId: group.ids,
|
|
32
|
+
displayName: group.displayName
|
|
33
|
+
}, isNil),
|
|
34
|
+
...group.members && { groupMemberships: toReference(members, division).map((person) => ({
|
|
35
|
+
startDate: moment(division.start).toISOString(),
|
|
36
|
+
endDate: moment(division.end).toISOString(),
|
|
37
|
+
person
|
|
38
|
+
})) },
|
|
39
|
+
...expand?.some((x) => ["persons"].includes(x)) && { _embedded: { ...expand.includes("persons") && { groups: persons_default(members, division) } } }
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
//#endregion
|
|
46
|
+
export { groups_default as default };
|
|
47
|
+
//# sourceMappingURL=groups.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"groups.js","names":["toPerson"],"sources":["../../../src/SS12000/to/groups.ts"],"sourcesContent":["import { isString, has, get, omitBy, isNil } from 'lodash-es';\nimport moment from 'moment';\nimport type { CoreTypes } from '../../core';\nimport type { Group } from '../types/groups';\nimport { getDivisionId, toReference } from './common';\nimport toPerson from './persons';\n\ntype Expand = ('referenceNames' | 'persons')[];\n\n/**\n * @deprecated This is only used for SCS. can be removed when scs use v2\n */\nexport default (\n groups: Exclude<Extract<CoreTypes.mixed.group, { id: string }>, { members: string[] }>[],\n belongsTo?: Extract<CoreTypes.division, { id: string }>,\n expand?: Expand\n): Group[] => {\n if (!Array.isArray(groups))\n throw new Error('(SS12000::To::Groups) Group input is not of array type', { cause: 'invalid_input' });\n\n if (!groups.every((group) => isString(group) || isString(get(group, 'id'))))\n throw new Error('(SS12000::To::Groups) Some groups are missing \"id\" values', { cause: 'invalid_input' });\n\n if (!belongsTo && !groups.every((group) => (isString(group) && belongsTo) || has(group, 'belongsTo')))\n throw new Error('(SS12000::To::Groups) Some top layer groups are missing \"belongsTo\" values', { cause: 'invalid_input' });\n\n return groups.map((group) => {\n if (! isString(group) && group.members?.some((member) => isString(member))) {\n throw new Error('(SS12000::To::Groups) Some group members are missing \"id\" values', { cause: 'invalid_input' });\n }\n const members = !isString(group) && group.members?.length && !isString(group.members[0])\n ? group.members as Extract<CoreTypes.mixed.person, { id: string }>[]\n : [];\n\n const division = belongsTo ?? (!isString(group) ? group.belongsTo : undefined);\n if (!division || isString(division) || !('id' in division && division.id))\n throw new Error('(SS12000::To::Groups) Some group members are missing \"belongsTo\" values', { cause: 'invalid_input' });\n if (!('start' in division && division.start) || !('end' in division && division.end))\n throw new Error('(SS12000::To::Groups) Some group members are missing \"belongsTo\" start or end values', { cause: 'invalid_input' });\n\n return {\n id: `${ getDivisionId(group, belongsTo) }.${ isString(group) ? group : group.id }`,\n groupType: group.species === 'class' ? 'Klass' : 'Undervisning',\n startDate: moment(division.start).toISOString(),\n endDate: moment(division.end).toISOString(),\n ...!isString(group) && {\n meta: {\n created: moment(group.createdAt).toISOString(),\n modified: moment(group.updatedAt).toISOString()\n },\n /*\n Optionally add the following properties\n */\n ...omitBy({\n foreignId: group.ids,\n displayName: group.displayName,\n }, isNil),\n ...group.members && {\n // @ts-ignore\n groupMemberships: toReference(members, division).map(person => ({\n startDate: moment(division.start).toISOString(),\n endDate: moment(division.end).toISOString(),\n person: person\n }))\n },\n ...expand?.some(x => ['persons'].includes(x)) && {\n _embedded: {\n ...expand.includes('persons') && {\n groups: toPerson(members, division as Extract<CoreTypes.division, { id: string }>)\n }\n }\n }\n }\n };\n });\n};"],"mappings":";;;;;;;;;AAYA,sBACE,QACA,WACA,WACY;AACZ,KAAI,CAAC,MAAM,QAAQ,QACjB,OAAM,IAAI,MAAM,0DAA0D,EAAE,OAAO;AAErF,KAAI,CAAC,OAAO,OAAO,UAAU,SAAS,UAAU,SAAS,IAAI,OAAO,QAClE,OAAM,IAAI,MAAM,+DAA6D,EAAE,OAAO;AAExF,KAAI,CAAC,aAAa,CAAC,OAAO,OAAO,UAAW,SAAS,UAAU,aAAc,IAAI,OAAO,cACtF,OAAM,IAAI,MAAM,gFAA8E,EAAE,OAAO;AAEzG,QAAO,OAAO,KAAK,UAAU;AAC3B,MAAI,CAAE,SAAS,UAAU,MAAM,SAAS,MAAM,WAAW,SAAS,SAChE,OAAM,IAAI,MAAM,sEAAoE,EAAE,OAAO;EAE/F,MAAM,UAAU,CAAC,SAAS,UAAU,MAAM,SAAS,UAAU,CAAC,SAAS,MAAM,QAAQ,MACjF,MAAM,UACN;EAEJ,MAAM,WAAW,cAAc,CAAC,SAAS,SAAS,MAAM,YAAY;AACpE,MAAI,CAAC,YAAY,SAAS,aAAa,EAAE,QAAQ,YAAY,SAAS,IACpE,OAAM,IAAI,MAAM,6EAA2E,EAAE,OAAO;AACtG,MAAI,EAAE,WAAW,YAAY,SAAS,UAAU,EAAE,SAAS,YAAY,SAAS,KAC9E,OAAM,IAAI,MAAM,0FAAwF,EAAE,OAAO;AAEnH,SAAO;GACL,IAAW,GAAI,cAAc,OAAO,WAAY,GAAI,SAAS,SAAS,QAAQ,MAAM;GACpF,WAAW,MAAM,YAAY,UAAU,UAAU;GACjD,WAAW,OAAO,SAAS,OAAO;GAClC,SAAW,OAAO,SAAS,KAAK;GAChC,GAAG,CAAC,SAAS,UAAU;IACrB,MAAM;KACJ,SAAU,OAAO,MAAM,WAAW;KAClC,UAAU,OAAO,MAAM,WAAW;;IAKpC,GAAG,OAAO;KACR,WAAa,MAAM;KACnB,aAAa,MAAM;OAClB;IACH,GAAG,MAAM,WAAW,EAElB,kBAAkB,YAAY,SAAS,UAAU,KAAI,YAAW;KAC9D,WAAW,OAAO,SAAS,OAAO;KAClC,SAAW,OAAO,SAAS,KAAK;KACrB;;IAGf,GAAG,QAAQ,MAAK,MAAK,CAAC,WAAW,SAAS,OAAO,EAC/C,WAAW,EACT,GAAG,OAAO,SAAS,cAAc,EAC/B,QAAQA,gBAAS,SAAS"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Types } from "../../core/types/index.js";
|
|
2
|
+
import { Person } from "../types/persons.js";
|
|
3
|
+
import { Group } from "../types/groups.js";
|
|
4
|
+
import { Duty } from "../types/duties.js";
|
|
5
|
+
import { Room } from "../types/rooms.js";
|
|
6
|
+
import { Syllabus } from "../types/syllabus.js";
|
|
7
|
+
import { Activity } from "../types/activities.js";
|
|
8
|
+
import { Resource } from "../types/resources.js";
|
|
9
|
+
import { CalendarEvent } from "../types/calendar-events.js";
|
|
10
|
+
|
|
11
|
+
//#region src/SS12000/to/index.d.ts
|
|
12
|
+
declare class export_default {
|
|
13
|
+
static activities: (activities: (Extract<Types.mixed.course, {
|
|
14
|
+
id: string;
|
|
15
|
+
}> | Extract<Types.mixed.event, {
|
|
16
|
+
id: string;
|
|
17
|
+
}>)[], belongsTo?: Extract<Types.division, {
|
|
18
|
+
id: string;
|
|
19
|
+
}>, expand?: ("groups" | "teachers" | "syllabus" | "referenceNames")[]) => Activity[];
|
|
20
|
+
static calendarEvents: (events: Extract<Types.mixed.event, {
|
|
21
|
+
id: string;
|
|
22
|
+
}>[], belongsTo?: Extract<Types.division, {
|
|
23
|
+
id: string;
|
|
24
|
+
}>, expand?: ("groups" | "teachers" | "referenceNames" | "activity")[]) => Partial<CalendarEvent>[];
|
|
25
|
+
static duties: (teachers: Extract<Types.mixed.teacher, {
|
|
26
|
+
id: string;
|
|
27
|
+
}>[], belongsTo?: Extract<Types.division, {
|
|
28
|
+
id: string;
|
|
29
|
+
}>, expand?: ("person" | "referenceNames")[]) => Duty[];
|
|
30
|
+
static groups: (groups: Exclude<Extract<Types.mixed.group, {
|
|
31
|
+
id: string;
|
|
32
|
+
}>, {
|
|
33
|
+
members: string[];
|
|
34
|
+
}>[], belongsTo?: Extract<Types.division, {
|
|
35
|
+
id: string;
|
|
36
|
+
}>, expand?: ("persons" | "referenceNames")[]) => Group[];
|
|
37
|
+
static persons: (persons: Extract<Types.mixed.person, {
|
|
38
|
+
id: string;
|
|
39
|
+
}>[], belongsTo?: Extract<Types.division, {
|
|
40
|
+
id: string;
|
|
41
|
+
}>) => Person[];
|
|
42
|
+
static resources: (resources: any[], belongsTo?: Extract<Types.division, {
|
|
43
|
+
id: string;
|
|
44
|
+
}>) => Resource[];
|
|
45
|
+
static rooms: (locations: (Extract<Types.mixed.location, {
|
|
46
|
+
id: string;
|
|
47
|
+
}> | string)[], belongsTo?: Extract<Types.division, {
|
|
48
|
+
id: string;
|
|
49
|
+
}>) => Room[];
|
|
50
|
+
static syllabuses: (syllabuses: (Extract<Types.mixed.syllabus, {
|
|
51
|
+
id: string;
|
|
52
|
+
}> | string)[], belongsTo?: Extract<Types.division, {
|
|
53
|
+
id: string;
|
|
54
|
+
}>) => Syllabus[];
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
57
|
+
export { export_default };
|
|
58
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import persons_default from "./persons.js";
|
|
2
|
+
import groups_default from "./groups.js";
|
|
3
|
+
import duties_default from "./duties.js";
|
|
4
|
+
import activities_default from "./activities.js";
|
|
5
|
+
import calendar_events_default from "./calendar-events.js";
|
|
6
|
+
import resources_default from "./resources.js";
|
|
7
|
+
import rooms_default from "./rooms.js";
|
|
8
|
+
import syllabuses_default from "./syllabuses.js";
|
|
9
|
+
|
|
10
|
+
//#region src/SS12000/to/index.ts
|
|
11
|
+
var to_default = class {
|
|
12
|
+
static activities = activities_default;
|
|
13
|
+
static calendarEvents = calendar_events_default;
|
|
14
|
+
static duties = duties_default;
|
|
15
|
+
static groups = groups_default;
|
|
16
|
+
static persons = persons_default;
|
|
17
|
+
static resources = resources_default;
|
|
18
|
+
static rooms = rooms_default;
|
|
19
|
+
static syllabuses = syllabuses_default;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
export { to_default as default };
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_activities","_calendarEvents","_duties","_groups","_person","_resources","_rooms","_syllabuses"],"sources":["../../../src/SS12000/to/index.ts"],"sourcesContent":["import _activities from './activities';\nimport _calendarEvents from './calendar-events';\nimport _duties from './duties';\nimport _groups from './groups';\nimport _person from './persons';\nimport _resources from './resources';\nimport _rooms from './rooms';\nimport _syllabuses from './syllabuses';\n\nexport default class {\n static activities = _activities;\n static calendarEvents = _calendarEvents;\n static duties = _duties;\n static groups = _groups;\n static persons = _person;\n static resources = _resources;\n static rooms = _rooms;\n static syllabuses = _syllabuses;\n}"],"mappings":";;;;;;;;;;AASA,uBAAqB;CACnB,OAAO,aAAiBA;CACxB,OAAO,iBAAiBC;CACxB,OAAO,SAAiBC;CACxB,OAAO,SAAiBC;CACxB,OAAO,UAAiBC;CACxB,OAAO,YAAiBC;CACxB,OAAO,QAAiBC;CACxB,OAAO,aAAiBC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { getDivisionId } from "./common.js";
|
|
2
|
+
import { get, has, isNil, isString, omitBy } from "lodash-es";
|
|
3
|
+
import moment from "moment";
|
|
4
|
+
|
|
5
|
+
//#region src/SS12000/to/persons.ts
|
|
6
|
+
const SexMap = {
|
|
7
|
+
Man: "Man",
|
|
8
|
+
Woman: "Kvinna"
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated This is only used for SCS. can be removed when scs use v2
|
|
12
|
+
*/
|
|
13
|
+
var persons_default = (persons, belongsTo) => {
|
|
14
|
+
if (!Array.isArray(persons)) throw new Error("(SS12000::To::Persons) Person input is not of array type", { cause: "invalid_input" });
|
|
15
|
+
if (!persons.every((person) => isString(person) || isString(get(person, "id")))) throw new Error("(SS12000::To::Persons) Some persons are missing \"id\" values", { cause: "invalid_input" });
|
|
16
|
+
if (!belongsTo && !persons.every((person) => isString(person) && belongsTo || has(person, "belongsTo"))) throw new Error("(SS12000::To::Persons) Some top layer persons are missing \"belongsTo\" values", { cause: "invalid_input" });
|
|
17
|
+
return persons.map((person) => ({
|
|
18
|
+
id: `${getDivisionId(person, belongsTo)}.${isString(person) ? person : person.id}`,
|
|
19
|
+
...!isString(person) && {
|
|
20
|
+
meta: {
|
|
21
|
+
created: moment(person.createdAt).toISOString(),
|
|
22
|
+
modified: moment(person.updatedAt).toISOString()
|
|
23
|
+
},
|
|
24
|
+
sex: person.sex ? get(SexMap, person.sex, "Okänt") : "Okänt",
|
|
25
|
+
...omitBy({
|
|
26
|
+
foreignId: person.ids,
|
|
27
|
+
displayName: person.displayName,
|
|
28
|
+
givenName: person.firstName,
|
|
29
|
+
familyName: person.lastName,
|
|
30
|
+
...person.SSN?.value && { civicNo: person.SSN },
|
|
31
|
+
emails: person.emails,
|
|
32
|
+
phoneNumbers: person.phoneNumbers
|
|
33
|
+
}, isNil)
|
|
34
|
+
}
|
|
35
|
+
}));
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
//#endregion
|
|
39
|
+
export { persons_default as default };
|
|
40
|
+
//# sourceMappingURL=persons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persons.js","names":["SexMap: Record<NonNullable<CoreTypes.person['sex']>, Person['sex']>"],"sources":["../../../src/SS12000/to/persons.ts"],"sourcesContent":["import { isString, has, get, omitBy, isNil } from 'lodash-es';\nimport moment from 'moment';\nimport type { CoreTypes } from '../../core';\nimport type { Person } from '../types/persons';\nimport { getDivisionId } from './common';\n\nconst SexMap: Record<NonNullable<CoreTypes.person['sex']>, Person['sex']> = { Man: 'Man', Woman: 'Kvinna' };\nconst TypeMap: Record<\n NonNullable<\n CoreTypes.person['phoneNumbers']\n >[0]['type'],\n NonNullable<\n Person['phoneNumbers']\n >[0]['type']\n> = {\n private: 'Privat',\n organization: 'Arbete övrigt'\n};\n\n/**\n * @deprecated This is only used for SCS. can be removed when scs use v2\n */\nexport default (\n persons: Extract<CoreTypes.mixed.person, { id: string }>[],\n belongsTo?: Extract<CoreTypes.division, { id: string }>\n): Person[] => {\n if (!Array.isArray(persons))\n throw new Error('(SS12000::To::Persons) Person input is not of array type', { cause: 'invalid_input' });\n\n if (!persons.every((person) => isString(person) || isString(get(person, 'id'))))\n throw new Error('(SS12000::To::Persons) Some persons are missing \"id\" values', { cause: 'invalid_input' });\n\n if (!belongsTo && !persons.every((person) => (isString(person) && belongsTo) || has(person, 'belongsTo')))\n throw new Error('(SS12000::To::Persons) Some top layer persons are missing \"belongsTo\" values', { cause: 'invalid_input' });\n\n return persons.map((person) => ({\n id: `${ getDivisionId(person, belongsTo) }.${ isString(person) ? person : person.id }`,\n ...!isString(person) && {\n meta: {\n created: moment(person.createdAt).toISOString(),\n modified: moment(person.updatedAt).toISOString()\n },\n sex: person.sex ? get(SexMap, person.sex, 'Okänt') : 'Okänt',\n ...omitBy({\n foreignId: person.ids,\n displayName: person.displayName,\n givenName: person.firstName,\n familyName: person.lastName,\n ...person.SSN?.value && { civicNo: person.SSN },\n emails: person.emails,\n phoneNumbers: person.phoneNumbers\n }, isNil)\n }\n }));\n};"],"mappings":";;;;;AAMA,MAAMA,SAAsE;CAAE,KAAK;CAAO,OAAO;;;;;AAgBjG,uBACE,SACA,cACa;AACb,KAAI,CAAC,MAAM,QAAQ,SACjB,OAAM,IAAI,MAAM,4DAA4D,EAAE,OAAO;AAEvF,KAAI,CAAC,QAAQ,OAAO,WAAW,SAAS,WAAW,SAAS,IAAI,QAAQ,QACtE,OAAM,IAAI,MAAM,iEAA+D,EAAE,OAAO;AAE1F,KAAI,CAAC,aAAa,CAAC,QAAQ,OAAO,WAAY,SAAS,WAAW,aAAc,IAAI,QAAQ,cAC1F,OAAM,IAAI,MAAM,kFAAgF,EAAE,OAAO;AAE3G,QAAO,QAAQ,KAAK,YAAY;EAC9B,IAAI,GAAI,cAAc,QAAQ,WAAY,GAAI,SAAS,UAAU,SAAS,OAAO;EACjF,GAAG,CAAC,SAAS,WAAW;GACtB,MAAM;IACJ,SAAU,OAAO,OAAO,WAAW;IACnC,UAAU,OAAO,OAAO,WAAW;;GAErC,KAAK,OAAO,MAAM,IAAI,QAAQ,OAAO,KAAK,WAAW;GACrD,GAAG,OAAO;IACR,WAAc,OAAO;IACrB,aAAc,OAAO;IACrB,WAAc,OAAO;IACrB,YAAc,OAAO;IACrB,GAAG,OAAO,KAAK,SAAS,EAAE,SAAS,OAAO;IAC1C,QAAc,OAAO;IACrB,cAAc,OAAO;MACpB"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { getDivisionId } from "./common.js";
|
|
2
|
+
import { get, has, isNil, isString, omitBy } from "lodash-es";
|
|
3
|
+
import moment from "moment";
|
|
4
|
+
|
|
5
|
+
//#region src/SS12000/to/resources.ts
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated This is only used for SCS. can be removed when scs use v2
|
|
8
|
+
*/
|
|
9
|
+
var resources_default = (resources, belongsTo) => {
|
|
10
|
+
if (!Array.isArray(resources)) throw new Error("(SS12000::To::Resources) Resources input is not of array type", { cause: "invalid_input" });
|
|
11
|
+
if (!resources.every((resource) => isString(resource) || isString(get(resource, "id")))) throw new Error("(SS12000::To::Resources) Some resources are missing \"id\" values", { cause: "invalid_input" });
|
|
12
|
+
if (!belongsTo && !resources.every((resource) => isString(resource) && belongsTo || has(resource, "belongsTo"))) throw new Error("(SS12000::To::Resources) Some top layer resources are missing \"belongsTo\" values", { cause: "invalid_input" });
|
|
13
|
+
return resources.map((resource) => ({
|
|
14
|
+
id: `${getDivisionId(resource, belongsTo)}.${isString(resource) ? resource : resource.id}`,
|
|
15
|
+
...!isString(resource) && {
|
|
16
|
+
meta: {
|
|
17
|
+
created: moment(resource.createdAt).toISOString(),
|
|
18
|
+
modified: moment(resource.updatedAt).toISOString()
|
|
19
|
+
},
|
|
20
|
+
...omitBy({ foreignId: resource.ids }, isNil)
|
|
21
|
+
}
|
|
22
|
+
}));
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
//#endregion
|
|
26
|
+
export { resources_default as default };
|
|
27
|
+
//# sourceMappingURL=resources.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resources.js","names":[],"sources":["../../../src/SS12000/to/resources.ts"],"sourcesContent":["import { isString, has, get, omitBy, isNil } from 'lodash-es';\nimport moment from 'moment';\nimport type { CoreTypes } from '../../core';\nimport type { Resource } from '../types/resources';\nimport { getDivisionId } from './common';\n\n/**\n * @deprecated This is only used for SCS. can be removed when scs use v2\n */\nexport default (\n resources: any[],\n belongsTo?: Extract<CoreTypes.division, { id: string }>\n): Resource[] => {\n if (!Array.isArray(resources))\n throw new Error('(SS12000::To::Resources) Resources input is not of array type', { cause: 'invalid_input' });\n\n if (!resources.every((resource) => isString(resource) || isString(get(resource, 'id'))))\n throw new Error('(SS12000::To::Resources) Some resources are missing \"id\" values', { cause: 'invalid_input' });\n\n if (!belongsTo && !resources.every((resource) => (isString(resource) && belongsTo) || has(resource, 'belongsTo')))\n throw new Error('(SS12000::To::Resources) Some top layer resources are missing \"belongsTo\" values', { cause: 'invalid_input' });\n\n return resources.map((resource) => ({\n id: `${ getDivisionId(resource, belongsTo) }.${ isString(resource) ? resource : resource.id }`,\n ...!isString(resource) && {\n meta: {\n created: moment(resource.createdAt).toISOString(),\n modified: moment(resource.updatedAt).toISOString()\n },\n /*\n Optionally add the following properties\n */\n\n ...omitBy({\n foreignId: resource.ids,\n }, isNil)\n }\n }));\n};\n"],"mappings":";;;;;;;;AASA,yBACE,WACA,cACe;AACf,KAAI,CAAC,MAAM,QAAQ,WACjB,OAAM,IAAI,MAAM,iEAAiE,EAAE,OAAO;AAE5F,KAAI,CAAC,UAAU,OAAO,aAAa,SAAS,aAAa,SAAS,IAAI,UAAU,QAC9E,OAAM,IAAI,MAAM,qEAAmE,EAAE,OAAO;AAE9F,KAAI,CAAC,aAAa,CAAC,UAAU,OAAO,aAAc,SAAS,aAAa,aAAc,IAAI,UAAU,cAClG,OAAM,IAAI,MAAM,sFAAoF,EAAE,OAAO;AAE/G,QAAO,UAAU,KAAK,cAAc;EAClC,IAAI,GAAI,cAAc,UAAU,WAAY,GAAI,SAAS,YAAY,WAAW,SAAS;EACzF,GAAG,CAAC,SAAS,aAAa;GACxB,MAAM;IACJ,SAAU,OAAO,SAAS,WAAW;IACrC,UAAU,OAAO,SAAS,WAAW;;GAMvC,GAAG,OAAO,EACR,WAAW,SAAS,OACnB"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { getDivisionId } from "./common.js";
|
|
2
|
+
import { get, has, isNil, isString, omitBy } from "lodash-es";
|
|
3
|
+
import moment from "moment";
|
|
4
|
+
|
|
5
|
+
//#region src/SS12000/to/rooms.ts
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated This is only used for SCS. can be removed when scs use v2
|
|
8
|
+
*/
|
|
9
|
+
var rooms_default = (locations, belongsTo) => {
|
|
10
|
+
if (!Array.isArray(locations)) throw new Error("(SS12000::To::Room) Room input is not of array type", { cause: "invalid_input" });
|
|
11
|
+
if (!locations.every((location) => isString(location) || isString(get(location, "id")))) throw new Error("(SS12000::To::Room) Some locations are missing \"id\" values", { cause: "invalid_input" });
|
|
12
|
+
if (!belongsTo && !locations.every((location) => isString(location) && belongsTo || has(location, "belongsTo"))) throw new Error("(SS12000::To::Room) Some top layer locations are missing \"belongsTo\" values", { cause: "invalid_input" });
|
|
13
|
+
return locations.map((location) => ({
|
|
14
|
+
id: `${getDivisionId(location, belongsTo)}.${isString(location) ? location : location.id}`,
|
|
15
|
+
...!isString(location) && {
|
|
16
|
+
meta: {
|
|
17
|
+
created: moment(location.createdAt).toISOString(),
|
|
18
|
+
modified: moment(location.updatedAt).toISOString()
|
|
19
|
+
},
|
|
20
|
+
...omitBy({
|
|
21
|
+
foreignId: location.ids,
|
|
22
|
+
displayName: location.displayName,
|
|
23
|
+
seats: location.maximumCapacity,
|
|
24
|
+
tags: location.tags
|
|
25
|
+
}, isNil)
|
|
26
|
+
}
|
|
27
|
+
}));
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
//#endregion
|
|
31
|
+
export { rooms_default as default };
|
|
32
|
+
//# sourceMappingURL=rooms.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rooms.js","names":[],"sources":["../../../src/SS12000/to/rooms.ts"],"sourcesContent":["import { isString, has, get, omitBy, isNil } from 'lodash-es';\nimport moment from 'moment';\nimport type { CoreTypes } from '../../core';\nimport type { Room } from '../types/rooms';\nimport { getDivisionId } from './common';\n\n/**\n * @deprecated This is only used for SCS. can be removed when scs use v2\n */\nexport default (\n locations: (Extract<CoreTypes.mixed.location, { id: string }> | string)[],\n belongsTo?: Extract<CoreTypes.division, { id: string }>\n): Room[] => {\n if (!Array.isArray(locations))\n throw new Error('(SS12000::To::Room) Room input is not of array type', { cause: 'invalid_input' });\n\n if (!locations.every((location) => isString(location) || isString(get(location, 'id'))))\n throw new Error('(SS12000::To::Room) Some locations are missing \"id\" values', { cause: 'invalid_input' });\n\n if (!belongsTo && !locations.every((location) => (isString(location) && belongsTo) || has(location, 'belongsTo')))\n throw new Error('(SS12000::To::Room) Some top layer locations are missing \"belongsTo\" values', { cause: 'invalid_input' });\n\n return locations.map((location) => ({\n id: `${ getDivisionId(location, belongsTo) }.${ isString(location) ? location : location.id }`,\n ...!isString(location) && {\n meta: {\n created: moment(location.createdAt).toISOString(),\n modified: moment(location.updatedAt).toISOString()\n },\n ...omitBy({\n foreignId: location.ids,\n displayName: location.displayName,\n seats: location.maximumCapacity,\n tags: location.tags,\n }, isNil),\n }\n }));\n};"],"mappings":";;;;;;;;AASA,qBACE,WACA,cACW;AACX,KAAI,CAAC,MAAM,QAAQ,WACjB,OAAM,IAAI,MAAM,uDAAuD,EAAE,OAAO;AAElF,KAAI,CAAC,UAAU,OAAO,aAAa,SAAS,aAAa,SAAS,IAAI,UAAU,QAC9E,OAAM,IAAI,MAAM,gEAA8D,EAAE,OAAO;AAEzF,KAAI,CAAC,aAAa,CAAC,UAAU,OAAO,aAAc,SAAS,aAAa,aAAc,IAAI,UAAU,cAClG,OAAM,IAAI,MAAM,iFAA+E,EAAE,OAAO;AAE1G,QAAO,UAAU,KAAK,cAAc;EAClC,IAAI,GAAI,cAAc,UAAU,WAAY,GAAI,SAAS,YAAY,WAAW,SAAS;EACzF,GAAG,CAAC,SAAS,aAAa;GACxB,MAAM;IACJ,SAAU,OAAO,SAAS,WAAW;IACrC,UAAU,OAAO,SAAS,WAAW;;GAEvC,GAAG,OAAO;IACR,WAAa,SAAS;IACtB,aAAa,SAAS;IACtB,OAAa,SAAS;IACtB,MAAa,SAAS;MACrB"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { getDivisionId } from "./common.js";
|
|
2
|
+
import { get, has, isNil, isString, omitBy } from "lodash-es";
|
|
3
|
+
import moment from "moment";
|
|
4
|
+
|
|
5
|
+
//#region src/SS12000/to/syllabuses.ts
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated This is only used for SCS. can be removed when scs use v2
|
|
8
|
+
*/
|
|
9
|
+
var syllabuses_default = (syllabuses, belongsTo) => {
|
|
10
|
+
if (!Array.isArray(syllabuses)) throw new Error("(SS12000::To::Syllabus) Syllabus input is not of array type", { cause: "invalid_input" });
|
|
11
|
+
if (!syllabuses.every((location) => isString(location) || isString(get(location, "id")))) throw new Error("(SS12000::To::Syllabus) Some syllabuses are missing \"id\" values", { cause: "invalid_input" });
|
|
12
|
+
if (!belongsTo && !syllabuses.every((location) => isString(location) && belongsTo || has(location, "belongsTo"))) throw new Error("(SS12000::To::Syllabus) Some top layer syllabuses are missing \"belongsTo\" values", { cause: "invalid_input" });
|
|
13
|
+
return syllabuses.map((syllabus) => ({
|
|
14
|
+
id: `${getDivisionId(syllabus, belongsTo)}.${isString(syllabus) ? syllabus : syllabus.id}`,
|
|
15
|
+
...!isString(syllabus) && {
|
|
16
|
+
meta: {
|
|
17
|
+
created: moment(syllabus.createdAt).toISOString(),
|
|
18
|
+
modified: moment(syllabus.updatedAt).toISOString()
|
|
19
|
+
},
|
|
20
|
+
...omitBy({
|
|
21
|
+
foreignId: syllabus.ids,
|
|
22
|
+
schoolType: syllabus.schoolType,
|
|
23
|
+
subjectDesignation: syllabus.subjectDesignation,
|
|
24
|
+
subjectCode: syllabus.subjectCode,
|
|
25
|
+
subjectName: syllabus.subjectName,
|
|
26
|
+
official: syllabus.official
|
|
27
|
+
}, isNil)
|
|
28
|
+
}
|
|
29
|
+
}));
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
export { syllabuses_default as default };
|
|
34
|
+
//# sourceMappingURL=syllabuses.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"syllabuses.js","names":[],"sources":["../../../src/SS12000/to/syllabuses.ts"],"sourcesContent":["import { isString, has, get, omitBy, isNil } from 'lodash-es';\nimport moment from 'moment';\nimport type { CoreTypes } from '../../core';\nimport type { Syllabus } from '../types/syllabus';\nimport { getDivisionId } from './common';\n\n/**\n * @deprecated This is only used for SCS. can be removed when scs use v2\n */\nexport default (\n syllabuses: (Extract<CoreTypes.mixed.syllabus, { id: string }> | string)[],\n belongsTo?: Extract<CoreTypes.division, { id: string }>\n): Syllabus[] => {\n if (!Array.isArray(syllabuses))\n throw new Error('(SS12000::To::Syllabus) Syllabus input is not of array type', { cause: 'invalid_input' });\n\n if (!syllabuses.every((location) => isString(location) || isString(get(location, 'id'))))\n throw new Error('(SS12000::To::Syllabus) Some syllabuses are missing \"id\" values', { cause: 'invalid_input' });\n\n if (!belongsTo && !syllabuses.every((location) => (isString(location) && belongsTo) || has(location, 'belongsTo')))\n throw new Error('(SS12000::To::Syllabus) Some top layer syllabuses are missing \"belongsTo\" values', { cause: 'invalid_input' });\n\n return syllabuses.map((syllabus) => ({\n id: `${ getDivisionId(syllabus, belongsTo) }.${ isString(syllabus) ? syllabus : syllabus.id }`,\n ...!isString(syllabus) && {\n meta: {\n created: moment(syllabus.createdAt).toISOString(),\n modified: moment(syllabus.updatedAt).toISOString()\n },\n ...omitBy({\n foreignId: syllabus.ids,\n schoolType: syllabus.schoolType,\n subjectDesignation: syllabus.subjectDesignation,\n subjectCode: syllabus.subjectCode,\n subjectName: syllabus.subjectName,\n official: syllabus.official,\n }, isNil),\n }\n }));\n};"],"mappings":";;;;;;;;AASA,0BACE,YACA,cACe;AACf,KAAI,CAAC,MAAM,QAAQ,YACjB,OAAM,IAAI,MAAM,+DAA+D,EAAE,OAAO;AAE1F,KAAI,CAAC,WAAW,OAAO,aAAa,SAAS,aAAa,SAAS,IAAI,UAAU,QAC/E,OAAM,IAAI,MAAM,qEAAmE,EAAE,OAAO;AAE9F,KAAI,CAAC,aAAa,CAAC,WAAW,OAAO,aAAc,SAAS,aAAa,aAAc,IAAI,UAAU,cACnG,OAAM,IAAI,MAAM,sFAAoF,EAAE,OAAO;AAE/G,QAAO,WAAW,KAAK,cAAc;EACnC,IAAI,GAAI,cAAc,UAAU,WAAY,GAAI,SAAS,YAAY,WAAW,SAAS;EACzF,GAAG,CAAC,SAAS,aAAa;GACxB,MAAM;IACJ,SAAU,OAAO,SAAS,WAAW;IACrC,UAAU,OAAO,SAAS,WAAW;;GAEvC,GAAG,OAAO;IACR,WAAoB,SAAS;IAC7B,YAAoB,SAAS;IAC7B,oBAAoB,SAAS;IAC7B,aAAoB,SAAS;IAC7B,aAAoB,SAAS;IAC7B,UAAoB,SAAS;MAC5B"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ActivityType } from "./codes.js";
|
|
2
|
+
import { Group } from "./groups.js";
|
|
3
|
+
import { Organisation } from "./organisation.js";
|
|
4
|
+
import { Duty } from "./duties.js";
|
|
5
|
+
import { DutyAssignment } from "./duty-assignments.js";
|
|
6
|
+
import { Room } from "./rooms.js";
|
|
7
|
+
import { Syllabus } from "./syllabus.js";
|
|
8
|
+
|
|
9
|
+
//#region src/SS12000/types/activities.d.ts
|
|
10
|
+
type Activity = {
|
|
11
|
+
id: string;
|
|
12
|
+
organisation?: Organisation;
|
|
13
|
+
meta?: {
|
|
14
|
+
created?: Date | string;
|
|
15
|
+
modified?: Date | string;
|
|
16
|
+
};
|
|
17
|
+
activityType?: ActivityType;
|
|
18
|
+
calendarEventsRequired: boolean;
|
|
19
|
+
startDate: string;
|
|
20
|
+
endDate?: string;
|
|
21
|
+
minutesPlanned?: number;
|
|
22
|
+
displayName?: string;
|
|
23
|
+
comment?: string;
|
|
24
|
+
subject?: string;
|
|
25
|
+
syllabus?: Syllabus;
|
|
26
|
+
parentActivity?: Pick<Activity, 'id' | 'displayName'>;
|
|
27
|
+
teachers?: DutyAssignment[];
|
|
28
|
+
groups?: Pick<Group, 'id' | 'displayName'>[];
|
|
29
|
+
rooms?: {
|
|
30
|
+
room: Partial<Room>;
|
|
31
|
+
index?: number;
|
|
32
|
+
}[];
|
|
33
|
+
_embedded?: {
|
|
34
|
+
syllabus?: Syllabus;
|
|
35
|
+
groups?: Group[];
|
|
36
|
+
teachers?: Duty[];
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
//#endregion
|
|
40
|
+
export { Activity };
|
|
41
|
+
//# sourceMappingURL=activities.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Room } from "./rooms.js";
|
|
2
|
+
import { Activity } from "./activities.js";
|
|
3
|
+
import { Resource } from "./resources.js";
|
|
4
|
+
|
|
5
|
+
//#region src/SS12000/types/calendar-events.d.ts
|
|
6
|
+
type CalendarEvent = {
|
|
7
|
+
id: string;
|
|
8
|
+
meta?: {
|
|
9
|
+
created?: string;
|
|
10
|
+
modified?: string;
|
|
11
|
+
};
|
|
12
|
+
activity: Partial<Activity>;
|
|
13
|
+
startTime: string;
|
|
14
|
+
endTime: string;
|
|
15
|
+
cancelled?: boolean;
|
|
16
|
+
teachingLengthTeacher?: number;
|
|
17
|
+
teachingLengthStudent?: number;
|
|
18
|
+
rooms: Room[];
|
|
19
|
+
resources: Resource[];
|
|
20
|
+
};
|
|
21
|
+
//#endregion
|
|
22
|
+
export { CalendarEvent };
|
|
23
|
+
//# sourceMappingURL=calendar-events.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region src/SS12000/types/codes.d.ts
|
|
2
|
+
type OrganisationType = 'Huvudman' | 'Verksamhetsområde' | 'Förvaltning' | 'Rektorsområde' | 'Skola' | 'Skolenhet' | 'Varumärke' | 'Bolag' | 'Övrigt';
|
|
3
|
+
type SchoolType = 'FS' | 'FKLASS' | 'FTH' | 'OPPFTH' | 'GR' | 'GRS' | 'TR' | 'SP' | 'SAM' | 'GY' | 'GYS' | 'SFI' | 'SARVUX' | 'SARVUXGR' | 'SARVUXGY' | 'VUX' | 'VUXSFI' | 'VUXGR' | 'VUXGY' | 'VUXSARTR' | 'VUXSARGR' | 'VUXSARGY' | 'KU' | 'YH' | 'FHS' | 'STF' | 'KKU' | 'HS' | 'ABU' | 'AU';
|
|
4
|
+
type DutyRole = 'Rektor' | 'Lärare' | 'Förskollärare' | 'Barnskötare' | 'Bibliotekarie' | 'Lärarassistent' | 'Fritidspedagog' | 'Annan personal' | 'Studie- och yrkesvägledare' | 'Förstelärare' | 'Kurator' | 'Skolsköterska' | 'Skolläkare' | 'Skolpsykolog' | 'Speciallärare/specialpedagog' | 'Skoladministratör' | 'Övrig arbetsledning';
|
|
5
|
+
type GroupType = 'Undervisning' | 'Klass' | 'Mentor' | 'Provgrupp' | 'Schema' | 'Avdelning' | 'Övrigt';
|
|
6
|
+
type ActivityType = 'Undervisning' | 'Elevaktivitet' | 'Provaktivitet' | 'Läraraktivitet' | 'Övrigt';
|
|
7
|
+
//#endregion
|
|
8
|
+
export { ActivityType, DutyRole, GroupType, OrganisationType, SchoolType };
|
|
9
|
+
//# sourceMappingURL=codes.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { DutyRole } from "./codes.js";
|
|
2
|
+
import { Person } from "./persons.js";
|
|
3
|
+
import { Organisation } from "./organisation.js";
|
|
4
|
+
|
|
5
|
+
//#region src/SS12000/types/duties.d.ts
|
|
6
|
+
type Duty = {
|
|
7
|
+
id: string;
|
|
8
|
+
organisation?: Organisation;
|
|
9
|
+
dutyRole: DutyRole;
|
|
10
|
+
signature?: string;
|
|
11
|
+
dutyPercent?: number;
|
|
12
|
+
hoursPerYear?: number;
|
|
13
|
+
startDate: string;
|
|
14
|
+
endDate?: string;
|
|
15
|
+
person?: Person;
|
|
16
|
+
displayName?: string;
|
|
17
|
+
_embedded?: {
|
|
18
|
+
person?: Person;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
//#endregion
|
|
22
|
+
export { Duty };
|
|
23
|
+
//# sourceMappingURL=duties.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Duty } from "./duties.js";
|
|
2
|
+
|
|
3
|
+
//#region src/SS12000/types/duty-assignments.d.ts
|
|
4
|
+
type DutyAssignment = {
|
|
5
|
+
duty: Duty;
|
|
6
|
+
minutesPlanned?: number;
|
|
7
|
+
startDate?: Date | string;
|
|
8
|
+
endDate?: Date | string;
|
|
9
|
+
grader?: boolean;
|
|
10
|
+
};
|
|
11
|
+
//#endregion
|
|
12
|
+
export { DutyAssignment };
|
|
13
|
+
//# sourceMappingURL=duty-assignments.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { GroupType, SchoolType } from "./codes.js";
|
|
2
|
+
import { Person } from "./persons.js";
|
|
3
|
+
|
|
4
|
+
//#region src/SS12000/types/groups.d.ts
|
|
5
|
+
type Group = {
|
|
6
|
+
id: string;
|
|
7
|
+
meta?: {
|
|
8
|
+
created: string | Date;
|
|
9
|
+
modified: string | Date;
|
|
10
|
+
};
|
|
11
|
+
startDate?: string | Date;
|
|
12
|
+
displayName?: string;
|
|
13
|
+
groupType: GroupType;
|
|
14
|
+
schoolType?: SchoolType;
|
|
15
|
+
groupMemberships?: {
|
|
16
|
+
person: Pick<Person, 'id' | 'displayName'>;
|
|
17
|
+
startDate: string | Date;
|
|
18
|
+
endDate: string | Date;
|
|
19
|
+
}[];
|
|
20
|
+
};
|
|
21
|
+
//#endregion
|
|
22
|
+
export { Group };
|
|
23
|
+
//# sourceMappingURL=groups.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Person } from "./persons.js";
|
|
2
|
+
import { Group } from "./groups.js";
|
|
3
|
+
import { Duty } from "./duties.js";
|
|
4
|
+
import { Room } from "./rooms.js";
|
|
5
|
+
import { Activity } from "./activities.js";
|
|
6
|
+
import { Resource } from "./resources.js";
|
|
7
|
+
import { CalendarEvent } from "./calendar-events.js";
|
|
8
|
+
|
|
9
|
+
//#region src/SS12000/types/index.d.ts
|
|
10
|
+
declare namespace Types {
|
|
11
|
+
type activity = Activity;
|
|
12
|
+
type calendarEvent = CalendarEvent;
|
|
13
|
+
type group = Group;
|
|
14
|
+
type resource = Resource;
|
|
15
|
+
type room = Room;
|
|
16
|
+
type duty = Duty;
|
|
17
|
+
type person = Person;
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { Types };
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { OrganisationType, SchoolType } from "./codes.js";
|
|
2
|
+
|
|
3
|
+
//#region src/SS12000/types/organisation.d.ts
|
|
4
|
+
type Organisation = {
|
|
5
|
+
id: string;
|
|
6
|
+
displayName?: string;
|
|
7
|
+
organisationType: OrganisationType;
|
|
8
|
+
organisationNumber?: string;
|
|
9
|
+
parentOrganisation?: Organisation;
|
|
10
|
+
schoolUnitCode?: string;
|
|
11
|
+
organisationCode?: string;
|
|
12
|
+
municipalityCode?: string;
|
|
13
|
+
url?: string;
|
|
14
|
+
email?: string;
|
|
15
|
+
phoneNumber?: string;
|
|
16
|
+
schoolTypes?: SchoolType;
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { Organisation };
|
|
20
|
+
//# sourceMappingURL=organisation.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
//#region src/SS12000/types/persons.d.ts
|
|
2
|
+
type ContactInfo = 'Privat' | 'Arbete övrigt' | 'Skola elev' | 'Skola personal' | string;
|
|
3
|
+
type Person = {
|
|
4
|
+
id: string;
|
|
5
|
+
meta?: {
|
|
6
|
+
created: string | Date;
|
|
7
|
+
modified: string | Date;
|
|
8
|
+
};
|
|
9
|
+
displayName?: string;
|
|
10
|
+
givenName?: string;
|
|
11
|
+
middleName?: string;
|
|
12
|
+
familyName?: string;
|
|
13
|
+
birthDate?: Date;
|
|
14
|
+
sex?: 'Man' | 'Kvinna' | 'Okänt';
|
|
15
|
+
civicNo?: {
|
|
16
|
+
value: string;
|
|
17
|
+
nationality?: string;
|
|
18
|
+
};
|
|
19
|
+
emails?: {
|
|
20
|
+
value: string;
|
|
21
|
+
type: ContactInfo;
|
|
22
|
+
}[];
|
|
23
|
+
phoneNumbers?: {
|
|
24
|
+
value: string;
|
|
25
|
+
type: ContactInfo;
|
|
26
|
+
}[];
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
export { Person };
|
|
30
|
+
//# sourceMappingURL=persons.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/SS12000/types/resources.d.ts
|
|
2
|
+
type Resource = {
|
|
3
|
+
id: string;
|
|
4
|
+
meta?: {
|
|
5
|
+
created: string | Date;
|
|
6
|
+
modified: string | Date;
|
|
7
|
+
};
|
|
8
|
+
displayName?: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
};
|
|
11
|
+
//#endregion
|
|
12
|
+
export { Resource };
|
|
13
|
+
//# sourceMappingURL=resources.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//#region src/SS12000/types/rooms.d.ts
|
|
2
|
+
type Room = {
|
|
3
|
+
id: string;
|
|
4
|
+
meta?: {
|
|
5
|
+
created: string | Date;
|
|
6
|
+
modified: string | Date;
|
|
7
|
+
};
|
|
8
|
+
displayName?: string;
|
|
9
|
+
seats?: number;
|
|
10
|
+
tags?: {
|
|
11
|
+
type: string;
|
|
12
|
+
value: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { Room };
|
|
17
|
+
//# sourceMappingURL=rooms.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SchoolType } from "./codes.js";
|
|
2
|
+
|
|
3
|
+
//#region src/SS12000/types/syllabus.d.ts
|
|
4
|
+
type Syllabus = {
|
|
5
|
+
id: string;
|
|
6
|
+
meta?: {
|
|
7
|
+
created: string | Date;
|
|
8
|
+
modified: string | Date;
|
|
9
|
+
};
|
|
10
|
+
schoolType?: SchoolType;
|
|
11
|
+
subjectDesignation?: string;
|
|
12
|
+
subjectCode?: string;
|
|
13
|
+
subjectName?: string;
|
|
14
|
+
curriculum?: string;
|
|
15
|
+
official?: boolean;
|
|
16
|
+
};
|
|
17
|
+
//#endregion
|
|
18
|
+
export { Syllabus };
|
|
19
|
+
//# sourceMappingURL=syllabus.d.ts.map
|
|
@@ -116,10 +116,23 @@ declare namespace Types {
|
|
|
116
116
|
type ta = TA;
|
|
117
117
|
type lesson = Lesson;
|
|
118
118
|
type student = Student;
|
|
119
|
+
type errorType = ErrorType;
|
|
119
120
|
type errorCode = ErrorCode;
|
|
120
121
|
}
|
|
121
122
|
type Options = {
|
|
123
|
+
/**
|
|
124
|
+
* Specifies which field to use as the source for creating additional scheduling periods.
|
|
125
|
+
* By default, lessons are associated with their course's period, but this option allows
|
|
126
|
+
* creating distinct periods based on all unique values found in either the 'Week' or
|
|
127
|
+
* 'ActualWeeks' field of lesson data, and applying these periods to the lessons.
|
|
128
|
+
*/
|
|
122
129
|
createPeriodsFrom?: 'Week' | 'ActualWeeks' | null;
|
|
130
|
+
/**
|
|
131
|
+
* Import also events for which we cannot deduce the course.
|
|
132
|
+
* This is useful for example when you want to load all events for a teacher or a group
|
|
133
|
+
* but you don't care about the course. If you set this to true, we will create a
|
|
134
|
+
* dummy course for each event that doesn't have a course.
|
|
135
|
+
*/
|
|
123
136
|
includeEventsMissingCourse?: boolean;
|
|
124
137
|
};
|
|
125
138
|
//#endregion
|