npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ggtu-timetable-api-client

v3.1.0

Published

This library is meat to be used as an API client for [GGTU](http://ggtu.ru/) Timetable API. You don't need any authorization to use read-only methods, because the data they provide is publicly accessible. ## Installation ``` $ npm i ``` ## Usage ```jav

Downloads

16

Readme

GGTU Timetable API Client

This library is meat to be used as an API client for GGTU Timetable API. You don't need any authorization to use read-only methods, because the data they provide is publicly accessible.

Installation

$ npm i  

Usage

import ApiClient from 'ggtu-timetable-api-client';
const config = {
    baseURL: '<api_url_here>',
}
const api = new ApiClient(config);
// use the api

Endpoints

All entrypoints extend from the Endpoint template class except the AuthEndpoint.

  • getAll;
  • create;
  • get;
  • update;
  • delete.
declare class Endpoint<T> {
    protected axios: AxiosInstance;
    protected route: string;
    constructor(axios: AxiosInstance, route: string);
    getAll(): Promise<WithId<T>[]>;
    get(id: number): Promise<WithId<T>>;
    delete(id: number): Promise<number>;
    update(id: number, data: Partial<T>): Promise<WithId<T>>;
    create(data: T): Promise<WithId<T>>;
}

Auth

declare class AuthEndpoint {
    private _api;
    protected route: string;
    protected accessToken: string;
    protected refreshToken: string;
    user: User | null; 
    constructor(_api: AxiosInstance);
    login(username: string, password: string): Promise<string>;
    logout(): void;
    getProfile(): Promise<User>; 
    refresh(): Promise<void>;
    private setCredentials;
}

Also, there is a TimetableEndpoint class which is extended by RegularTimetableEndpoint and PatchesEndpoint.

declare class TimetableEndpoint<T> extends Endpoint<T> {
    getForCabinet(cabinetId: number): Promise<T[]>;
    getForCabinetByWeek(cabinetId: number, week: Week): Promise<T[]>;
    getForGroup(groupId: number): Promise<T[]>;
    getForGroupByWeek(groupId: number, week: Week): Promise<T[]>;
    getForSubject(subjectId: number): Promise<T[]>;
    getForSubjectByWeek(subjectId: number, week: Week): Promise<T[]>;
    getForTeacher(teacherId: number): Promise<T[]>;
    getForTeacherByWeek(teacherId: number, week: Week): Promise<T[]>;
}