test-fer-ch-test
v0.1.1
Published
Npm package to manage client interactions with the Perfecta cluster. Use it to fetch, post and modify perfecta data, all while automatically updating your UI.
Downloads
2
Readme
Introduction to Perfecta React
Perfecta React is an npm package to manage client interactions with the Perfecta Cluster. Use it to fetch, post, and modify perfecta data, all while automatically updating your UI. (incomplete)
Features
Create, read, update, and delete multiple Perfecta Knowledge Bases (incomplete)
Install
$ npm i perfecta-react
Usage
import Perfecta from 'perfect-react';
perfecta = new Perfecta({
url: 'http://localhost:8000'
});
perfecta
.info()
.then(res => {
console.log(res)
})
// {
// "title": "Perfecta Service",
// "description": "Provides API that supports Perfecta requests, KB operations and more.",
// "version": {
// "api": "0.1.0",
// "perfecta_client": "4.0.0",
// "perfecta_cluster": "1.0.2",
// "perfecta": "8.012",
// "mongodb": "5.0.3"
// }
// }
perfecta
.kbs({
showArchived: true
})
.then(res => {
console.log(res)
})
[
// {
// "user_id": "admin",
// "name": "My KB 01",
// "description": "Example used for the OpenAPI documentation",
// "created": "2022-02-02T15:31:03.115307-08:00",
// "updated": "2022-02-02T15:33:28.605183-08:00",
// "archived": true
// },
// {
// "user_id": "[email protected]",
// "name": "My KB 02",
// "description": "Example used for the OpenAPI documentation",
// "created": "2022-02-02T15:31:03.115307-08:00",
// "updated": "2022-02-02T15:33:28.605183-08:00",
// "archived": false
// }
// ]
perfecta
.kbs({
userId: "[email protected]",
showArchived: false
})
.then(res => {
console.log(res)
})
[
// {
// "user_id": "[email protected]",
// "name": "My KB 02",
// "description": "Example used for the OpenAPI documentation",
// "created": "2022-02-02T15:31:03.115307-08:00",
// "updated": "2022-02-02T15:33:28.605183-08:00",
// "archived": false
// }
// ]