2018-01-16 11:39:17 +05:30
|
|
|
const common = require('frappejs/common');
|
|
|
|
const RESTClient = require('frappejs/backends/rest_client');
|
|
|
|
const frappe = require('frappejs');
|
2018-01-12 17:55:07 +05:30
|
|
|
frappe.ui = require('./ui');
|
|
|
|
const Desk = require('./desk');
|
|
|
|
|
|
|
|
module.exports = {
|
2018-01-16 12:19:38 +05:30
|
|
|
async start({server}) {
|
2018-01-12 17:55:07 +05:30
|
|
|
window.frappe = frappe;
|
|
|
|
frappe.init();
|
|
|
|
common.init_libs(frappe);
|
|
|
|
|
|
|
|
frappe.fetch = window.fetch.bind();
|
2018-01-15 17:25:31 +05:30
|
|
|
frappe.db = await new RESTClient({server: server});
|
|
|
|
|
|
|
|
frappe.flags.cache_docs = true;
|
2018-01-12 17:55:07 +05:30
|
|
|
|
|
|
|
frappe.desk = new Desk();
|
|
|
|
await frappe.login();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|