Built motion from commit (unavailable).|2.5.0
[motion2.git] / server / api / intZendeskField / intZendeskField.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 _0x5bce=['stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','http','request','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s'];(function(_0x3ceb54,_0x5bddfd){var _0x26d8a6=function(_0x32e484){while(--_0x32e484){_0x3ceb54['push'](_0x3ceb54['shift']());}};_0x26d8a6(++_0x5bddfd);}(_0x5bce,0x159));var _0xe5bc=function(_0x45518f,_0x475a6b){_0x45518f=_0x45518f-0x0;var _0x198175=_0x5bce[_0x45518f];return _0x198175;};'use strict';var _=require(_0xe5bc('0x0'));var util=require(_0xe5bc('0x1'));var moment=require('moment');var BPromise=require(_0xe5bc('0x2'));var rs=require(_0xe5bc('0x3'));var fs=require('fs');var Redis=require(_0xe5bc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe5bc('0x5'));var logger=require('../../config/logger')(_0xe5bc('0x6'));var config=require(_0xe5bc('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe5bc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53b0eb,_0x415195,_0x452993){return new BPromise(function(_0x2c719c,_0x498836){return client[_0xe5bc('0x9')](_0x53b0eb,_0x452993)['then'](function(_0x235190){logger[_0xe5bc('0xa')](_0xe5bc('0xb'),_0x415195,_0xe5bc('0xc'));logger[_0xe5bc('0xd')](_0xe5bc('0xe'),_0x415195,_0xe5bc('0xc'),JSON[_0xe5bc('0xf')](_0x235190));if(_0x235190[_0xe5bc('0x10')]){if(_0x235190[_0xe5bc('0x10')][_0xe5bc('0x11')]===0x1f4){logger[_0xe5bc('0x10')](_0xe5bc('0xb'),_0x415195,_0x235190['error']['message']);return _0x498836(_0x235190['error']['message']);}logger[_0xe5bc('0x10')]('ZendeskField,\x20%s,\x20%s',_0x415195,_0x235190[_0xe5bc('0x10')][_0xe5bc('0x12')]);return _0x2c719c(_0x235190[_0xe5bc('0x10')][_0xe5bc('0x12')]);}else{logger[_0xe5bc('0xa')]('ZendeskField,\x20%s,\x20%s',_0x415195,'request\x20sent');_0x2c719c(_0x235190[_0xe5bc('0x13')][_0xe5bc('0x12')]);}})['catch'](function(_0x2038ec){logger[_0xe5bc('0x10')](_0xe5bc('0xb'),_0x415195,_0x2038ec);_0x498836(_0x2038ec);});});}