Built motion from commit eddce310.|2.6.12
[motion2.git] / server / api / intFreshdeskField / intFreshdeskField.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 _0xea9f=['error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','then','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x55e2e7,_0x3d7ffb){var _0x2ca98a=function(_0x499090){while(--_0x499090){_0x55e2e7['push'](_0x55e2e7['shift']());}};_0x2ca98a(++_0x3d7ffb);}(_0xea9f,0x15f));var _0xfea9=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xea9f[_0x68c979];return _0x4f0001;};'use strict';var _=require(_0xfea9('0x0'));var util=require(_0xfea9('0x1'));var moment=require(_0xfea9('0x2'));var BPromise=require(_0xfea9('0x3'));var rs=require(_0xfea9('0x4'));var fs=require('fs');var Redis=require(_0xfea9('0x5'));var db=require(_0xfea9('0x6'))['db'];var utils=require(_0xfea9('0x7'));var logger=require(_0xfea9('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xfea9('0x9'));var client=jayson[_0xfea9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb3334,_0x5b91ce,_0x3623f1){return new BPromise(function(_0x52ded,_0x1c421f){return client['request'](_0xb3334,_0x3623f1)[_0xfea9('0xb')](function(_0x50735f){logger['info'](_0xfea9('0xc'),_0x5b91ce,_0xfea9('0xd'));logger[_0xfea9('0xe')](_0xfea9('0xf'),_0x5b91ce,_0xfea9('0xd'),JSON[_0xfea9('0x10')](_0x50735f));if(_0x50735f[_0xfea9('0x11')]){if(_0x50735f[_0xfea9('0x11')][_0xfea9('0x12')]===0x1f4){logger[_0xfea9('0x11')](_0xfea9('0xc'),_0x5b91ce,_0x50735f[_0xfea9('0x11')][_0xfea9('0x13')]);return _0x1c421f(_0x50735f[_0xfea9('0x11')]['message']);}logger[_0xfea9('0x11')](_0xfea9('0xc'),_0x5b91ce,_0x50735f[_0xfea9('0x11')][_0xfea9('0x13')]);return _0x52ded(_0x50735f[_0xfea9('0x11')][_0xfea9('0x13')]);}else{logger[_0xfea9('0x14')](_0xfea9('0xc'),_0x5b91ce,_0xfea9('0xd'));_0x52ded(_0x50735f[_0xfea9('0x15')][_0xfea9('0x13')]);}})[_0xfea9('0x16')](function(_0x51d08a){logger[_0xfea9('0x11')](_0xfea9('0xc'),_0x5b91ce,_0x51d08a);_0x1c421f(_0x51d08a);});});}