0eabe2084ad3adc3683a7b4a28b3832303c689a6
[motion2.git] / server / services / ami / rpc / integrations / sugarcrm.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x1a85=['serverUrl','Configurations','SugarcrmField','type','content','Variable','Descriptions','key','keyType','keyContent','variableName','name','Fields','idField','nameField','Request','GetSugarcrmAccount','password','remoteUri'];(function(_0x211660,_0x21dd85){var _0x4e1aa0=function(_0x3ceb31){while(--_0x3ceb31){_0x211660['push'](_0x211660['shift']());}};_0x4e1aa0(++_0x21dd85);}(_0x1a85,0x178));var _0x51a8=function(_0x30e675,_0x4eebc7){_0x30e675=_0x30e675-0x0;var _0x258b27=_0x1a85[_0x30e675];return _0x258b27;};'use strict';var client=require('../../client');exports['getSugarcrmAccounts']=function(){return function(_0x305f18){return client[_0x51a8('0x0')](_0x51a8('0x1'),{'options':{'raw':![],'attributes':['id','name','username',_0x51a8('0x2'),_0x51a8('0x3'),_0x51a8('0x4')],'include':[{'model':'SugarcrmConfiguration','as':_0x51a8('0x5'),'attributes':['id','name'],'include':[{'model':_0x51a8('0x6'),'as':'Subjects','attributes':['id',_0x51a8('0x7'),_0x51a8('0x8'),'variableName'],'include':[{'model':_0x51a8('0x9'),'as':'Variable','attributes':['id','name']}]},{'model':_0x51a8('0x6'),'as':_0x51a8('0xa'),'attributes':['id',_0x51a8('0x7'),_0x51a8('0x8'),_0x51a8('0xb'),_0x51a8('0xc'),_0x51a8('0xd'),_0x51a8('0xe')],'include':[{'model':_0x51a8('0x9'),'as':_0x51a8('0x9'),'attributes':['id',_0x51a8('0xf')]}]},{'model':_0x51a8('0x6'),'as':_0x51a8('0x10'),'attributes':['id',_0x51a8('0x7'),_0x51a8('0x8'),_0x51a8('0x11'),_0x51a8('0x12'),'customField',_0x51a8('0xe')],'include':[{'model':_0x51a8('0x9'),'as':_0x51a8('0x9'),'attributes':['id','name']}]}]}]},'log':_0x51a8('0x1')});};};