@inclouded/tmf-tags
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

TMF Tag Firestore SDK

npm install --save @inclouded/tmf-tags

Introduction

In the repository the Firebase Cloud Firestore SDK can be found that was made for the TMF Tag resource in an installable Angular folder form. The SDK can be installed for every Angular 2+ project. The SDK accomplishes the necessary CRUD operations.

Usage

  1. For using the SDK an Angular 2+ project is needed, in which we can establish a connection to a Firestore database instance. (configured in environments.ts)

  2. The SDK can be used in a Service in the following way:

import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { AngularFirestore } from '@angular/fire/firestore';
import { TagsApi } from '@inclouded/tmf-tags'

@Injectable()
export class TagsService {

    TagsApi: TagsApi;
    constructor(private afs: AngularFirestore) {
        this.TagsApi = new TagsApi(this.afs);
    }

    addTag(tag: any, id?: string) {
        return this.TagsApi.add(tag, id);
    }

    getAllTags() {
        return this.TagsApi.getAll();
    }

    deleteTag(tagId: string) {
        return this.TagsApi.delete(tagId);
    }

    updateTag(tag: any) {
        return this.TagsApi.update(tag);
    }

    getTagById(id: string) {
        return this.TagsApi.getById(id);
    }

    getTagsByRelatedParty(relatedParty: string, orderBy?: OrderBy, paging?: Paging) {
        return this.TagsApi.getTagsByRelatedParty(relatedParty);
    }

    getTagsByResourceSpecCharacteristic(resourceSpecCharacteristic: string, orderBy?: OrderBy, paging?: Paging) {
        return this.TagsApi.getTagsByResourceSpecCharacteristic(resourceSpecCharacteristic);
    }

    getTagsByNameSubStr(nameSubStr: string, orderBy?: OrderBy, paging?: Paging) {
        return this.TagsApi.getTagsByNameSubStr(nameSubStr);
    }
}

Developer: Zoltán R. Jánki (jankiz@inf.u-szeged.hu), Gábor Simon (simonovszkij@gmail.com)

Readme

Keywords

none

Package Sidebar

Install

npm i @inclouded/tmf-tags

Weekly Downloads

3

Version

1.0.2

License

none

Unpacked Size

835 kB

Total Files

32

Last publish

Collaborators

  • zbiacsi
  • bilickiv
  • m2m-deploy
  • jankiz
  • grindy