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 特此免費授予獲得本軟體和相關文件文件(「軟體」)副本的任何人無限制地處理本軟體,包括但不限於使用、複製、修改、合併、發布、散佈、再授權和/或出售本軟體副本的權利,並允許向本軟體提供的人員這樣做,但須滿足以下條件:
上述版權聲明和本授權聲明應包含在本軟體的所有副本或主要部分中。
本軟體以「現況」提供,不提供任何明示或暗示的保證,包括但不限於適銷性、特定用途的適用性和不侵權的保證。 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE軟體.