Built motion from commit 449495f6.|2.6.27
[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 _0x6421=['ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x1e28a9,_0x3a6fda){var _0x15d4f1=function(_0x1ba185){while(--_0x1ba185){_0x1e28a9['push'](_0x1e28a9['shift']());}};_0x15d4f1(++_0x3a6fda);}(_0x6421,0x188));var _0x1642=function(_0x40cbb0,_0x4dc8f6){_0x40cbb0=_0x40cbb0-0x0;var _0x4d3db6=_0x6421[_0x40cbb0];return _0x4d3db6;};'use strict';var _=require(_0x1642('0x0'));var util=require(_0x1642('0x1'));var moment=require(_0x1642('0x2'));var BPromise=require(_0x1642('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1642('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1642('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x1642('0x6'));var jayson=require(_0x1642('0x7'));var client=jayson[_0x1642('0x8')][_0x1642('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3146e8,_0x1d7b15,_0x3fd9e6){return new BPromise(function(_0xe1413f,_0x2cfeb6){return client[_0x1642('0xa')](_0x3146e8,_0x3fd9e6)[_0x1642('0xb')](function(_0x29c45c){logger[_0x1642('0xc')](_0x1642('0xd'),_0x1d7b15,'request\x20sent');logger[_0x1642('0xe')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x1d7b15,_0x1642('0xf'),JSON[_0x1642('0x10')](_0x29c45c));if(_0x29c45c['error']){if(_0x29c45c[_0x1642('0x11')][_0x1642('0x12')]===0x1f4){logger[_0x1642('0x11')](_0x1642('0xd'),_0x1d7b15,_0x29c45c['error'][_0x1642('0x13')]);return _0x2cfeb6(_0x29c45c[_0x1642('0x11')][_0x1642('0x13')]);}logger[_0x1642('0x11')](_0x1642('0xd'),_0x1d7b15,_0x29c45c[_0x1642('0x11')][_0x1642('0x13')]);return _0xe1413f(_0x29c45c[_0x1642('0x11')][_0x1642('0x13')]);}else{logger[_0x1642('0xc')](_0x1642('0xd'),_0x1d7b15,'request\x20sent');_0xe1413f(_0x29c45c[_0x1642('0x14')][_0x1642('0x13')]);}})[_0x1642('0x15')](function(_0x7e008f){logger[_0x1642('0x11')](_0x1642('0xd'),_0x1d7b15,_0x7e008f);_0x2cfeb6(_0x7e008f);});});}