0.1.34 • Published 2 years ago
smart-rooster v0.1.34
Smart Rooster SDK
URL's
- PRE:
https://preback.smartroosterbureau.us
- PRO:
https://back.smartroosterbureau.us
Init
this.sm = new SmartRoosterApi({
private_key: 'your-token',
public_key: 'your-token',
url: 'url-api',
});
Functions
Function | parameters | code | description |
---|---|---|---|
getAccess | 200,500 | Verificar acceso | |
getSale | IConfigSAle | 200,500 | Listado de ejemplares en venta |
getSaleDetails | IConfigApiDetails | 200,500 | Detalle del ejemplar en venta por uid |
getPublic | IConfigPublic | 200,500 | Listado de ejemplares publicos para web |
getPublicDetails | IConfigApiDetails | 200,500 | Detalle del ejemplar publico por uid |
getCategoriesSpecimens | 200,500 | Lista de categorias de ejemplares | |
reservedSpecimen | IReservedSpecimen | 200,500 | Reservar un ejemplar en venta por uid |
Interfaces
Parameters
export interface IConfigSAle {
perpage: number;
page: number;
}
export interface IConfigPublic {
perpage: number;
page: number;
category_id: number;
}
export interface IConfigApiDetails {
specimen_id: string;
}
export interface IReservedSpecimen {
specimen_id: string;
}
Example NEST
import { Controller, Get } from '@nestjs/common';
import { AppService } from './app.service';
import { SmartRoosterApi } from 'smart-rooster';
@Controller()
export class AppController {
constructor(
private readonly appService: AppService,
private sm: SmartRoosterApi
) {
this.sm = new SmartRoosterApi({
private_key: 'your-token',
public_key: 'your-token',
url: 'url-api',
});
}
@Get()
getHello(): string {
return this.appService.getHello();
}
@Get('/get-access')
getAccess() {
return this.sm.getAccess();
}
@Get('/get-categories-specimens')
getCategoriesSpecimens() {
return this.sm.getCategoriesSpecimens();
}
@Get('/get-public')
getPublic() {
return this.sm.getPublic({
category_id: 1,
page: 1,
perpage: 10,
});
}
@Get('/get-public-details')
getPublicDetails() {
return this.sm.getPublicDetails({
specimen_id: 'b0783efd-b7b5-11ed-8ba5-166fd1880ae7',
});
}
@Get('/get-sale')
getSale() {
return this.sm.getSale({
page: 1,
perpage: 10,
});
}
@Get('/get-sale-details')
getSaleDetails() {
return this.sm.getSaleDetails({
specimen_id: 'b0783efd-b7b5-11ed-8ba5-166fd1880ae7',
});
}
@Get('/reserved-specimen')
reservedSpecimen() {
return this.sm.reservedSpecimen({
specimen_id: 'b0783efd-b7b5-11ed-8ba5-166fd1880ae7',
});
}
}
Repo
https://github.com/jacksari/nest-sm-example
0.1.34
2 years ago
0.1.33
2 years ago
0.1.32
2 years ago
0.1.30
2 years ago
0.1.28
2 years ago
0.1.27
2 years ago
0.1.26
2 years ago
0.1.24
2 years ago
0.1.23
2 years ago
0.1.22
2 years ago
0.1.21
2 years ago
0.1.19
2 years ago
0.1.18
2 years ago
0.1.17
2 years ago
0.1.16
2 years ago
0.1.15
2 years ago
0.1.14
2 years ago
0.1.13
2 years ago
0.1.12
2 years ago
0.1.11
2 years ago
0.1.10
2 years ago
0.1.9
2 years ago
0.1.8
2 years ago
0.1.7
2 years ago
0.1.6
2 years ago
0.1.5
2 years ago
0.1.4
2 years ago
0.1.2
2 years ago
0.1.1
2 years ago
0.1.0
2 years ago