@inclouded/tmf-services
v1.0.6
Published
``` npm install --save @inclouded/tmf-services ```
Downloads
5
Keywords
Readme
TMF Service Firestore SDK
npm install --save @inclouded/tmf-services
Introduction
In the repository the Firebase Cloud Firestore SDK can be found that was made for the TMF Service 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
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)
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 { ServicesApi } from '@inclouded/tmf-services'
@Injectable()
export class ServicesService {
ServicesApi: ServicesApi;
constructor(private afs: AngularFirestore) {
this.ServicesApi = new ServicesApi(this.afs);
}
addService(service: any, id?: string) {
return this.ServicesApi.add(service, id);
}
getAllServices() {
return this.ServicesApi.getAll();
}
deleteService(serviceId: string) {
return this.ServicesApi.delete(serviceId);
}
updateService(service: any) {
return this.ServicesApi.update(service);
}
getServiceById(id: string) {
return this.ServicesApi.getById(id);
}
getServicesByRelatedParty(relatedParty: string, orderBy?: OrderBy, paging?: Paging) {
return this.ServicesApi.getServicesByRelatedParty(relatedParty);
}
getServicesByRelatedEntity(relatedEntity: string, orderBy?: OrderBy, paging?: Paging) {
return this.ServicesApi.getServicesByRelatedEntity(relatedEntity);
}
getServicesByServiceCharacteristic(serviceCharacteristic: string, orderBy?: OrderBy, paging?: Paging) {
return this.ServicesApi.getServicesByServiceCharacteristic(serviceCharacteristic);
}
getServicesByTypeAndDistributor(serviceType: string, distributorId: string, orderBy?: OrderBy, paging?: Paging) {
return this.ServicesApi.getServicesByTypeAndDistributor(serviceType, distributorId);
}
getServicesByTypeAndInstaller(serviceType: string, installerId: string, orderBy?: OrderBy, paging?: Paging) {
return this.ServicesApi.getServicesByTypeAndInstaller(serviceType, installerId);
}
getServicesByTypeAndCustomer(serviceType: string, customerId: string, orderBy?: OrderBy, paging?: Paging) {
return this.ServicesApi.getServicesByTypeAndCustomer(serviceType, customerId);
}
getServicesByTypeAndOwner(serviceType: string, ownerId: string, orderBy?: OrderBy, paging?: Paging) {
return this.ServicesApi.getServicesByTypeAndOwner(serviceType, ownerId);
}
getServicesByNameSubStr(nameSubStr: string, orderBy?: OrderBy, paging?: Paging) {
return this.ServicesApi.getServicesByNameSubStr(nameSubStr);
}
}
Developer: Zoltán R. Jánki ([email protected]), Gábor Simon ([email protected])