Renovation is available as an npm
package and can be installed using:
npm i --save @leam-tech/renovation-core
If you feel edgy or live dangerously, use the cutting-edge features of Renovation, it can be installed using
@leam-tech/renovation-core@edge
.
After the installation of the package, you can initialize by calling the .init()
.
property | type | required | description |
hostUrl | string | yes | The URL to the bench site. |
backend | RenovationBackend | no | The type of backend to be used. Defaults to "firebase". |
clientId | string | no | The client ID used for Nginx |
disableLog | boolean | no | Whether to show the logs in the console. Defaults to |
import { Renovation } from "./renovation";​const renovation = new Renovation();const backend = "frappe";const hostURL = "https://test-site.abc.com";​(async () => await renovation.init(backend, hostURL, "test-site"))();​// Start using Renovation Core....​renovation.auth.login({email: "test-user@abc.com",password: "mostcomplexpassword"}).then(response => console.log(response));​// .....
Across the SDK, functions will almost always return a RequestResponse
object as a Promise
. The structure of the class is explained below.
property | type | required |
httpCode | number | yes |
success | boolean | yes |
data |
| yes |
exc |
| no |
error |
| no |
Unless mentioned, all returns from the methods are enclosed within
<Promise<RequestResponse<T>>
whereT
is a the return type. If the Output is not as<Promise<RequestResponse<T>>>
, the Output will be marked with an asterisk (*) which means the stated Output is the actual return type.
For example, RenovationDocument
RenovationDocument
This mean that the return is actually <Promise<RequestResponse<RenovationDocument>>>
There are some methods that are either completely or partially dependent on a custom frappe app (renovation_core). When using a method/feature that requires a custom app, an error will be thrown in case the app is not installed in your site. For example:
Error: The app "renovation_core" is not installed in the backend.Please install it to be able to use the feature(s):​withLinkFieldstableFields
Throughout the guide, there will be indications when a method is completely or partially dependent on a custom frappe app.
Completely dependent: ★
Partially dependent: ☆
By default, if there are no indications, it means the method is independent of a custom frappe app.In other words, it supports Vanilla Frappé.