@royalschedule/maps 4.1.2-beta.0 → 4.1.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/Excel/index.d.ts +21 -19
- package/dist/Excel/v1/index.d.ts +21 -21
- package/dist/Excel/v2/index.d.ts +22 -20
- package/dist/PlanDigital/index.d.ts +13 -13
- package/dist/RS/from/schedules.js +7 -4
- package/dist/RS/from/schedules.js.map +1 -1
- package/dist/RS/to/input/teachers.js +1 -1
- package/dist/RS/to/input/teachers.js.map +1 -1
- package/dist/RS/to/input/util/util.js +43 -1
- package/dist/RS/to/input/util/util.js.map +1 -1
- package/dist/SchoolSoft/api/index.d.ts +38 -38
- package/dist/Skola24/txt/to/schedules.js +1 -1
- package/dist/Skola24/txt/to/schedules.js.map +1 -1
- package/dist/core/interfaces/other/companies.d.ts +1 -0
- package/dist/core/interfaces/other/companies.js.map +1 -1
- package/dist/core/interfaces/vertices/conversations.d.ts +32 -0
- package/dist/core/interfaces/vertices/courses.d.ts +1 -1
- package/dist/core/interfaces/vertices/division-settings.d.ts +1 -0
- package/dist/core/interfaces/vertices/events.d.ts +3 -0
- package/dist/core/interfaces/vertices/index.d.ts +15 -1
- package/dist/core/interfaces/vertices/messages.d.ts +21 -0
- package/dist/core/interfaces/vertices/periods.d.ts +1 -0
- package/dist/core/interfaces/vertices/syllabuses.d.ts +2 -0
- package/dist/core/interfaces/vertices/util/vertex.d.ts +1 -1
- package/dist/core/interfaces/vertices/vertex-query.d.ts +7 -1
- package/dist/core/interfaces/vertices/vertex-query.js +8 -0
- package/dist/core/interfaces/vertices/vertex-query.js.map +1 -1
- package/dist/core/types/index.d.ts +5 -0
- package/package.json +1 -1
|
@@ -61,16 +61,16 @@ declare class Map {
|
|
|
61
61
|
lastModifiedBy?: string | undefined;
|
|
62
62
|
tags?: Tag[] | undefined;
|
|
63
63
|
minBreakLength?: number | undefined;
|
|
64
|
-
intervals?: Interval[] | undefined;
|
|
65
|
-
days?: Day[] | undefined;
|
|
66
|
-
weight?: number | undefined;
|
|
67
|
-
signature?: string | undefined;
|
|
68
64
|
maxNumWorkingHours?: number | false | undefined;
|
|
69
65
|
maxNumDailyWorkingHours?: number | number[] | false | undefined;
|
|
70
|
-
plannedScheduledDuration?: PlannedScheduledDuration | undefined;
|
|
71
66
|
maximumScheduleSpan?: MaximumScheduleSpan | undefined;
|
|
72
67
|
forbidOverlappingEvents?: boolean | undefined;
|
|
73
68
|
disableDayLengthPunishment?: boolean | undefined;
|
|
69
|
+
weight?: number | undefined;
|
|
70
|
+
intervals?: Interval[] | undefined;
|
|
71
|
+
days?: Day[] | undefined;
|
|
72
|
+
signature?: string | undefined;
|
|
73
|
+
plannedScheduledDuration?: PlannedScheduledDuration | undefined;
|
|
74
74
|
belongsTo?: string | undefined;
|
|
75
75
|
rootInterval?: string | undefined;
|
|
76
76
|
lockedTimes?: string[] | undefined;
|
|
@@ -89,16 +89,16 @@ declare class Map {
|
|
|
89
89
|
lastModifiedBy?: string | undefined;
|
|
90
90
|
tags?: Tag[] | undefined;
|
|
91
91
|
minBreakLength?: number | undefined;
|
|
92
|
-
intervals?: Interval[] | undefined;
|
|
93
|
-
days?: Day[] | undefined;
|
|
94
|
-
weight?: number | undefined;
|
|
95
|
-
signature?: string | undefined;
|
|
96
92
|
maxNumWorkingHours?: number | false | undefined;
|
|
97
93
|
maxNumDailyWorkingHours?: number | number[] | false | undefined;
|
|
98
|
-
plannedScheduledDuration?: PlannedScheduledDuration | undefined;
|
|
99
94
|
maximumScheduleSpan?: MaximumScheduleSpan | undefined;
|
|
100
95
|
forbidOverlappingEvents?: boolean | undefined;
|
|
101
96
|
disableDayLengthPunishment?: boolean | undefined;
|
|
97
|
+
weight?: number | undefined;
|
|
98
|
+
intervals?: Interval[] | undefined;
|
|
99
|
+
days?: Day[] | undefined;
|
|
100
|
+
signature?: string | undefined;
|
|
101
|
+
plannedScheduledDuration?: PlannedScheduledDuration | undefined;
|
|
102
102
|
belongsTo?: string | undefined;
|
|
103
103
|
rootInterval?: string | undefined;
|
|
104
104
|
lockedTimes?: string[] | undefined;
|
|
@@ -120,15 +120,15 @@ declare class Map {
|
|
|
120
120
|
lastModifiedBy?: string | undefined;
|
|
121
121
|
tags?: Tag[] | undefined;
|
|
122
122
|
minBreakLength?: number | undefined;
|
|
123
|
-
intervals?: Interval[] | undefined;
|
|
124
|
-
days?: Day[] | undefined;
|
|
125
|
-
weight?: number | undefined;
|
|
126
123
|
maxNumWorkingHours?: number | false | undefined;
|
|
127
124
|
maxNumDailyWorkingHours?: number | number[] | false | undefined;
|
|
128
125
|
maximumScheduleSpan?: MaximumScheduleSpan | undefined;
|
|
129
126
|
forbidOverlappingEvents?: boolean | undefined;
|
|
130
127
|
disableDayLengthPunishment?: boolean | undefined;
|
|
128
|
+
weight?: number | undefined;
|
|
131
129
|
species?: "class" | undefined;
|
|
130
|
+
intervals?: Interval[] | undefined;
|
|
131
|
+
days?: Day[] | undefined;
|
|
132
132
|
belongsTo?: string | undefined;
|
|
133
133
|
parentGroups?: string[] | undefined;
|
|
134
134
|
subGroups?: string[] | undefined;
|
|
@@ -153,15 +153,15 @@ declare class Map {
|
|
|
153
153
|
lastModifiedBy?: string | undefined;
|
|
154
154
|
tags?: Tag[] | undefined;
|
|
155
155
|
minBreakLength?: number | undefined;
|
|
156
|
-
intervals?: Interval[] | undefined;
|
|
157
|
-
days?: Day[] | undefined;
|
|
158
|
-
weight?: number | undefined;
|
|
159
156
|
maxNumWorkingHours?: number | false | undefined;
|
|
160
157
|
maxNumDailyWorkingHours?: number | number[] | false | undefined;
|
|
161
158
|
maximumScheduleSpan?: MaximumScheduleSpan | undefined;
|
|
162
159
|
forbidOverlappingEvents?: boolean | undefined;
|
|
163
160
|
disableDayLengthPunishment?: boolean | undefined;
|
|
161
|
+
weight?: number | undefined;
|
|
164
162
|
species?: "class" | undefined;
|
|
163
|
+
intervals?: Interval[] | undefined;
|
|
164
|
+
days?: Day[] | undefined;
|
|
165
165
|
belongsTo?: string | undefined;
|
|
166
166
|
parentGroups?: string[] | undefined;
|
|
167
167
|
subGroups?: string[] | undefined;
|
|
@@ -187,17 +187,17 @@ declare class Map {
|
|
|
187
187
|
createdAt?: string | undefined;
|
|
188
188
|
updatedAt?: string | undefined;
|
|
189
189
|
lastModifiedBy?: string | undefined;
|
|
190
|
+
type?: string | undefined;
|
|
190
191
|
tags?: Tag[] | undefined;
|
|
191
|
-
subject?: string | undefined;
|
|
192
|
-
color?: string | undefined;
|
|
193
192
|
minBreakLength?: MinBreakLength | undefined;
|
|
193
|
+
weight?: number | undefined;
|
|
194
194
|
intervals?: Interval[] | undefined;
|
|
195
195
|
days?: Day[] | undefined;
|
|
196
|
+
subject?: string | undefined;
|
|
197
|
+
color?: string | undefined;
|
|
196
198
|
eventDurationVariance?: number | undefined;
|
|
197
199
|
centerOfAttraction?: string | null | undefined;
|
|
198
200
|
density?: number | undefined;
|
|
199
|
-
weight?: number | undefined;
|
|
200
|
-
type?: string | undefined;
|
|
201
201
|
plannedDuration?: string | undefined;
|
|
202
202
|
minutesPerWeek?: number | undefined;
|
|
203
203
|
expectedTotalHours?: number | undefined;
|
|
@@ -235,17 +235,17 @@ declare class Map {
|
|
|
235
235
|
createdAt?: string | undefined;
|
|
236
236
|
updatedAt?: string | undefined;
|
|
237
237
|
lastModifiedBy?: string | undefined;
|
|
238
|
+
type?: string | undefined;
|
|
238
239
|
tags?: Tag[] | undefined;
|
|
239
|
-
subject?: string | undefined;
|
|
240
|
-
color?: string | undefined;
|
|
241
240
|
minBreakLength?: MinBreakLength | undefined;
|
|
241
|
+
weight?: number | undefined;
|
|
242
242
|
intervals?: Interval[] | undefined;
|
|
243
243
|
days?: Day[] | undefined;
|
|
244
|
+
subject?: string | undefined;
|
|
245
|
+
color?: string | undefined;
|
|
244
246
|
eventDurationVariance?: number | undefined;
|
|
245
247
|
centerOfAttraction?: string | null | undefined;
|
|
246
248
|
density?: number | undefined;
|
|
247
|
-
weight?: number | undefined;
|
|
248
|
-
type?: string | undefined;
|
|
249
249
|
plannedDuration?: string | undefined;
|
|
250
250
|
minutesPerWeek?: number | undefined;
|
|
251
251
|
expectedTotalHours?: number | undefined;
|
|
@@ -286,24 +286,24 @@ declare class Map {
|
|
|
286
286
|
createdAt?: string | undefined;
|
|
287
287
|
updatedAt?: string | undefined;
|
|
288
288
|
lastModifiedBy?: string | undefined;
|
|
289
|
+
start?: (moment1.Moment | string) | undefined;
|
|
290
|
+
end?: (moment1.Moment | string) | undefined;
|
|
291
|
+
potentialCenter?: string | undefined;
|
|
292
|
+
type?: string | undefined;
|
|
289
293
|
tags?: Tag[] | undefined;
|
|
290
|
-
color?: string | null | undefined;
|
|
291
294
|
minBreakLength?: (MinBreakLength | null) | undefined;
|
|
295
|
+
weight?: number | undefined;
|
|
292
296
|
intervals?: Interval[] | null | undefined;
|
|
293
297
|
days?: Day[] | null | undefined;
|
|
298
|
+
color?: string | null | undefined;
|
|
294
299
|
centerOfAttraction?: string | null | undefined;
|
|
295
300
|
density?: number | undefined;
|
|
296
|
-
weight?: number | undefined;
|
|
297
|
-
type?: string | undefined;
|
|
298
301
|
fixedStart?: boolean | undefined;
|
|
299
302
|
visible?: boolean | undefined;
|
|
300
|
-
potentialCenter?: string | undefined;
|
|
301
303
|
parked?: boolean | undefined;
|
|
302
304
|
preferredDuration: number;
|
|
303
305
|
durationVariance?: number | undefined;
|
|
304
306
|
duration?: number | undefined;
|
|
305
|
-
start?: (moment1.Moment | string) | undefined;
|
|
306
|
-
end?: (moment1.Moment | string) | undefined;
|
|
307
307
|
weeks?: number[] | undefined;
|
|
308
308
|
belongsTo?: string | undefined;
|
|
309
309
|
course?: string | undefined;
|
|
@@ -341,24 +341,24 @@ declare class Map {
|
|
|
341
341
|
createdAt?: string | undefined;
|
|
342
342
|
updatedAt?: string | undefined;
|
|
343
343
|
lastModifiedBy?: string | undefined;
|
|
344
|
+
start?: (moment1.Moment | string) | undefined;
|
|
345
|
+
end?: (moment1.Moment | string) | undefined;
|
|
346
|
+
potentialCenter?: string | undefined;
|
|
347
|
+
type?: string | undefined;
|
|
344
348
|
tags?: Tag[] | undefined;
|
|
345
|
-
color?: string | null | undefined;
|
|
346
349
|
minBreakLength?: (MinBreakLength | null) | undefined;
|
|
350
|
+
weight?: number | undefined;
|
|
347
351
|
intervals?: Interval[] | null | undefined;
|
|
348
352
|
days?: Day[] | null | undefined;
|
|
353
|
+
color?: string | null | undefined;
|
|
349
354
|
centerOfAttraction?: string | null | undefined;
|
|
350
355
|
density?: number | undefined;
|
|
351
|
-
weight?: number | undefined;
|
|
352
|
-
type?: string | undefined;
|
|
353
356
|
fixedStart?: boolean | undefined;
|
|
354
357
|
visible?: boolean | undefined;
|
|
355
|
-
potentialCenter?: string | undefined;
|
|
356
358
|
parked?: boolean | undefined;
|
|
357
359
|
preferredDuration: number;
|
|
358
360
|
durationVariance?: number | undefined;
|
|
359
361
|
duration?: number | undefined;
|
|
360
|
-
start?: (moment1.Moment | string) | undefined;
|
|
361
|
-
end?: (moment1.Moment | string) | undefined;
|
|
362
362
|
weeks?: number[] | undefined;
|
|
363
363
|
belongsTo?: string | undefined;
|
|
364
364
|
course?: string | undefined;
|
|
@@ -399,8 +399,8 @@ declare class Map {
|
|
|
399
399
|
createdAt?: string | undefined;
|
|
400
400
|
updatedAt?: string | undefined;
|
|
401
401
|
lastModifiedBy?: string | undefined;
|
|
402
|
-
tags?: Tag[] | undefined;
|
|
403
402
|
type?: "Student" | "Teacher" | "Other" | undefined;
|
|
403
|
+
tags?: Tag[] | undefined;
|
|
404
404
|
lastName?: string | undefined;
|
|
405
405
|
firstName?: string | undefined;
|
|
406
406
|
birthDate?: Date | undefined;
|
|
@@ -428,8 +428,8 @@ declare class Map {
|
|
|
428
428
|
createdAt?: string | undefined;
|
|
429
429
|
updatedAt?: string | undefined;
|
|
430
430
|
lastModifiedBy?: string | undefined;
|
|
431
|
-
tags?: Tag[] | undefined;
|
|
432
431
|
type?: "Student" | "Teacher" | "Other" | undefined;
|
|
432
|
+
tags?: Tag[] | undefined;
|
|
433
433
|
lastName?: string | undefined;
|
|
434
434
|
firstName?: string | undefined;
|
|
435
435
|
birthDate?: Date | undefined;
|
|
@@ -181,7 +181,7 @@ var schedules_default = (data, options = {}) => {
|
|
|
181
181
|
"Week (7109)": "",
|
|
182
182
|
"ActualWeeks (7167)": period?.ranges?.map((range) => `${moment.utc(range.start).week()}-${moment.utc(range.end).week()}`).join(",")
|
|
183
183
|
};
|
|
184
|
-
}) ?? [];
|
|
184
|
+
}).filter(Boolean) ?? [];
|
|
185
185
|
csv += `${papaOptions.newline}Lesson (7100)${papaOptions.newline}[Rows]${papaOptions.newline}`;
|
|
186
186
|
if (e.length) csv += Papa.unparse(e, papaOptions);
|
|
187
187
|
else csv += [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schedules.js","names":["t","teachers","g","groups","locations"],"sources":["../../../../src/Skola24/txt/to/schedules.ts"],"sourcesContent":["import Papa from 'papaparse';\nimport moment from 'moment';\nimport { isString } from 'lodash-es';\nimport type { CoreTypes } from '../../../core';\nimport type { BaseOptions } from '../../../common/types';\nimport { getVertexId } from '../../../core/util';\nimport { isMongooseObjectId } from '../../../common/functions';\n\nconst papaOptions = {\n quotes: false, //or array of booleans\n quoteChar: '\"',\n escapeChar: '\"',\n delimiter: '\\t',\n header: true,\n newline: '\\r\\n',\n skipEmptyLines: false, //other option is 'greedy', meaning skip delimiters, quotes, and whitespace.\n // columns: null //or array of strings\n} as Papa.UnparseConfig;\n\nconst uuid = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;\n\nexport default (\n data: CoreTypes.Mixed.Schedule,\n options: BaseOptions = {}\n): string => {\n const { locations, teachers, groups, persons, events, courses, periods, syllabuses, divisions } = data;\n const { start, /* end, */ displayName } = divisions ?? data as unknown as CoreTypes.Mixed.Division;\n\n const startYear = moment.utc(start).year();\n const startMonth = moment.utc(start).month();\n\n // Set cvs to the source section\n let csv = `[Source]${papaOptions.newline}ApplicationVerMajor=4${papaOptions.newline}ApplicationVerMinor=0${papaOptions.newline}DatabaseRevNo=527${papaOptions.newline}CurrentNovaschemDatabase=${papaOptions.newline}User=${papaOptions.newline}`;\n csv += `SchoolID=RS${papaOptions.newline}School=${displayName}${papaOptions.newline}County=RS${papaOptions.newline}`;\n csv += `BaseYear=${startYear}${papaOptions.newline}OffsetYear=0${papaOptions.newline}OffsetMonth=${startMonth}${papaOptions.newline}CreationDate=${moment().format('YYYY-MM-DD')}${papaOptions.newline}${papaOptions.newline}`;\n // add destination section to csv\n csv += `[Destination]${papaOptions.newline}Application=${papaOptions.newline}ApplicationID=${papaOptions.newline}${papaOptions.newline}`;\n\n // add database options to csv\n csv += `[DatabaseOptions]${papaOptions.newline}Update=TRUE${papaOptions.newline}AddNew=TRUE${papaOptions.newline}${papaOptions.newline}`;\n\n // start tables section\n csv += `[Tables]${papaOptions.newline}${papaOptions.newline}`;\n\n // append teachers to csv\n const t = teachers?.map(teacher => {\n return {\n 'Teacher (6001)': teacher.signature,\n 'GUID (5800)': (teacher.ids && uuid.test(teacher.ids)) ? `{${teacher.ids}}` : '',\n 'Category (6002)': '',\n 'Title (6006)': '',\n 'Phone (6033)': '',\n 'EvaluationNumber (6014)': '',\n ... 'person' in teacher && typeof teacher.person == 'object'\n ? {\n 'PersonalCode (6028)': 'SSN' in teacher.person ? (teacher.person?.SSN?.value ?? '') : '',\n 'LastName (6003)': 'lastName' in teacher.person ? (teacher.person?.lastName ?? '') : '',\n 'FirstName (6004)': 'firstName' in teacher.person ? (teacher.person?.firstName ?? '') : '',\n 'EMail (6034)': 'emails' in teacher.person ? (teacher.person?.emails?.[0]?.value ?? '') : '',\n }\n : null\n };\n }) ?? [];\n csv += `${papaOptions.newline}Teacher (6000)${papaOptions.newline}[Rows]${papaOptions.newline}`;\n if (t.length) {\n csv += Papa.unparse(t, papaOptions);\n } else {\n csv += ['Teacher (6001)', 'GUID (5800)', 'Category (6002)', 'PersonalCode (6028)', 'LastName (6003)', 'Title (6006)', 'FirstName (6004)', 'Phone (6033)', 'EMail (6034)', 'EvaluationNumber (6014)'].join(papaOptions.delimiter);\n }\n csv += papaOptions.newline;\n\n // append students to csv\n const s = persons?.filter(person => {\n return person.type != 'Teacher';\n }).map(person => {\n return {\n 'Student (7201)': person.SSN?.value,\n 'GUID (5800)': (person.ids && uuid.test(person.ids)) ? `{${person.ids}}` : '',\n 'Category (7305)': '',\n 'LastName (7202)': person.lastName ?? '',\n 'FirstName (7211)': person.firstName ?? '',\n 'EMail (7215)': person.emails?.[0]?.value ?? ''\n };\n }) ?? [];\n csv += `${papaOptions.newline}Student (7200)${papaOptions.newline}[Rows]${papaOptions.newline}`;\n if (s.length) {\n csv += Papa.unparse(s, papaOptions);\n } else {\n csv += ['Student (7201)', 'GUID (5800)', 'Category (7305)', 'LastName (7202)', 'FirstName (7211)', 'EMail (7215)'].join(papaOptions.delimiter);\n }\n csv += papaOptions.newline;\n\n // create a map of students.id to students.SSN\n const studentMap = new Map(persons?.filter(x => x.type != 'Teacher').map(x => [getVertexId(x, options), x.SSN?.value ?? '']));\n\n // append groups to csv\n const g = groups?.map(group => {\n return {\n 'Group (6201)': group.displayName!,\n 'GUID (5800)': (group.ids && uuid.test(group.ids)) ? `{${group.ids}}` : '',\n 'Class (6210)': group.species == 'class' ? 1 : 0,\n 'Teacher (6204)': '',\n 'IClass (6206)': '',\n 'Student (6205)': group.members?.map(x => getVertexId(x, options)).map(x => studentMap.get(x)).filter(Boolean).join(',')\n };\n }) ?? [];\n csv += `${papaOptions.newline}Group (6200)${papaOptions.newline}[Rows]${papaOptions.newline}`;\n if (g.length) {\n csv += Papa.unparse(g, papaOptions);\n } else {\n csv += ['Group (6201)', 'GUID (5800)', 'Class (6210)', 'Teacher (6204)', 'IClass (6206)', 'Student (6205)'].join(papaOptions.delimiter);\n }\n csv += papaOptions.newline;\n\n // append locations to csv\n const l = locations?.map(location => {\n return {\n 'Room (6601)': location.displayName!,\n 'GUID (5800)': (location.ids && uuid.test(location.ids)) ? `{${location.ids}}` : '',\n 'Category (6602)': location.tags?.find(tag => tag.type == 'category')?.value ?? '',\n 'SeatingCapacity (6607)': location.maximumCapacity,\n };\n }) ?? [];\n csv += `${papaOptions.newline}Room (6600)${papaOptions.newline}[Rows]${papaOptions.newline}`;\n if (l.length) {\n csv += Papa.unparse(l, papaOptions);\n } else {\n csv += ['Room (6601)', 'GUID (5800)', 'Category (6602)', 'SeatingCapacity (6607)'].join(papaOptions.delimiter);\n }\n csv += papaOptions.newline;\n\n // append periods to csv\n const p = periods?.map(period => {\n return {\n 'Period (8001)': period.displayName!,\n 'GUID (5800)': (period.ids && uuid.test(period.ids)) ? `{${period.ids}}` : '',\n 'TextBelowSchedule (8002)': period.displayName!,\n 'Category (8006)': '',\n 'Calendar (8005)': period.ranges?.map(range => `${moment.utc(range.start).format('D/M')}-${moment.utc(range.end).format('D/M')}`).join(', ')\n };\n }) ?? [];\n csv += `${papaOptions.newline}Period (8000)${papaOptions.newline}[Rows]${papaOptions.newline}`;\n if (p.length) {\n csv += Papa.unparse(p, papaOptions);\n } else {\n csv += ['Period (8001)', 'GUID (5800)', 'TextBelowSchedule (8002)', 'Category (8006)', 'Calendar (8005)'].join(papaOptions.delimiter);\n }\n csv += papaOptions.newline;\n\n const courseMap = new Map(data.courses ?.map(x => [getVertexId(x, options), x]));\n const periodMap = new Map(data.periods ?.map(x => [getVertexId(x, options), x]));\n const teacherMap = new Map(data.teachers ?.map(x => [getVertexId(x, options), x]));\n const groupMap = new Map(data.groups ?.map(x => [getVertexId(x, options), x]));\n const locationMap = new Map(data.locations ?.map(x => [getVertexId(x, options), x]));\n const syllabusMap = new Map(data.syllabuses?.map(x => [getVertexId(x, options), x]));\n\n // append lessons to csv\n const e = events\n // ?.filter(x => !isNaN(Date.parse(x.start?.toString() ?? '')))\n .map((event, index) => {\n if (!event.start || !event.end) return;\n\n const courseId = event.course ? getVertexId(event.course, options) : undefined;\n const course = courseId ? courseMap.get(courseId) : undefined;\n\n // Only use deserialize period\n let period = event.period == null ? course?.period : event.period;\n if (isString(period))\n period = periodMap.get(period);\n if ((period && !('ranges' in period)))\n period = undefined;\n\n // Only use deserialize teachers\n const t = event.teachers == null ? course?.teachers : event.teachers;\n const teacherIds = t?.map(x => getVertexId(x.to, options));\n const teachers = teacherIds?.map(id => teacherMap.get(id)).filter(Boolean) ?? [];\n\n // Only use deserialize groups\n const g = event.groups == null ? course?.groups : event.groups;\n const groupIds = g?.map(x => getVertexId(x.to, options));\n const groups = groupIds?.map(id => groupMap.get(id)).filter(Boolean) ?? [];\n\n // Only use deserialize locations\n const locationIds = event.inLocations?.map(x => x ? getVertexId(x, options) : null).filter(x => x != null);\n const locations = locationIds?.map(id => locationMap.get(id)).filter(Boolean) ?? [];\n const dayOfWeek = moment.utc(event.start).toDate().toLocaleDateString('sv-SE', { weekday: 'long', timeZone: 'UTC' });\n\n // Syllabus of the course\n const syllabusId = isString(course?.syllabus)\n ? course.syllabus\n : (course?.syllabus && isMongooseObjectId(course.syllabus))\n ? course.syllabus.toString()\n : undefined;\n const syllabus = syllabusId ? syllabusMap.get(syllabusId) : course?.syllabus as CoreTypes.Deep.Syllabus | undefined;\n\n // capitalize first letter of dayOfWeek\n const dayOfWeekCapitalized = dayOfWeek.charAt(0).toUpperCase() + dayOfWeek.slice(1);\n return {\n 'PK (7100)': index + 1,\n 'GUID (5800)': (event.ids && uuid.test(event.ids)) ? `{${event.ids}}` : '',\n 'DayOfWeek (7101)': dayOfWeekCapitalized,\n 'Starttime (7102)': moment.utc(event.start).format('HH:mm'),\n 'Length (7115)': event.duration,\n 'Course (7106)': syllabus?.courseCode,\n 'Subject (7103)': syllabus?.subjectCode ?? course?.subject ?? '',\n 'Teacher (7104)': teachers ?.map(x => x?.signature ).filter(Boolean).join(','),\n 'Group (7105)': groups ?.map(x => x?.displayName).filter(Boolean).join(','),\n 'Room (7107)': locations?.map(x => x?.displayName).filter(Boolean).join(','),\n 'Period (7108)': '',\n 'Week (7109)': '',\n 'ActualWeeks (7167)': period?.ranges?.map(range => `${moment.utc(range.start).week()}-${moment.utc(range.end).week()}`).join(',')\n };\n }) ?? [];\n csv += `${papaOptions.newline}Lesson (7100)${papaOptions.newline}[Rows]${papaOptions.newline}`;\n if (e.length) {\n csv += Papa.unparse(e, papaOptions);\n } else {\n csv += ['PK (7100)', 'GUID (5800)', 'DayOfWeek (7101)', 'Starttime (7102)', 'Length (7115)', 'Course (7106)', 'Subject (7103)', 'Period (7108)', 'Week (7109)', 'ActualWeeks (7167)'].join(papaOptions.delimiter);\n }\n csv += papaOptions.newline;\n\n // append subjects to csv, is empty for now\n // csv += `Subject (6400)${options.newline}[Rows]${options.newline}`;\n // csv += ['Subject (6401)', 'GUID (5800)', 'Category (6402)', 'FullText (6403)', 'BackgroundColor (6432)', 'TextColor (6433)', 'EvaluationNumber (6429)'].join(options.delimiter);\n // csv += options.newline;\n\n // append syllabus to csv\n const courseSyllabuses = syllabuses?.filter(syllabus => !!syllabus.courseName).map(syllabus => {\n return {\n 'Course (7601)': syllabus.courseCode,\n 'GUID (5800)': syllabus.ids,\n 'FullText (7602)': syllabus.courseName,\n 'Subject (7603)': syllabus.subjectCode ?? '',\n 'Points (7604)': syllabus.points\n };\n }) ?? [];\n csv += `${papaOptions.newline}Course (7600)${papaOptions.newline}[Rows]${papaOptions.newline}`;\n if (courseSyllabuses.length) {\n csv += Papa.unparse(courseSyllabuses, papaOptions);\n } else {\n csv += ['PK (7100)', 'GUID (5800)', 'DayOfWeek (7101)', 'Starttime (7102)', 'Length (7115)', 'Course (7106)', 'Subject (7103)', 'Period (7108)', 'Week (7109)', 'ActualWeeks (7167)'].join(papaOptions.delimiter);\n }\n csv += papaOptions.newline;\n\n const subjectSyllabuses = syllabuses?.reduce((unique, syllabus) => {\n if (syllabus.subjectCode && !unique.seen.has(syllabus.subjectCode)) {\n unique.seen.add(syllabus.subjectCode);\n unique.result.push({\n 'Subject (6401)': syllabus.subjectCode,\n 'GUID (5800)': syllabus.ids,\n 'FullText (6403)': syllabus.subjectName,\n });\n }\n return unique;\n }, {\n seen: new Set<string>(),\n result: [] as Array<{\n 'Subject (6401)': string;\n 'GUID (5800)': string | undefined;\n 'FullText (6403)': string;\n }>\n })?.result ?? [];\n csv += `Subject (6400)${papaOptions.newline}[Rows]${papaOptions.newline}`;\n if (subjectSyllabuses.length) {\n csv += Papa.unparse(subjectSyllabuses, papaOptions);\n } else {\n csv += ['Subject (6401)', 'GUID (5800)', 'Category (6402)', 'FullText (6403)', 'BackgroundColor (6432)', 'TextColor (6433)', 'EvaluationNumber (6429)'].join(papaOptions.delimiter);\n }\n\n const totalHoursRegex = /(\\d+) hrs/;\n const weekTimeRegex = /(\\d+) min\\/week/;\n const c = courses?.map(course => {\n // Only use deserialize teachers\n const teacherIds = course.teachers?.map(x => getVertexId(x.to, options)).filter(Boolean);\n const teachers = teacherIds?.map(id => teacherMap.get(id)!).filter(Boolean) ?? [];\n\n // Only use deserialize groups\n const groupIds = course.groups?.map(x => getVertexId(x.to, options)).filter(Boolean);\n const groups = groupIds?.map(id => groupMap.get(id)!).filter(Boolean) ?? [];\n\n // Only use deserialize syllabus\n const syllabusId = isString(course?.syllabus)\n ? course.syllabus\n : (course?.syllabus && isMongooseObjectId(course.syllabus))\n ? course.syllabus.toString()\n : undefined;\n const syllabus = syllabusId ? syllabusMap.get(syllabusId) : course?.syllabus as CoreTypes.Deep.Syllabus | undefined;\n\n return {\n 'PK (8200)': '',\n 'GUID (5800)': course.ids,\n 'OriginalRecord (8224)': '1',\n 'CreateLesson (8227)': '1',\n 'Course (8202)': syllabus?.courseCode,\n 'Subject (8209)': syllabus?.subjectCode ?? course.subject, // Nikos ansvarig för framtida buggar\n 'Teacher (8210)': teachers?.map(teacher => teacher.signature).filter(Boolean).join(','),\n 'Group (8203)': groups?.map(group => group.displayName).filter(Boolean).join(','),\n 'TotalHours (8204)': (course.plannedDuration && totalHoursRegex.test(course.plannedDuration)) ? totalHoursRegex.exec(course.plannedDuration)![1] : '',\n 'Weektime (8208)': (course.plannedDuration && weekTimeRegex.test(course.plannedDuration)) ? weekTimeRegex.exec(course.plannedDuration)![1] : '',\n 'Blockname (8215)': '',\n 'Period (8206)': '',\n 'Week (8207)': '',\n 'NotPeriod (8212)': '',\n 'NotWeek (8213)': ''\n };\n }) ?? [];\n csv += `${papaOptions.newline}TA (8200)${papaOptions.newline}[Rows]${papaOptions.newline}`;\n if (c.length) {\n csv += Papa.unparse(c, papaOptions);\n } else {\n csv += ['Course (8202)', 'GUID (5800)', 'Subject (8209)', 'Teacher (8210)', 'Group (8203)', 'TotalHours (8204)', 'Weektime (8208)', 'Blockname (8215)', 'Period (8206)', 'Week (8207)', 'NotPeriod (8212)', 'NotWeek (8213)'].join(papaOptions.delimiter);\n }\n\n return csv;\n};"],"mappings":";;;;;;;AAQA,MAAM,cAAc;CAClB,QAAgB;CAChB,WAAgB;CAChB,YAAgB;CAChB,WAAgB;CAChB,QAAgB;CAChB,SAAgB;CAChB,gBAAgB;;AAIlB,MAAM,OAAO;AAEb,yBACE,MACA,UAAuB,OACZ;CACX,MAAM,EAAE,WAAW,UAAU,QAAQ,SAAS,QAAQ,SAAS,SAAS,YAAY,cAAc;CAClG,MAAM,EAAE,OAAkB,gBAAgB,aAAa;CAEvD,MAAM,YAAa,OAAO,IAAI,OAAO;CACrC,MAAM,aAAa,OAAO,IAAI,OAAO;CAGrC,IAAI,MAAM,WAAW,YAAY,QAAQ,uBAAuB,YAAY,QAAQ,uBAAuB,YAAY,QAAQ,mBAAmB,YAAY,QAAQ,2BAA2B,YAAY,QAAQ,OAAO,YAAY;AACxO,QAAO,cAAc,YAAY,QAAQ,SAAS,cAAc,YAAY,QAAQ,WAAW,YAAY;AAC3G,QAAO,YAAY,YAAY,YAAY,QAAQ,cAAc,YAAY,QAAQ,cAAc,aAAa,YAAY,QAAQ,eAAe,SAAS,OAAO,gBAAgB,YAAY,UAAU,YAAY;AA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oBAAyB;GACzB,iBAAyB;GACzB,eAAyB;GACzB,oBAAyB;GACzB,kBAAyB;;OAEvB;AACN,QAAO,GAAG,YAAY,QAAQ,WAAW,YAAY,QAAQ,QAAQ,YAAY;AACjF,KAAI,EAAE,OACJ,QAAO,KAAK,QAAQ,GAAG;KAEvB,QAAO;EAAC;EAAiB;EAAe;EAAkB;EAAkB;EAAgB;EAAqB;EAAmB;EAAoB;EAAiB;EAAe;EAAoB;GAAkB,KAAK,YAAY;AAGjP,QAAO"}
|
|
1
|
+
{"version":3,"file":"schedules.js","names":["t","teachers","g","groups","locations"],"sources":["../../../../src/Skola24/txt/to/schedules.ts"],"sourcesContent":["import Papa from 'papaparse';\nimport moment from 'moment';\nimport { isString } from 'lodash-es';\nimport type { CoreTypes } from '../../../core';\nimport type { BaseOptions } from '../../../common/types';\nimport { getVertexId } from '../../../core/util';\nimport { isMongooseObjectId } from '../../../common/functions';\n\nconst papaOptions = {\n quotes: false, //or array of booleans\n quoteChar: '\"',\n escapeChar: '\"',\n delimiter: '\\t',\n header: true,\n newline: '\\r\\n',\n skipEmptyLines: false, //other option is 'greedy', meaning skip delimiters, quotes, and whitespace.\n // columns: null //or array of strings\n} as Papa.UnparseConfig;\n\nconst uuid = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;\n\nexport default (\n data: CoreTypes.Mixed.Schedule,\n options: BaseOptions = {}\n): string => {\n const { locations, teachers, groups, persons, events, courses, periods, syllabuses, divisions } = data;\n const { start, /* end, */ displayName } = divisions ?? data as unknown as CoreTypes.Mixed.Division;\n\n const startYear = moment.utc(start).year();\n const startMonth = moment.utc(start).month();\n\n // Set cvs to the source section\n let csv = `[Source]${papaOptions.newline}ApplicationVerMajor=4${papaOptions.newline}ApplicationVerMinor=0${papaOptions.newline}DatabaseRevNo=527${papaOptions.newline}CurrentNovaschemDatabase=${papaOptions.newline}User=${papaOptions.newline}`;\n csv += `SchoolID=RS${papaOptions.newline}School=${displayName}${papaOptions.newline}County=RS${papaOptions.newline}`;\n csv += `BaseYear=${startYear}${papaOptions.newline}OffsetYear=0${papaOptions.newline}OffsetMonth=${startMonth}${papaOptions.newline}CreationDate=${moment().format('YYYY-MM-DD')}${papaOptions.newline}${papaOptions.newline}`;\n // add destination section to csv\n csv += `[Destination]${papaOptions.newline}Application=${papaOptions.newline}ApplicationID=${papaOptions.newline}${papaOptions.newline}`;\n\n // add database options to csv\n csv += `[DatabaseOptions]${papaOptions.newline}Update=TRUE${papaOptions.newline}AddNew=TRUE${papaOptions.newline}${papaOptions.newline}`;\n\n // start tables section\n csv += `[Tables]${papaOptions.newline}${papaOptions.newline}`;\n\n // append teachers to csv\n const t = teachers?.map(teacher => {\n return {\n 'Teacher (6001)': teacher.signature,\n 'GUID (5800)': (teacher.ids && uuid.test(teacher.ids)) ? `{${teacher.ids}}` : '',\n 'Category (6002)': '',\n 'Title (6006)': '',\n 'Phone (6033)': '',\n 'EvaluationNumber (6014)': '',\n ... 'person' in teacher && typeof teacher.person == 'object'\n ? {\n 'PersonalCode (6028)': 'SSN' in teacher.person ? (teacher.person?.SSN?.value ?? '') : '',\n 'LastName (6003)': 'lastName' in teacher.person ? (teacher.person?.lastName ?? '') : '',\n 'FirstName (6004)': 'firstName' in teacher.person ? (teacher.person?.firstName ?? '') : '',\n 'EMail (6034)': 'emails' in teacher.person ? (teacher.person?.emails?.[0]?.value ?? '') : '',\n }\n : null\n };\n }) ?? [];\n csv += `${papaOptions.newline}Teacher (6000)${papaOptions.newline}[Rows]${papaOptions.newline}`;\n if (t.length) {\n csv += Papa.unparse(t, papaOptions);\n } else {\n csv += ['Teacher (6001)', 'GUID (5800)', 'Category (6002)', 'PersonalCode (6028)', 'LastName (6003)', 'Title (6006)', 'FirstName (6004)', 'Phone (6033)', 'EMail (6034)', 'EvaluationNumber (6014)'].join(papaOptions.delimiter);\n }\n csv += papaOptions.newline;\n\n // append students to csv\n const s = persons?.filter(person => {\n return person.type != 'Teacher';\n }).map(person => {\n return {\n 'Student (7201)': person.SSN?.value,\n 'GUID (5800)': (person.ids && uuid.test(person.ids)) ? `{${person.ids}}` : '',\n 'Category (7305)': '',\n 'LastName (7202)': person.lastName ?? '',\n 'FirstName (7211)': person.firstName ?? '',\n 'EMail (7215)': person.emails?.[0]?.value ?? ''\n };\n }) ?? [];\n csv += `${papaOptions.newline}Student (7200)${papaOptions.newline}[Rows]${papaOptions.newline}`;\n if (s.length) {\n csv += Papa.unparse(s, papaOptions);\n } else {\n csv += ['Student (7201)', 'GUID (5800)', 'Category (7305)', 'LastName (7202)', 'FirstName (7211)', 'EMail (7215)'].join(papaOptions.delimiter);\n }\n csv += papaOptions.newline;\n\n // create a map of students.id to students.SSN\n const studentMap = new Map(persons?.filter(x => x.type != 'Teacher').map(x => [getVertexId(x, options), x.SSN?.value ?? '']));\n\n // append groups to csv\n const g = groups?.map(group => {\n return {\n 'Group (6201)': group.displayName!,\n 'GUID (5800)': (group.ids && uuid.test(group.ids)) ? `{${group.ids}}` : '',\n 'Class (6210)': group.species == 'class' ? 1 : 0,\n 'Teacher (6204)': '',\n 'IClass (6206)': '',\n 'Student (6205)': group.members?.map(x => getVertexId(x, options)).map(x => studentMap.get(x)).filter(Boolean).join(',')\n };\n }) ?? [];\n csv += `${papaOptions.newline}Group (6200)${papaOptions.newline}[Rows]${papaOptions.newline}`;\n if (g.length) {\n csv += Papa.unparse(g, papaOptions);\n } else {\n csv += ['Group (6201)', 'GUID (5800)', 'Class (6210)', 'Teacher (6204)', 'IClass (6206)', 'Student (6205)'].join(papaOptions.delimiter);\n }\n csv += papaOptions.newline;\n\n // append locations to csv\n const l = locations?.map(location => {\n return {\n 'Room (6601)': location.displayName!,\n 'GUID (5800)': (location.ids && uuid.test(location.ids)) ? `{${location.ids}}` : '',\n 'Category (6602)': location.tags?.find(tag => tag.type == 'category')?.value ?? '',\n 'SeatingCapacity (6607)': location.maximumCapacity,\n };\n }) ?? [];\n csv += `${papaOptions.newline}Room (6600)${papaOptions.newline}[Rows]${papaOptions.newline}`;\n if (l.length) {\n csv += Papa.unparse(l, papaOptions);\n } else {\n csv += ['Room (6601)', 'GUID (5800)', 'Category (6602)', 'SeatingCapacity (6607)'].join(papaOptions.delimiter);\n }\n csv += papaOptions.newline;\n\n // append periods to csv\n const p = periods?.map(period => {\n return {\n 'Period (8001)': period.displayName!,\n 'GUID (5800)': (period.ids && uuid.test(period.ids)) ? `{${period.ids}}` : '',\n 'TextBelowSchedule (8002)': period.displayName!,\n 'Category (8006)': '',\n 'Calendar (8005)': period.ranges?.map(range => `${moment.utc(range.start).format('D/M')}-${moment.utc(range.end).format('D/M')}`).join(', ')\n };\n }) ?? [];\n csv += `${papaOptions.newline}Period (8000)${papaOptions.newline}[Rows]${papaOptions.newline}`;\n if (p.length) {\n csv += Papa.unparse(p, papaOptions);\n } else {\n csv += ['Period (8001)', 'GUID (5800)', 'TextBelowSchedule (8002)', 'Category (8006)', 'Calendar (8005)'].join(papaOptions.delimiter);\n }\n csv += papaOptions.newline;\n\n const courseMap = new Map(data.courses ?.map(x => [getVertexId(x, options), x]));\n const periodMap = new Map(data.periods ?.map(x => [getVertexId(x, options), x]));\n const teacherMap = new Map(data.teachers ?.map(x => [getVertexId(x, options), x]));\n const groupMap = new Map(data.groups ?.map(x => [getVertexId(x, options), x]));\n const locationMap = new Map(data.locations ?.map(x => [getVertexId(x, options), x]));\n const syllabusMap = new Map(data.syllabuses?.map(x => [getVertexId(x, options), x]));\n\n // append lessons to csv\n const e = events\n // ?.filter(x => !isNaN(Date.parse(x.start?.toString() ?? '')))\n .map((event, index) => {\n if (!event.start || !event.end) return;\n\n const courseId = event.course ? getVertexId(event.course, options) : undefined;\n const course = courseId ? courseMap.get(courseId) : undefined;\n\n // Only use deserialize period\n let period = event.period == null ? course?.period : event.period;\n if (isString(period))\n period = periodMap.get(period);\n if ((period && !('ranges' in period)))\n period = undefined;\n\n // Only use deserialize teachers\n const t = event.teachers == null ? course?.teachers : event.teachers;\n const teacherIds = t?.map(x => getVertexId(x.to, options));\n const teachers = teacherIds?.map(id => teacherMap.get(id)).filter(Boolean) ?? [];\n\n // Only use deserialize groups\n const g = event.groups == null ? course?.groups : event.groups;\n const groupIds = g?.map(x => getVertexId(x.to, options));\n const groups = groupIds?.map(id => groupMap.get(id)).filter(Boolean) ?? [];\n\n // Only use deserialize locations\n const locationIds = event.inLocations?.map(x => x ? getVertexId(x, options) : null).filter(x => x != null);\n const locations = locationIds?.map(id => locationMap.get(id)).filter(Boolean) ?? [];\n const dayOfWeek = moment.utc(event.start).toDate().toLocaleDateString('sv-SE', { weekday: 'long', timeZone: 'UTC' });\n\n // Syllabus of the course\n const syllabusId = isString(course?.syllabus)\n ? course.syllabus\n : (course?.syllabus && isMongooseObjectId(course.syllabus))\n ? course.syllabus.toString()\n : undefined;\n const syllabus = syllabusId ? syllabusMap.get(syllabusId) : course?.syllabus as CoreTypes.Deep.Syllabus | undefined;\n\n // capitalize first letter of dayOfWeek\n const dayOfWeekCapitalized = dayOfWeek.charAt(0).toUpperCase() + dayOfWeek.slice(1);\n return {\n 'PK (7100)': index + 1,\n 'GUID (5800)': (event.ids && uuid.test(event.ids)) ? `{${event.ids}}` : '',\n 'DayOfWeek (7101)': dayOfWeekCapitalized,\n 'Starttime (7102)': moment.utc(event.start).format('HH:mm'),\n 'Length (7115)': event.duration,\n 'Course (7106)': syllabus?.courseCode,\n 'Subject (7103)': syllabus?.subjectCode ?? course?.subject ?? '',\n 'Teacher (7104)': teachers ?.map(x => x?.signature ).filter(Boolean).join(','),\n 'Group (7105)': groups ?.map(x => x?.displayName).filter(Boolean).join(','),\n 'Room (7107)': locations?.map(x => x?.displayName).filter(Boolean).join(','),\n 'Period (7108)': '',\n 'Week (7109)': '',\n 'ActualWeeks (7167)': period?.ranges?.map(range => `${moment.utc(range.start).week()}-${moment.utc(range.end).week()}`).join(',')\n };\n }).filter(Boolean) ?? [];\n csv += `${papaOptions.newline}Lesson (7100)${papaOptions.newline}[Rows]${papaOptions.newline}`;\n if (e.length) {\n csv += Papa.unparse(e, papaOptions);\n } else {\n csv += ['PK (7100)', 'GUID (5800)', 'DayOfWeek (7101)', 'Starttime (7102)', 'Length (7115)', 'Course (7106)', 'Subject (7103)', 'Period (7108)', 'Week (7109)', 'ActualWeeks (7167)'].join(papaOptions.delimiter);\n }\n csv += papaOptions.newline;\n\n // append subjects to csv, is empty for now\n // csv += `Subject (6400)${options.newline}[Rows]${options.newline}`;\n // csv += ['Subject (6401)', 'GUID (5800)', 'Category (6402)', 'FullText (6403)', 'BackgroundColor (6432)', 'TextColor (6433)', 'EvaluationNumber (6429)'].join(options.delimiter);\n // csv += options.newline;\n\n // append syllabus to csv\n const courseSyllabuses = syllabuses?.filter(syllabus => !!syllabus.courseName).map(syllabus => {\n return {\n 'Course (7601)': syllabus.courseCode,\n 'GUID (5800)': syllabus.ids,\n 'FullText (7602)': syllabus.courseName,\n 'Subject (7603)': syllabus.subjectCode ?? '',\n 'Points (7604)': syllabus.points\n };\n }) ?? [];\n csv += `${papaOptions.newline}Course (7600)${papaOptions.newline}[Rows]${papaOptions.newline}`;\n if (courseSyllabuses.length) {\n csv += Papa.unparse(courseSyllabuses, papaOptions);\n } else {\n csv += ['PK (7100)', 'GUID (5800)', 'DayOfWeek (7101)', 'Starttime (7102)', 'Length (7115)', 'Course (7106)', 'Subject (7103)', 'Period (7108)', 'Week (7109)', 'ActualWeeks (7167)'].join(papaOptions.delimiter);\n }\n csv += papaOptions.newline;\n\n const subjectSyllabuses = syllabuses?.reduce((unique, syllabus) => {\n if (syllabus.subjectCode && !unique.seen.has(syllabus.subjectCode)) {\n unique.seen.add(syllabus.subjectCode);\n unique.result.push({\n 'Subject (6401)': syllabus.subjectCode,\n 'GUID (5800)': syllabus.ids,\n 'FullText (6403)': syllabus.subjectName,\n });\n }\n return unique;\n }, {\n seen: new Set<string>(),\n result: [] as Array<{\n 'Subject (6401)': string;\n 'GUID (5800)': string | undefined;\n 'FullText (6403)': string;\n }>\n })?.result ?? [];\n csv += `Subject (6400)${papaOptions.newline}[Rows]${papaOptions.newline}`;\n if (subjectSyllabuses.length) {\n csv += Papa.unparse(subjectSyllabuses, papaOptions);\n } else {\n csv += ['Subject (6401)', 'GUID (5800)', 'Category (6402)', 'FullText (6403)', 'BackgroundColor (6432)', 'TextColor (6433)', 'EvaluationNumber (6429)'].join(papaOptions.delimiter);\n }\n\n const totalHoursRegex = /(\\d+) hrs/;\n const weekTimeRegex = /(\\d+) min\\/week/;\n const c = courses?.map(course => {\n // Only use deserialize teachers\n const teacherIds = course.teachers?.map(x => getVertexId(x.to, options)).filter(Boolean);\n const teachers = teacherIds?.map(id => teacherMap.get(id)!).filter(Boolean) ?? [];\n\n // Only use deserialize groups\n const groupIds = course.groups?.map(x => getVertexId(x.to, options)).filter(Boolean);\n const groups = groupIds?.map(id => groupMap.get(id)!).filter(Boolean) ?? [];\n\n // Only use deserialize syllabus\n const syllabusId = isString(course?.syllabus)\n ? course.syllabus\n : (course?.syllabus && isMongooseObjectId(course.syllabus))\n ? course.syllabus.toString()\n : undefined;\n const syllabus = syllabusId ? syllabusMap.get(syllabusId) : course?.syllabus as CoreTypes.Deep.Syllabus | undefined;\n\n return {\n 'PK (8200)': '',\n 'GUID (5800)': course.ids,\n 'OriginalRecord (8224)': '1',\n 'CreateLesson (8227)': '1',\n 'Course (8202)': syllabus?.courseCode,\n 'Subject (8209)': syllabus?.subjectCode ?? course.subject, // Nikos ansvarig för framtida buggar\n 'Teacher (8210)': teachers?.map(teacher => teacher.signature).filter(Boolean).join(','),\n 'Group (8203)': groups?.map(group => group.displayName).filter(Boolean).join(','),\n 'TotalHours (8204)': (course.plannedDuration && totalHoursRegex.test(course.plannedDuration)) ? totalHoursRegex.exec(course.plannedDuration)![1] : '',\n 'Weektime (8208)': (course.plannedDuration && weekTimeRegex.test(course.plannedDuration)) ? weekTimeRegex.exec(course.plannedDuration)![1] : '',\n 'Blockname (8215)': '',\n 'Period (8206)': '',\n 'Week (8207)': '',\n 'NotPeriod (8212)': '',\n 'NotWeek (8213)': ''\n };\n }) ?? [];\n csv += `${papaOptions.newline}TA (8200)${papaOptions.newline}[Rows]${papaOptions.newline}`;\n if (c.length) {\n csv += Papa.unparse(c, papaOptions);\n } else {\n csv += ['Course (8202)', 'GUID (5800)', 'Subject (8209)', 'Teacher (8210)', 'Group (8203)', 'TotalHours (8204)', 'Weektime (8208)', 'Blockname (8215)', 'Period (8206)', 'Week (8207)', 'NotPeriod (8212)', 'NotWeek (8213)'].join(papaOptions.delimiter);\n }\n\n return csv;\n};"],"mappings":";;;;;;;AAQA,MAAM,cAAc;CAClB,QAAgB;CAChB,WAAgB;CAChB,YAAgB;CAChB,WAAgB;CAChB,QAAgB;CAChB,SAAgB;CAChB,gBAAgB;;AAIlB,MAAM,OAAO;AAEb,yBACE,MACA,UAAuB,OACZ;CACX,MAAM,EAAE,WAAW,UAAU,QAAQ,SAAS,QAAQ,SAAS,SAAS,YAAY,cAAc;CAClG,MAAM,EAAE,OAAkB,gBAAgB,aAAa;CAEvD,MAAM,YAAa,OAAO,IAAI,OAAO;CACrC,MAAM,aAAa,OAAO,IAAI,OAAO;CAGrC,IAAI,MAAM,WAAW,YAAY,QAAQ,uBAAuB,YAAY,QAAQ,uBAAuB,YAAY,QAAQ,mBAAmB,YAAY,QAAQ,2BAA2B,YAAY,QAAQ,OAAO,YAAY;AACxO,QAAO,cAAc,YAAY,QAAQ,SAAS,cAAc,YAAY,QAAQ,WAAW,YAAY;AAC3G,QAAO,YAAY,YAAY,YAAY,QAAQ,cAAc,YAAY,QAAQ,cAAc,aAAa,YAAY,QAAQ,eAAe,SAAS,OAAO,gBAAgB,YAAY,UAAU,YAAY;AAErN,QAAO,gBAAgB,YAAY,QAAQ,cAAc,YAAY,QAAQ,gBAAgB,YAAY,UAAU,YAAY;AAG/H,QAAO,oBAAoB,YAAY,QAAQ,aAAa,YAAY,QAAQ,aAAa,YAAY,UAAU,YAAY;AAG/H,QAAO,WAA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,QAAO,KAAK,QAAQ,GAAG;KAEvB,QAAO;EAAC;EAAiB;EAAe;EAAkB;EAAkB;EAAgB;EAAqB;EAAmB;EAAoB;EAAiB;EAAe;EAAoB;GAAkB,KAAK,YAAY;AAGjP,QAAO"}
|
|
@@ -84,6 +84,7 @@ type GlobalDefaultValues = {
|
|
|
84
84
|
dayEnd: string;
|
|
85
85
|
numDays: number;
|
|
86
86
|
potentialCenter?: string;
|
|
87
|
+
minimizeTeacherGaps?: boolean;
|
|
87
88
|
defaultGroupMinimumBreakLength?: number;
|
|
88
89
|
defaultEventMinimumBreakLength?: number;
|
|
89
90
|
defaultDependencyMinimumBreakLength?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"companies.js","names":[],"sources":["../../../../src/core/interfaces/other/companies.ts"],"sourcesContent":["import type { Partner, IntegrationTypes, OrganizationType, Theme, SamlProvider } from './etc';\nimport type { PlannedScheduledDuration } from '../vertices/properties/planned-scheduled-duration';\nimport type { MaximumScheduleSpan } from '../vertices/properties/maximum-schedule-span';\nimport type { PublicId } from '../vertices/properties';\n\n\ntype Identifier = {\n value: string;\n type: 'VAT' | 'SchoolCode' | 'MunicipalityCode' | 'SchoolSoft' | 'Sdui' | 'Edlevo' | 'Edaktus';\n country: string;\n};\n\ntype AppFeature = {\n substitutionPlanner?: {\n enabled: boolean;\n };\n statisticsModule?: {\n /**\n * Enables the whole statistics module.\n */\n enabled?: boolean;\n\n scb?: boolean;\n lunchCongestion?: boolean;\n };\n includeStepGuide?: boolean;\n};\n\nexport type Address = {\n type: string; // Type of address (e.g., home, work, etc.)\n streetAddress: string; // Street address (e.g., 123 Main St)\n addressLine2?: string; // Optional second line of the address (e.g., Apt 4B)sss\n addressLine3?: string; // Optional third line of the address\n postalCode: string; // Postal code (e.g., 12345)\n locality: string; // City or locality (e.g., New York)\n state?: string; // Optional state or province (e.g., NY)\n region?: string; // Optional region (e.g., Northeast)\n country: string; // Country (e.g., USA)\n geoCoordinates: {\n latitude: string;\n longitude: string;\n };\n};\n\nexport type TimeRosterSection = {\n start: string; // In HH:mm format\n end: string; // In HH:mm format\n id: string;\n name: string;\n};\n\nexport type PublicConfig = {\n filters: {\n groups: boolean;\n teachers: boolean;\n inLocations: boolean;\n tags: boolean;\n subjects: boolean;\n subGroups: boolean;\n };\n showTeacherWorkingHours: boolean;\n multipleSelection: boolean;\n timeFilters: {\n all: boolean;\n periods: boolean;\n };\n lockedTimes: boolean;\n};\n\nexport type AutoSyncConfig = {\n enabled: boolean;\n integration?: IntegrationTypes;\n weekdaysOnly?: boolean;\n time?: string;\n};\n\nexport const INACTIVITY_ACTIONS = {\n REFRESH: 'refresh',\n LOGOUT: 'logout',\n} as const;\nexport type InactivityAction =\n (typeof INACTIVITY_ACTIONS)[keyof typeof INACTIVITY_ACTIONS];\n\nexport type InactivitySettings = {\n /**\n * In units of minutes\n */\n time: number;\n action: InactivityAction;\n};\n\nexport type GlobalDefaultValues = {\n dayStart: string;\n dayEnd: string;\n numDays: number;\n potentialCenter?: string;\n defaultGroupMinimumBreakLength?: number;\n defaultEventMinimumBreakLength?: number;\n defaultDependencyMinimumBreakLength?: number;\n defaultPlannedScheduledDuration?: PlannedScheduledDuration;\n defaultMaximumScheduleSpan?: MaximumScheduleSpan;\n defaultEventDurationVariance?: number;\n};\n\nexport namespace Company {\n export type core = {\n readonly id: PublicId;\n associatedPartner?: Partner | null;\n createdAt?: string;\n };\n\n type optionals = {\n name?: string;\n logo?: string; // URL to the company's logo\n timezone?: string;\n environment: {\n theme?: Theme;\n organizationType?: OrganizationType;\n appFeatures?: AppFeature;\n canCreateCompanies?: boolean;\n };\n identifiers: Identifier[];\n addresses: Address[];\n constituentTypes: string[];\n samlProviders?: SamlProvider[];\n publicSettings?: PublicConfig;\n autoSync?: AutoSyncConfig;\n organization?: {\n name?: string;\n logo?: string;\n inactivitySettings?: InactivitySettings;\n constituentTypes?: string[];\n environment?: Company.complete['environment'];\n };\n inactivitySettings?: InactivitySettings;\n timeRoster?: TimeRosterSection[];\n globalDefaultValues?: GlobalDefaultValues;\n };\n\n export type complete = core & optionals;\n}\n"],"mappings":";AA4EA,MAAa,qBAAqB;CAChC,SAAS;CACT,QAAS"}
|
|
1
|
+
{"version":3,"file":"companies.js","names":[],"sources":["../../../../src/core/interfaces/other/companies.ts"],"sourcesContent":["import type { Partner, IntegrationTypes, OrganizationType, Theme, SamlProvider } from './etc';\nimport type { PlannedScheduledDuration } from '../vertices/properties/planned-scheduled-duration';\nimport type { MaximumScheduleSpan } from '../vertices/properties/maximum-schedule-span';\nimport type { PublicId } from '../vertices/properties';\n\n\ntype Identifier = {\n value: string;\n type: 'VAT' | 'SchoolCode' | 'MunicipalityCode' | 'SchoolSoft' | 'Sdui' | 'Edlevo' | 'Edaktus';\n country: string;\n};\n\ntype AppFeature = {\n substitutionPlanner?: {\n enabled: boolean;\n };\n statisticsModule?: {\n /**\n * Enables the whole statistics module.\n */\n enabled?: boolean;\n\n scb?: boolean;\n lunchCongestion?: boolean;\n };\n includeStepGuide?: boolean;\n};\n\nexport type Address = {\n type: string; // Type of address (e.g., home, work, etc.)\n streetAddress: string; // Street address (e.g., 123 Main St)\n addressLine2?: string; // Optional second line of the address (e.g., Apt 4B)sss\n addressLine3?: string; // Optional third line of the address\n postalCode: string; // Postal code (e.g., 12345)\n locality: string; // City or locality (e.g., New York)\n state?: string; // Optional state or province (e.g., NY)\n region?: string; // Optional region (e.g., Northeast)\n country: string; // Country (e.g., USA)\n geoCoordinates: {\n latitude: string;\n longitude: string;\n };\n};\n\nexport type TimeRosterSection = {\n start: string; // In HH:mm format\n end: string; // In HH:mm format\n id: string;\n name: string;\n};\n\nexport type PublicConfig = {\n filters: {\n groups: boolean;\n teachers: boolean;\n inLocations: boolean;\n tags: boolean;\n subjects: boolean;\n subGroups: boolean;\n };\n showTeacherWorkingHours: boolean;\n multipleSelection: boolean;\n timeFilters: {\n all: boolean;\n periods: boolean;\n };\n lockedTimes: boolean;\n};\n\nexport type AutoSyncConfig = {\n enabled: boolean;\n integration?: IntegrationTypes;\n weekdaysOnly?: boolean;\n time?: string;\n};\n\nexport const INACTIVITY_ACTIONS = {\n REFRESH: 'refresh',\n LOGOUT: 'logout',\n} as const;\nexport type InactivityAction =\n (typeof INACTIVITY_ACTIONS)[keyof typeof INACTIVITY_ACTIONS];\n\nexport type InactivitySettings = {\n /**\n * In units of minutes\n */\n time: number;\n action: InactivityAction;\n};\n\nexport type GlobalDefaultValues = {\n dayStart: string;\n dayEnd: string;\n numDays: number;\n potentialCenter?: string;\n minimizeTeacherGaps?: boolean;\n defaultGroupMinimumBreakLength?: number;\n defaultEventMinimumBreakLength?: number;\n defaultDependencyMinimumBreakLength?: number;\n defaultPlannedScheduledDuration?: PlannedScheduledDuration;\n defaultMaximumScheduleSpan?: MaximumScheduleSpan;\n defaultEventDurationVariance?: number;\n};\n\nexport namespace Company {\n export type core = {\n readonly id: PublicId;\n associatedPartner?: Partner | null;\n createdAt?: string;\n };\n\n type optionals = {\n name?: string;\n logo?: string; // URL to the company's logo\n timezone?: string;\n environment: {\n theme?: Theme;\n organizationType?: OrganizationType;\n appFeatures?: AppFeature;\n canCreateCompanies?: boolean;\n };\n identifiers: Identifier[];\n addresses: Address[];\n constituentTypes: string[];\n samlProviders?: SamlProvider[];\n publicSettings?: PublicConfig;\n autoSync?: AutoSyncConfig;\n organization?: {\n name?: string;\n logo?: string;\n inactivitySettings?: InactivitySettings;\n constituentTypes?: string[];\n environment?: Company.complete['environment'];\n };\n inactivitySettings?: InactivitySettings;\n timeRoster?: TimeRosterSection[];\n globalDefaultValues?: GlobalDefaultValues;\n };\n\n export type complete = core & optionals;\n}\n"],"mappings":";AA4EA,MAAa,qBAAqB;CAChC,SAAS;CACT,QAAS"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { VertexFactory } from "./util/vertex.js";
|
|
2
|
+
import { EdgeWrapper, Plain } from "./util/edges.js";
|
|
3
|
+
import { BelongsTo } from "./properties/belongs-to.js";
|
|
4
|
+
import { UserVertex } from "./users.js";
|
|
5
|
+
import { MessageVertex } from "./messages.js";
|
|
6
|
+
|
|
7
|
+
//#region src/core/interfaces/vertices/conversations.d.ts
|
|
8
|
+
type ConversationVertex = VertexFactory<'conversations', BelongsTo & {
|
|
9
|
+
user: EdgeWrapper<'single', Plain.Edge<UserVertex>>;
|
|
10
|
+
messages?: EdgeWrapper<'array', Plain.Edge<MessageVertex>>;
|
|
11
|
+
title?: string;
|
|
12
|
+
settings: {
|
|
13
|
+
model: string;
|
|
14
|
+
thinking: boolean;
|
|
15
|
+
};
|
|
16
|
+
tokenUsage?: {
|
|
17
|
+
promptTokens?: number;
|
|
18
|
+
completionTokens?: number;
|
|
19
|
+
};
|
|
20
|
+
active?: boolean;
|
|
21
|
+
stagedEdits?: {
|
|
22
|
+
teachers?: any[];
|
|
23
|
+
persons?: any[];
|
|
24
|
+
courses?: any[];
|
|
25
|
+
groups?: any[];
|
|
26
|
+
events?: any[];
|
|
27
|
+
locations?: any[];
|
|
28
|
+
};
|
|
29
|
+
}>;
|
|
30
|
+
//#endregion
|
|
31
|
+
export { ConversationVertex };
|
|
32
|
+
//# sourceMappingURL=conversations.d.ts.map
|
|
@@ -8,9 +8,9 @@ import { PeriodVertex } from "./periods.js";
|
|
|
8
8
|
import { BelongsTo } from "./properties/belongs-to.js";
|
|
9
9
|
import { PersonVertex } from "./persons.js";
|
|
10
10
|
import { LocationVertex } from "./locations.js";
|
|
11
|
+
import { SyllabusVertex } from "./syllabuses.js";
|
|
11
12
|
import { EventVertex } from "./events.js";
|
|
12
13
|
import { OverlapGroupVertex } from "./overlap-groups.js";
|
|
13
|
-
import { SyllabusVertex } from "./syllabuses.js";
|
|
14
14
|
import { ExceptionVertex } from "./exceptions.js";
|
|
15
15
|
import { GroupVertex } from "./groups.js";
|
|
16
16
|
import { LockedTimeVertex } from "./locked-times.js";
|
|
@@ -25,6 +25,7 @@ type DivisionSettingsVertex = VertexFactory<'settings', BelongsTo & {
|
|
|
25
25
|
dayEnd: string;
|
|
26
26
|
discretization: number;
|
|
27
27
|
potentialCenter: string;
|
|
28
|
+
minimizeTeacherGaps?: boolean;
|
|
28
29
|
defaultEventMinimumBreakLength?: number;
|
|
29
30
|
defaultGroupMinimumBreakLength?: number;
|
|
30
31
|
defaultDependencyMinimumBreakLength?: number;
|
|
@@ -10,6 +10,7 @@ import { PersonVertex } from "./persons.js";
|
|
|
10
10
|
import { LocationVertex } from "./locations.js";
|
|
11
11
|
import { LinkedEventsSetVertex } from "./linked-events-sets.js";
|
|
12
12
|
import { ThreadVertex } from "./threads.js";
|
|
13
|
+
import { SyllabusVertex } from "./syllabuses.js";
|
|
13
14
|
import { OverlapGroupVertex } from "./overlap-groups.js";
|
|
14
15
|
import { CourseVertex } from "./courses.js";
|
|
15
16
|
import { ExceptionVertex } from "./exceptions.js";
|
|
@@ -72,6 +73,7 @@ type ScheduleEventVertex = VertexFactory<'scheduleEvents', EventProperties & {
|
|
|
72
73
|
start?: Moment | string;
|
|
73
74
|
end?: Moment | string;
|
|
74
75
|
persons?: EdgeWrapper<'array', Plain.Edge<PersonVertex>>;
|
|
76
|
+
syllabus?: EdgeWrapper<'single', Plain.Edge<SyllabusVertex>>;
|
|
75
77
|
}>;
|
|
76
78
|
type CalendarEventVertex = VertexFactory<'calendarEvents', BasicSharedProperties & {
|
|
77
79
|
meta: {
|
|
@@ -85,6 +87,7 @@ type CalendarEventVertex = VertexFactory<'calendarEvents', BasicSharedProperties
|
|
|
85
87
|
start: number;
|
|
86
88
|
end: number;
|
|
87
89
|
exceptions?: EdgeWrapper<'array', Plain.Edge<ExceptionVertex>>;
|
|
90
|
+
syllabus?: EdgeWrapper<'single', Plain.Edge<SyllabusVertex>>;
|
|
88
91
|
inLocations?: EdgeWrapper<'array', Plain.Edge<LocationVertex> | null>;
|
|
89
92
|
participants?: EdgeWrapper<'array', Wrapped.Edge<'to', PersonVertex, {
|
|
90
93
|
groupIndex?: number;
|
|
@@ -12,15 +12,17 @@ import { LocationVertex } from "./locations.js";
|
|
|
12
12
|
import { LinkedEventsSetVertex } from "./linked-events-sets.js";
|
|
13
13
|
import { UserVertex } from "./users.js";
|
|
14
14
|
import { ThreadVertex } from "./threads.js";
|
|
15
|
+
import { SyllabusVertex } from "./syllabuses.js";
|
|
15
16
|
import { CalendarEventVertex, EventVertex, ScheduleEventVertex } from "./events.js";
|
|
16
17
|
import { OverlapGroupVertex } from "./overlap-groups.js";
|
|
17
|
-
import { SyllabusVertex } from "./syllabuses.js";
|
|
18
18
|
import { CourseVertex } from "./courses.js";
|
|
19
19
|
import { CalendarExceptionAction, ExceptionStatus, ExceptionVertex } from "./exceptions.js";
|
|
20
20
|
import { GroupVertex } from "./groups.js";
|
|
21
21
|
import { LockedTimeType, LockedTimeVertex } from "./locked-times.js";
|
|
22
22
|
import { TeacherVertex } from "./teachers.js";
|
|
23
23
|
import { ConfigurationFilterVertex, ConfigurationRuleVertex, ConfigurationTemplateVertex, ConfigurationVertex } from "./configurations.js";
|
|
24
|
+
import { MessageVertex } from "./messages.js";
|
|
25
|
+
import { ConversationVertex } from "./conversations.js";
|
|
24
26
|
import { Infer, VertexQuery, createVertexQuery } from "./vertex-query.js";
|
|
25
27
|
|
|
26
28
|
//#region src/core/interfaces/vertices/index.d.ts
|
|
@@ -64,6 +66,8 @@ declare namespace Serialized {
|
|
|
64
66
|
type Syllabus = SerializedVertexExport<SyllabusVertex>;
|
|
65
67
|
type Thread = SerializedVertexExport<ThreadVertex>;
|
|
66
68
|
type User = SerializedVertexExport<UserVertex>;
|
|
69
|
+
type Conversation = SerializedVertexExport<ConversationVertex>;
|
|
70
|
+
type Message = SerializedVertexExport<MessageVertex>;
|
|
67
71
|
namespace Configuration {
|
|
68
72
|
type Base = SerializedVertexExport<ConfigurationVertex>;
|
|
69
73
|
type Filter = SerializedVertexExport<ConfigurationFilterVertex>;
|
|
@@ -94,6 +98,8 @@ declare namespace Deep {
|
|
|
94
98
|
type Syllabus = DeepVertexExport<SyllabusVertex>;
|
|
95
99
|
type Thread = DeepVertexExport<ThreadVertex>;
|
|
96
100
|
type User = DeepVertexExport<UserVertex>;
|
|
101
|
+
type Conversation = DeepVertexExport<ConversationVertex>;
|
|
102
|
+
type Message = DeepVertexExport<MessageVertex>;
|
|
97
103
|
namespace Configuration {
|
|
98
104
|
type Base = DeepVertexExport<ConfigurationVertex>;
|
|
99
105
|
type Filter = DeepVertexExport<ConfigurationFilterVertex>;
|
|
@@ -124,6 +130,8 @@ declare namespace DeepWithoutPrivateId {
|
|
|
124
130
|
type Syllabus = DeepVertexExportOmitPrivateId<SyllabusVertex>;
|
|
125
131
|
type Thread = DeepVertexExportOmitPrivateId<ThreadVertex>;
|
|
126
132
|
type User = DeepVertexExportOmitPrivateId<UserVertex>;
|
|
133
|
+
type Conversation = DeepVertexExportOmitPrivateId<ConversationVertex>;
|
|
134
|
+
type Message = DeepVertexExportOmitPrivateId<MessageVertex>;
|
|
127
135
|
namespace Configuration {
|
|
128
136
|
type Base = DeepVertexExport<ConfigurationVertex>;
|
|
129
137
|
type Filter = DeepVertexExport<ConfigurationFilterVertex>;
|
|
@@ -154,6 +162,8 @@ declare namespace Mixed {
|
|
|
154
162
|
type Syllabus = MixedVertexExport<SyllabusVertex>;
|
|
155
163
|
type Thread = MixedVertexExport<ThreadVertex>;
|
|
156
164
|
type User = MixedVertexExport<UserVertex>;
|
|
165
|
+
type Conversation = MixedVertexExport<ConversationVertex>;
|
|
166
|
+
type Message = MixedVertexExport<MessageVertex>;
|
|
157
167
|
namespace Configuration {
|
|
158
168
|
type Base = MixedVertexExport<ConfigurationVertex>;
|
|
159
169
|
type Filter = MixedVertexExport<ConfigurationFilterVertex>;
|
|
@@ -184,6 +194,8 @@ declare namespace MixedWithOptionalId {
|
|
|
184
194
|
type Syllabus = MixedWithOptionalIdVertexExport<SyllabusVertex>;
|
|
185
195
|
type Thread = MixedWithOptionalIdVertexExport<ThreadVertex>;
|
|
186
196
|
type User = MixedWithOptionalIdVertexExport<UserVertex>;
|
|
197
|
+
type Conversation = MixedWithOptionalIdVertexExport<ConversationVertex>;
|
|
198
|
+
type Message = MixedWithOptionalIdVertexExport<MessageVertex>;
|
|
187
199
|
namespace Configuration {
|
|
188
200
|
type Base = MixedWithOptionalIdVertexExport<ConfigurationVertex>;
|
|
189
201
|
type Filter = MixedWithOptionalIdVertexExport<ConfigurationFilterVertex>;
|
|
@@ -215,6 +227,8 @@ declare namespace SerializedWithOptionalId {
|
|
|
215
227
|
export type Syllabus = MakeIdsOptional<Serialized.Syllabus>;
|
|
216
228
|
export type Thread = MakeIdsOptional<Serialized.Thread>;
|
|
217
229
|
export type User = MakeIdsOptional<Serialized.User>;
|
|
230
|
+
export type Conversation = MakeIdsOptional<Serialized.Conversation>;
|
|
231
|
+
export type Message = MakeIdsOptional<Serialized.Message>;
|
|
218
232
|
export namespace Configuration {
|
|
219
233
|
type Base = MakeIdsOptional<Serialized.Configuration.Base>;
|
|
220
234
|
type Filter = MakeIdsOptional<Serialized.Configuration.Filter>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { VertexFactory } from "./util/vertex.js";
|
|
2
|
+
import { EdgeWrapper, Plain } from "./util/edges.js";
|
|
3
|
+
import { BelongsTo } from "./properties/belongs-to.js";
|
|
4
|
+
import { UserVertex } from "./users.js";
|
|
5
|
+
import { ConversationVertex } from "./conversations.js";
|
|
6
|
+
|
|
7
|
+
//#region src/core/interfaces/vertices/messages.d.ts
|
|
8
|
+
type MessageVertex = VertexFactory<'messages', BelongsTo & {
|
|
9
|
+
user: EdgeWrapper<'single', Plain.Edge<UserVertex>>;
|
|
10
|
+
conversation: EdgeWrapper<'single', Plain.Edge<ConversationVertex>>;
|
|
11
|
+
type: string;
|
|
12
|
+
content?: string;
|
|
13
|
+
status?: string;
|
|
14
|
+
name?: string;
|
|
15
|
+
args?: unknown;
|
|
16
|
+
response?: unknown;
|
|
17
|
+
error?: string;
|
|
18
|
+
}>;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { MessageVertex };
|
|
21
|
+
//# sourceMappingURL=messages.d.ts.map
|
|
@@ -5,7 +5,7 @@ import { ObjectId } from "../../../../common/types.js";
|
|
|
5
5
|
/**
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
|
-
type RealCollection = 'settings' | 'divisionSettings' | 'exceptions' | 'groups' | 'teachers' | 'locations' | 'configurations' | 'courses' | 'events' | 'generations' | 'lockedTimes' | 'overlapGroups' | 'linkedEventsSets' | 'periods' | 'rootIntervals' | 'persons' | 'syllabuses' | 'divisions' | 'companies' | 'users' | 'threads';
|
|
8
|
+
type RealCollection = 'settings' | 'divisionSettings' | 'exceptions' | 'groups' | 'teachers' | 'locations' | 'configurations' | 'courses' | 'events' | 'generations' | 'lockedTimes' | 'overlapGroups' | 'linkedEventsSets' | 'periods' | 'rootIntervals' | 'persons' | 'syllabuses' | 'divisions' | 'companies' | 'users' | 'threads' | 'conversations' | 'messages';
|
|
9
9
|
/**
|
|
10
10
|
*
|
|
11
11
|
*/
|
|
@@ -11,9 +11,9 @@ import { LocationVertex } from "./locations.js";
|
|
|
11
11
|
import { LinkedEventsSetVertex } from "./linked-events-sets.js";
|
|
12
12
|
import { UserVertex } from "./users.js";
|
|
13
13
|
import { ThreadVertex } from "./threads.js";
|
|
14
|
+
import { SyllabusVertex } from "./syllabuses.js";
|
|
14
15
|
import { CalendarEventVertex, EventVertex, ScheduleEventVertex } from "./events.js";
|
|
15
16
|
import { OverlapGroupVertex } from "./overlap-groups.js";
|
|
16
|
-
import { SyllabusVertex } from "./syllabuses.js";
|
|
17
17
|
import { CourseVertex } from "./courses.js";
|
|
18
18
|
import { ExceptionVertex } from "./exceptions.js";
|
|
19
19
|
import { GroupVertex } from "./groups.js";
|
|
@@ -21,6 +21,8 @@ import { LockedTimeVertex } from "./locked-times.js";
|
|
|
21
21
|
import { TeacherVertex } from "./teachers.js";
|
|
22
22
|
import { CompanyVertex } from "./companies.js";
|
|
23
23
|
import { ConfigurationVertex } from "./configurations.js";
|
|
24
|
+
import { MessageVertex } from "./messages.js";
|
|
25
|
+
import { ConversationVertex } from "./conversations.js";
|
|
24
26
|
|
|
25
27
|
//#region src/core/interfaces/vertices/vertex-query.d.ts
|
|
26
28
|
type VertexRecord = {
|
|
@@ -48,6 +50,8 @@ type VertexRecord = {
|
|
|
48
50
|
companies: CompanyVertex;
|
|
49
51
|
users: UserVertex;
|
|
50
52
|
threads: ThreadVertex;
|
|
53
|
+
conversations: ConversationVertex;
|
|
54
|
+
messages: MessageVertex;
|
|
51
55
|
};
|
|
52
56
|
type BaseQueryRecord<C extends keyof VertexRecord> = VertexQuery<VertexRecord[C]>;
|
|
53
57
|
/**
|
|
@@ -105,6 +109,8 @@ declare namespace createVertexQuery {
|
|
|
105
109
|
function configuration<Q extends VertexQuery<ConfigurationVertex> & AssertNoInvalidExpandKeys<ConfigurationVertex, Q>>(query: Q): VertexQuery$1<"configurations", Q>;
|
|
106
110
|
function thread<Q extends VertexQuery<ThreadVertex> & AssertNoInvalidExpandKeys<ThreadVertex, Q>>(query: Q): VertexQuery$1<"threads", Q>;
|
|
107
111
|
function user<Q extends VertexQuery<UserVertex> & AssertNoInvalidExpandKeys<UserVertex, Q>>(query: Q): VertexQuery$1<"users", Q>;
|
|
112
|
+
function conversation<Q extends VertexQuery<ConversationVertex> & AssertNoInvalidExpandKeys<ConversationVertex, Q>>(query: Q): VertexQuery$1<"conversations", Q>;
|
|
113
|
+
function message<Q extends VertexQuery<MessageVertex> & AssertNoInvalidExpandKeys<MessageVertex, Q>>(query: Q): VertexQuery$1<"messages", Q>;
|
|
108
114
|
}
|
|
109
115
|
//#endregion
|
|
110
116
|
export { Infer, VertexQuery$1 as VertexQuery, createVertexQuery };
|
|
@@ -107,6 +107,14 @@ let createVertexQuery;
|
|
|
107
107
|
return new VertexQuery("users", query);
|
|
108
108
|
}
|
|
109
109
|
_createVertexQuery.user = user;
|
|
110
|
+
function conversation(query) {
|
|
111
|
+
return new VertexQuery("conversations", query);
|
|
112
|
+
}
|
|
113
|
+
_createVertexQuery.conversation = conversation;
|
|
114
|
+
function message(query) {
|
|
115
|
+
return new VertexQuery("messages", query);
|
|
116
|
+
}
|
|
117
|
+
_createVertexQuery.message = message;
|
|
110
118
|
})(createVertexQuery || (createVertexQuery = {}));
|
|
111
119
|
|
|
112
120
|
//#endregion
|