-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from OneLiL05/feature
release: 0.2.3
- Loading branch information
Showing
8 changed files
with
40 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,21 @@ | ||
import { IRawSchedule, ISchedule } from "../index.js"; | ||
import { IRawSchedule, ISchedule } from "../types/index.js"; | ||
import { transformTeachers } from "./teachers.helper.js"; | ||
|
||
export function transformSchedule(rawSchedule: IRawSchedule[]): ISchedule[] { | ||
return rawSchedule.map((rawSchedule) => { | ||
const { end_time, start_time, teachers, number_pair, auditory, ...rest } = | ||
rawSchedule; | ||
const transformedSchedule: ISchedule[] = []; | ||
|
||
return { | ||
for (let subject of rawSchedule) { | ||
const { end_time, start_time, teachers, number_pair, auditory, ...rest } = subject; | ||
|
||
transformedSchedule.push({ | ||
...rest, | ||
endTime: end_time, | ||
startTime: start_time, | ||
teachers: transformTeachers(teachers), | ||
numberPair: number_pair, | ||
auditorium: auditory, | ||
}; | ||
}); | ||
}); | ||
} | ||
|
||
return transformedSchedule; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
import { IRawTeacher, ITeacher } from "../types/index.js"; | ||
|
||
function transformTeachers(rawTeachers: IRawTeacher[]): ITeacher[] { | ||
return rawTeachers.map((teacher) => { | ||
return { | ||
const transformedTeachers: ITeacher[] = [] | ||
|
||
for (let teacher of rawTeachers) { | ||
transformedTeachers.push({ | ||
id: teacher.id, | ||
fullName: teacher.full_name, | ||
shortName: teacher.short_name, | ||
}; | ||
}); | ||
}) | ||
} | ||
|
||
return transformedTeachers; | ||
} | ||
|
||
export { transformTeachers }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,12 @@ | ||
import { Nurekit } from "./client.js"; | ||
|
||
export * from "./client.js"; | ||
export * from "./types/index.js"; | ||
export { IAuditorium, IGroup, ISchedule, ISubject, ITeacher } from "./types/index.js"; | ||
|
||
const nurekit = new Nurekit() | ||
|
||
console.log(await nurekit.groups.getSchedule({ | ||
groupName: "пзпі-23-5", | ||
startTime: "2023-09-22", | ||
endTime: "2023-09-23" | ||
})) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
"outDir": "dist", | ||
"strict": true, | ||
"strictNullChecks": true, | ||
"skipLibCheck": true | ||
}, | ||
"include": ["src"] | ||
} |