Built motion from commit (unavailable).|2.3.7
[motion2.git] / server / api / intSugarcrmField / intSugarcrmField.rpc.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 _0x847e=['../../config/environment','jayson/promise','client','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xefd32c,_0x1baea7){var _0x523775=function(_0x1ed4fe){while(--_0x1ed4fe){_0xefd32c['push'](_0xefd32c['shift']());}};_0x523775(++_0x1baea7);}(_0x847e,0x9f));var _0xe847=function(_0x271422,_0x36413b){_0x271422=_0x271422-0x0;var _0x21baae=_0x847e[_0x271422];return _0x21baae;};'use strict';var _=require(_0xe847('0x0'));var util=require(_0xe847('0x1'));var moment=require(_0xe847('0x2'));var BPromise=require(_0xe847('0x3'));var rs=require(_0xe847('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe847('0x5'))['db'];var utils=require(_0xe847('0x6'));var logger=require(_0xe847('0x7'))(_0xe847('0x8'));var config=require(_0xe847('0x9'));var jayson=require(_0xe847('0xa'));var client=jayson[_0xe847('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x11f301,_0x511ba2,_0x220063){return new BPromise(function(_0x25c84b,_0x2f1eb4){return client[_0xe847('0xc')](_0x11f301,_0x220063)[_0xe847('0xd')](function(_0x4bc0b4){logger[_0xe847('0xe')](_0xe847('0xf'),_0x511ba2,_0xe847('0x10'));logger[_0xe847('0x11')](_0xe847('0x12'),_0x511ba2,_0xe847('0x10'),JSON['stringify'](_0x4bc0b4));if(_0x4bc0b4[_0xe847('0x13')]){if(_0x4bc0b4[_0xe847('0x13')][_0xe847('0x14')]===0x1f4){logger[_0xe847('0x13')](_0xe847('0xf'),_0x511ba2,_0x4bc0b4['error'][_0xe847('0x15')]);return _0x2f1eb4(_0x4bc0b4[_0xe847('0x13')][_0xe847('0x15')]);}logger[_0xe847('0x13')](_0xe847('0xf'),_0x511ba2,_0x4bc0b4[_0xe847('0x13')][_0xe847('0x15')]);return _0x25c84b(_0x4bc0b4[_0xe847('0x13')][_0xe847('0x15')]);}else{logger['info'](_0xe847('0xf'),_0x511ba2,_0xe847('0x10'));_0x25c84b(_0x4bc0b4[_0xe847('0x16')][_0xe847('0x15')]);}})[_0xe847('0x17')](function(_0x258a57){logger[_0xe847('0x13')](_0xe847('0xf'),_0x511ba2,_0x258a57);_0x2f1eb4(_0x258a57);});});}