Built motion from commit 129fb4d95212661e48f0db455e75d668addbaddf. Version 3.0.0...
[motion-next.git] / server / api / intVtigerAccount / intVtigerAccount.rpc.js
1 const a387_0xfa05=['message','raw','VtigerAccount','attributes','findAll','debug','error','limit','stringify','info','GetVtigerAccount','where','ShowVtigerAccount','../../config/logger','map','../../mysqldb','catch','then','options','model','include','rpc'];(function(_0x27f907,_0x22efca){const _0xfa05cf=function(_0x20aeed){while(--_0x20aeed){_0x27f907['push'](_0x27f907['shift']());}};_0xfa05cf(++_0x22efca);}(a387_0xfa05,0x150));const a387_0x20ae=function(_0x27f907,_0x22efca){_0x27f907=_0x27f907-0x6b;let _0xfa05cf=a387_0xfa05[_0x27f907];return _0xfa05cf;};const a387_0x107506=a387_0x20ae;'use strict';const _=require('lodash'),db=require(a387_0x107506(0x74))['db'],logger=require(a387_0x107506(0x72))(a387_0x107506(0x7a));exports['GetVtigerAccount']=function(_0x151a28){const _0x3fab59=this;return new Promise(function(_0x539710,_0x56a643){const _0x4ce056=a387_0x20ae;return db[_0x4ce056(0x7d)][_0x4ce056(0x7f)]({'raw':_0x151a28[_0x4ce056(0x77)]?_0x151a28['options'][_0x4ce056(0x7c)]===undefined?!![]:![]:!![],'where':_0x151a28[_0x4ce056(0x77)]?_0x151a28[_0x4ce056(0x77)][_0x4ce056(0x70)]||null:null,'attributes':_0x151a28[_0x4ce056(0x77)]?_0x151a28['options'][_0x4ce056(0x7e)]||null:null,'limit':_0x151a28[_0x4ce056(0x77)]?_0x151a28[_0x4ce056(0x77)][_0x4ce056(0x6c)]||null:null,'include':_0x151a28['options']?_0x151a28['options'][_0x4ce056(0x79)]?_[_0x4ce056(0x73)](_0x151a28[_0x4ce056(0x77)][_0x4ce056(0x79)],function(_0x20f087){const _0x3e7621=_0x4ce056;return{'model':db[_0x20f087[_0x3e7621(0x78)]],'as':_0x20f087['as'],'attributes':_0x20f087[_0x3e7621(0x7e)],'include':_0x20f087[_0x3e7621(0x79)]?_[_0x3e7621(0x73)](_0x20f087[_0x3e7621(0x79)],function(_0x149f95){const _0xfb5701=_0x3e7621;return{'model':db[_0x149f95[_0xfb5701(0x78)]],'as':_0x149f95['as'],'attributes':_0x149f95[_0xfb5701(0x7e)],'include':_0x149f95[_0xfb5701(0x79)]?_[_0xfb5701(0x73)](_0x149f95['include'],function(_0x233bc4){const _0x16a5a0=_0xfb5701;return{'model':db[_0x233bc4[_0x16a5a0(0x78)]],'as':_0x233bc4['as'],'attributes':_0x233bc4[_0x16a5a0(0x7e)]};}):[]};}):[]};}):[]:[]})[_0x4ce056(0x76)](function(_0x1c8116){const _0x492439=_0x4ce056;logger['info'](_0x492439(0x6f),_0x151a28),logger[_0x492439(0x80)](_0x492439(0x6f),_0x151a28,JSON[_0x492439(0x6d)](_0x1c8116)),_0x539710(_0x1c8116);})[_0x4ce056(0x75)](function(_0x41ce89){const _0x174646=_0x4ce056;logger[_0x174646(0x6b)](_0x174646(0x6f),_0x41ce89[_0x174646(0x7b)],_0x151a28),_0x56a643(_0x3fab59[_0x174646(0x6b)](0x1f4,_0x41ce89['message']));});});},exports[a387_0x107506(0x71)]=function(_0x4248b6){const _0x1fabca=this;return new Promise(function(_0x372604,_0x1805f9){const _0x1f5996=a387_0x20ae;return db['VtigerAccount']['findOne']({'raw':_0x4248b6[_0x1f5996(0x77)]?_0x4248b6[_0x1f5996(0x77)][_0x1f5996(0x7c)]===undefined?!![]:![]:!![],'where':_0x4248b6[_0x1f5996(0x77)]?_0x4248b6[_0x1f5996(0x77)]['where']||null:null,'attributes':_0x4248b6[_0x1f5996(0x77)]?_0x4248b6[_0x1f5996(0x77)][_0x1f5996(0x7e)]||null:null,'include':_0x4248b6['options']?_0x4248b6['options'][_0x1f5996(0x79)]?_['map'](_0x4248b6[_0x1f5996(0x77)][_0x1f5996(0x79)],function(_0x4b74de){const _0x5bb2e7=_0x1f5996;return{'model':db[_0x4b74de[_0x5bb2e7(0x78)]],'as':_0x4b74de['as'],'attributes':_0x4b74de['attributes'],'include':_0x4b74de[_0x5bb2e7(0x79)]?_['map'](_0x4b74de[_0x5bb2e7(0x79)],function(_0x26d948){const _0x40a65a=_0x5bb2e7;return{'model':db[_0x26d948['model']],'as':_0x26d948['as'],'attributes':_0x26d948['attributes'],'include':_0x26d948[_0x40a65a(0x79)]?_[_0x40a65a(0x73)](_0x26d948['include'],function(_0x21c13d){const _0x35eb04=_0x40a65a;return{'model':db[_0x21c13d[_0x35eb04(0x78)]],'as':_0x21c13d['as'],'attributes':_0x21c13d[_0x35eb04(0x7e)]};}):[]};}):[]};}):[]:[]})[_0x1f5996(0x76)](function(_0x3ef405){const _0x1d940d=_0x1f5996;logger[_0x1d940d(0x6e)]('ShowVtigerAccount',_0x4248b6),logger[_0x1d940d(0x80)](_0x1d940d(0x71),_0x4248b6,JSON['stringify'](_0x3ef405)),_0x372604(_0x3ef405);})[_0x1f5996(0x75)](function(_0x25dba6){const _0x533ea5=_0x1f5996;logger['error'](_0x533ea5(0x71),_0x25dba6[_0x533ea5(0x7b)],_0x4248b6),_0x1805f9(_0x1fabca[_0x533ea5(0x6b)](0x1f4,_0x25dba6[_0x533ea5(0x7b)]));});});};