0.3.4 • Published 3 years ago

@inclouded/slm-sdk v0.3.4

Weekly downloads
1
License
-
Repository
-
Last release
3 years ago

Slack Leave Management Angular SDK

npm install --save @inclouded/slm-sdk

Introduction

This library contains a Firebase SDK that is compatible with projects built in Angular 2+ frameworks. This SDK achieves the basic CRUD operations.

Usage

  1. The SDK needs an Angular 2+ project in which an existing Firebase project is integrated.

  2. We recommend to call SDK methods in Angular services:

import { Injectable } from '@angular/core';
import { Event, EventApi, Request, RequestApi, User, UserApi, Holiday, HolidayApi } from '@inclouded/slm-sdk';
import { Observable } from 'rxjs';
import { AngularFirestore } from '@angular/fire/firestore';

@Injectable()
export class SLMService {

    eventApi: EventApi;
    requestApi: RequestApi;
    userApi: UserApi;
    holidayApi: HolidayApi;

    constructor(private afs: AngularFirestore) {
        this.eventApi = new EventApi(this.afs);
        this.requestApi = new RequestApi(this.afs);
        this.userApi = new UserApi(this.afs);
        this.holidayApi = new HolidayApi(this.afs);
    }

    addUser(user: User) {
        return this.userApi.add(user);
    }

    getAllUsers(): Observable<User[]> {
        return this.userApi.getAll();
    }

    addRequest(user: Request) {
        return this.requestApi.add(user);
    }

    getAllRequests(): Observable<Request[]> {
        return this.requestApi.getAll();
    }

    addEvent(user: Event) {
        return this.eventApi.add(user);
    }

    getAllEvents(): Observable<Event[]> {
        return this.eventApi.getAll();
    }

    addHoliday(holiday: Holiday) {
        return this.holidayApi.add(holiday);
    }

    getAllHolidays(): Observable<Holiday[]> {
        return this.holidayApi.getAll();
    }

}

Developer: Zoltán R. Jánki (jankiz@inf.u-szeged.hu)

0.3.4

3 years ago

0.3.3

3 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.3.0

4 years ago

0.2.5

4 years ago

0.2.4

4 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.6

4 years ago

0.0.3

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago