423c970b48cc3cbdae70811ce484c3f924f9a4c8
[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 _0x8abc=['lodash','moment','bluebird','randomstring','rpc','../../config/environment','http','request','then','info','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FreshdeskField,\x20%s,\x20%s','request\x20sent','result','catch'];(function(_0x88baa1,_0x313a22){var _0x129e1b=function(_0x2f3a29){while(--_0x2f3a29){_0x88baa1['push'](_0x88baa1['shift']());}};_0x129e1b(++_0x313a22);}(_0x8abc,0xc8));var _0xc8ab=function(_0x35bb79,_0x85479d){_0x35bb79=_0x35bb79-0x0;var _0x481165=_0x8abc[_0x35bb79];return _0x481165;};'use strict';var _=require(_0xc8ab('0x0'));var util=require('util');var moment=require(_0xc8ab('0x1'));var BPromise=require(_0xc8ab('0x2'));var rs=require(_0xc8ab('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc8ab('0x4'));var config=require(_0xc8ab('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc8ab('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4b2d88,_0x27e6af,_0x2d4277){return new BPromise(function(_0x23b574,_0x1bbd57){return client[_0xc8ab('0x7')](_0x4b2d88,_0x2d4277)[_0xc8ab('0x8')](function(_0x1aebe6){logger[_0xc8ab('0x9')]('FreshdeskField,\x20%s,\x20%s',_0x27e6af,'request\x20sent');logger[_0xc8ab('0xa')](_0xc8ab('0xb'),_0x27e6af,'request\x20sent',JSON[_0xc8ab('0xc')](_0x1aebe6));if(_0x1aebe6[_0xc8ab('0xd')]){if(_0x1aebe6[_0xc8ab('0xd')][_0xc8ab('0xe')]===0x1f4){logger[_0xc8ab('0xd')]('FreshdeskField,\x20%s,\x20%s',_0x27e6af,_0x1aebe6[_0xc8ab('0xd')][_0xc8ab('0xf')]);return _0x1bbd57(_0x1aebe6[_0xc8ab('0xd')]['message']);}logger[_0xc8ab('0xd')](_0xc8ab('0x10'),_0x27e6af,_0x1aebe6[_0xc8ab('0xd')][_0xc8ab('0xf')]);return _0x23b574(_0x1aebe6[_0xc8ab('0xd')][_0xc8ab('0xf')]);}else{logger[_0xc8ab('0x9')]('FreshdeskField,\x20%s,\x20%s',_0x27e6af,_0xc8ab('0x11'));_0x23b574(_0x1aebe6[_0xc8ab('0x12')][_0xc8ab('0xf')]);}})[_0xc8ab('0x13')](function(_0x89c5a2){logger[_0xc8ab('0xd')](_0xc8ab('0x10'),_0x27e6af,_0x89c5a2);_0x1bbd57(_0x89c5a2);});});}