librus api
1.0.0
Otwartoźródłowy 客户端 HTTP 解析和 HTML 服务支持 Librus / Synergia。 Paczka nie jest oficjalnym produktem Synergia。
npm install librus-api
"use strict" ;
const Librus = require ( "librus-api" ) ;
let client = new Librus ( ) ;
client . authorize ( "login" , "pass" ) . then ( function ( ) {
// Send message to User 648158
client . inbox . sendMessage ( 648158 , "title" , "body" ) . then (
( ) => {
/** sucess */
} ,
( ) => {
/** fail **/
}
) ;
// Remove message with id 4534535
client . inbox . removeMessage ( 4534535 ) . then (
( ) => {
/** sucess */
} ,
( ) => {
/** fail **/
}
) ;
// List receivers
client . inbox . listReceivers ( "nauczyciel" ) . then ( ( data ) => { } ) ;
// List announcements
client . inbox . listAnnouncements ( ) . then ( ( data ) => { } ) ;
// List all e-mails in folder(5) in page(2)
client . inbox . listInbox ( 5 ) . then ( ( data ) => { } ) ;
// Get message with id 2133726 in folder 6
client . inbox . getMessage ( 6 , 2133726 ) . then ( ( data ) => { } ) ;
// Get attachments from message with id 181186 in folder 5
client . inbox . getMessage ( 5 , 181186 ) . then ( ( data ) => {
for ( let f of data . files ) {
client . inbox
. getFile ( f . path )
. then ( ( response ) => response . pipe ( fs . createWriteStream ( f . name ) ) ) ;
}
} ) ;
// List all subjects
client . homework . listSubjects ( ) . then ( ( data ) => { } ) ;
// List subject homeworks, -1||undefined all
client . homework . listHomework ( 24374 ) . then ( ( list ) => { } ) ;
// Download homework description
client . homework . getHomework ( 257478 ) . then ( ( data ) => { } ) ;
// Get all absences
client . absence . getAbsences ( ) . then ( ( data ) => { } ) ;
// Get info about absence
client . absence . getAbsence ( 5068489 ) . then ( ( data ) => { } ) ;
// Get timetable
client . calendar . getTimetable ( ) . then ( ( data ) => { } ) ;
// Get calendar
client . calendar . getCalendar ( ) . then ( ( data ) => { } ) ;
// Get event
client . calendar . getEvent ( 4242342 ) . then ( ( data ) => { } ) ;
// Get grades
client . info . getGrades ( ) . then ( ( data ) => { } ) ;
// Get grade
client . info . getGrade ( 23424234 ) . then ( ( data ) => { } ) ;
// Get scoring grade
client . info . getPointGrade ( 234242234 ) . then ( ( data ) => { } ) ;
// Get name, surname and other account info
client . info . getAccountInfo ( ) ;
// Get lucky number
client . info . getLuckyNumber ( ) . then ( ( data ) => { } ) ;
// Get notifications
client . info . getNotifications ( ) . then ( ( data ) => { } ) ;
} ) ;
麻省理工学院许可证 (MIT)
版权所有 (c) 2023/2024 Mateusz Bagiński 特此免费授予获得本软件和相关文档文件(“软件”)副本的任何人无限制地处理本软件,包括但不限于使用、复制、修改、合并、发布、分发、再许可和/或出售本软件副本的权利,并允许向本软件提供的人员这样做,但须满足以下条件:
上述版权声明和本许可声明应包含在本软件的所有副本或主要部分中。
本软件按“原样”提供,不提供任何明示或暗示的保证,包括但不限于适销性、特定用途的适用性和不侵权的保证。在任何情况下,作者或版权持有者均不对因本软件或本软件的使用或其他交易而引起的或与之相关的任何索赔、损害或其他责任负责,无论是合同、侵权还是其他行为。软件。