Built motion from commit (unavailable).|2.5.23
[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 _0xcaa3=['lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http','then','ZendeskField,\x20%s,\x20%s','debug','ZendeskField,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result'];(function(_0x3cac61,_0x28a1dd){var _0x37ec71=function(_0x46d817){while(--_0x46d817){_0x3cac61['push'](_0x3cac61['shift']());}};_0x37ec71(++_0x28a1dd);}(_0xcaa3,0xee));var _0x3caa=function(_0x330141,_0x1dd290){_0x330141=_0x330141-0x0;var _0x1b68a2=_0xcaa3[_0x330141];return _0x1b68a2;};'use strict';var _=require(_0x3caa('0x0'));var util=require('util');var moment=require(_0x3caa('0x1'));var BPromise=require('bluebird');var rs=require(_0x3caa('0x2'));var fs=require('fs');var Redis=require(_0x3caa('0x3'));var db=require(_0x3caa('0x4'))['db'];var utils=require(_0x3caa('0x5'));var logger=require('../../config/logger')(_0x3caa('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x3caa('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3517de,_0x34e469,_0x27a19c){return new BPromise(function(_0x37411b,_0x5cfc84){return client['request'](_0x3517de,_0x27a19c)[_0x3caa('0x8')](function(_0x1e5b01){logger['info'](_0x3caa('0x9'),_0x34e469,'request\x20sent');logger[_0x3caa('0xa')](_0x3caa('0xb'),_0x34e469,'request\x20sent',JSON['stringify'](_0x1e5b01));if(_0x1e5b01['error']){if(_0x1e5b01[_0x3caa('0xc')][_0x3caa('0xd')]===0x1f4){logger[_0x3caa('0xc')](_0x3caa('0x9'),_0x34e469,_0x1e5b01['error'][_0x3caa('0xe')]);return _0x5cfc84(_0x1e5b01[_0x3caa('0xc')][_0x3caa('0xe')]);}logger['error'](_0x3caa('0x9'),_0x34e469,_0x1e5b01[_0x3caa('0xc')][_0x3caa('0xe')]);return _0x37411b(_0x1e5b01['error'][_0x3caa('0xe')]);}else{logger['info'](_0x3caa('0x9'),_0x34e469,_0x3caa('0xf'));_0x37411b(_0x1e5b01[_0x3caa('0x10')][_0x3caa('0xe')]);}})['catch'](function(_0x49093f){logger[_0x3caa('0xc')](_0x3caa('0x9'),_0x34e469,_0x49093f);_0x5cfc84(_0x49093f);});});}