Built motion from commit (unavailable).|2.5.26
[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 _0xb962=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','ZendeskField,\x20%s,\x20%s','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird'];(function(_0xd3a563,_0x39ddd2){var _0x46c915=function(_0x486a1a){while(--_0x486a1a){_0xd3a563['push'](_0xd3a563['shift']());}};_0x46c915(++_0x39ddd2);}(_0xb962,0x11b));var _0x2b96=function(_0x179adc,_0x20f40e){_0x179adc=_0x179adc-0x0;var _0xfc5916=_0xb962[_0x179adc];return _0xfc5916;};'use strict';var _=require(_0x2b96('0x0'));var util=require('util');var moment=require(_0x2b96('0x1'));var BPromise=require(_0x2b96('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2b96('0x3'));var db=require(_0x2b96('0x4'))['db'];var utils=require(_0x2b96('0x5'));var logger=require('../../config/logger')(_0x2b96('0x6'));var config=require(_0x2b96('0x7'));var jayson=require(_0x2b96('0x8'));var client=jayson[_0x2b96('0x9')][_0x2b96('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25de43,_0x116f56,_0x4a59dc){return new BPromise(function(_0xcbafd9,_0x1a7fcd){return client[_0x2b96('0xb')](_0x25de43,_0x4a59dc)['then'](function(_0x19aab5){logger[_0x2b96('0xc')](_0x2b96('0xd'),_0x116f56,'request\x20sent');logger['debug'](_0x2b96('0xe'),_0x116f56,_0x2b96('0xf'),JSON[_0x2b96('0x10')](_0x19aab5));if(_0x19aab5[_0x2b96('0x11')]){if(_0x19aab5[_0x2b96('0x11')][_0x2b96('0x12')]===0x1f4){logger[_0x2b96('0x11')](_0x2b96('0xd'),_0x116f56,_0x19aab5[_0x2b96('0x11')][_0x2b96('0x13')]);return _0x1a7fcd(_0x19aab5[_0x2b96('0x11')][_0x2b96('0x13')]);}logger[_0x2b96('0x11')](_0x2b96('0xd'),_0x116f56,_0x19aab5[_0x2b96('0x11')]['message']);return _0xcbafd9(_0x19aab5['error'][_0x2b96('0x13')]);}else{logger['info'](_0x2b96('0xd'),_0x116f56,'request\x20sent');_0xcbafd9(_0x19aab5[_0x2b96('0x14')][_0x2b96('0x13')]);}})[_0x2b96('0x15')](function(_0x12874f){logger[_0x2b96('0x11')](_0x2b96('0xd'),_0x116f56,_0x12874f);_0x1a7fcd(_0x12874f);});});}