Contact
denzo1993@gmail.com
Description
This Angular package is used to interact with the cloud service.
The service allows you to store data in the cloud about the user, groups, authorizations and other data necessary for any site.
It is also possible to create and edit data collections, which can be of any structure.
Send notification email through our cloud service.
Cloud functions
- Authorization
- Groups and privileges
- Users
- Workspace (account settings)
- Download / Upload files
- Send email
- Create your collections with unique object structure
Install
npm i sss-core-lib --save
You can test the library in a test environment. If you want to get a private account for free, write to us denzo1993@gmail.com
Usage
Add SssCoreModule
into your app.module.ts
import { SssCoreModule } from "sss-core-lib";
@NgModule({
imports: [SssCoreModule],
})
Component example:
import { Component, OnInit } from '@angular/core';
import {
AuthService,
UserService,
IUser,
GroupService,
IGroup,
WorkspaceService,
IWorkspace,
ConfigService,
IConfig,
CollectionService,
CollectionListService,
ICollection,
NotificationService,
IEmailNotification
} from 'sss-core-lib';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.sass']
})
export class AppComponent implements OnInit {
private readonly testUsername = 'User2083';
private readonly testPassword = '123456';
private readonly emailReceiver = '';
constructor(
private authService: AuthService,
private userService: UserService,
private groupService: GroupService,
private workspaceService: WorkspaceService,
private configService: ConfigService,
private collectionService: CollectionService,
private collectionListService: CollectionListService,
private notificationService: NotificationService,
) { }
ngOnInit(): void {
this.authService.login(this.testUsername, this.testPassword).subscribe(() => {
this.workspaceService.get().subscribe((workspace: IWorkspace) => {
console.log('workspace');
console.log(workspace);
});
this.groupService.get().subscribe((groups: IGroup[]) => {
console.log('groups');
console.log(groups);
});
this.userService.get().subscribe((users: IUser[]) => {
console.log('users');
console.log(users);
});
this.configService.get().subscribe((config: IConfig) => {
console.log('config');
console.log(config);
});
this.collectionService.put<ICollection>({ name: 'cars' })
.subscribe((collection: ICollection) => {
console.log(`Collection '${collection.name}' successfully created!`);
this.collectionListService.put<ICar>({
model: 'Bentley',
color: 'black'
}, collection.name).subscribe(() => {
this.collectionListService.get(collection.name)
.subscribe((cars: ICar[]) => {
console.log(`Collection '${collection.name}' has ${cars.length} items:`);
console.log(cars);
});
});
});
this.notificationService.sendMail({
from: 'smart-site-system@yandex.ru',
to: this.emailReceiver,
subject: 'Sss-core notification test',
text: 'Hello, we are testing notifications!',
}).subscribe((result: IEmailNotification) => {
console.log(`Email sent. Info: ${result.response}`);
});
});
}
}
interface ICar {
model: string;
color: string;
}
Download example
https://github.com/denzo1993/sss-example