cb41210ea6520b5f3a0a714a0cc5b53e023a1fb6
[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 _0x2bfa=['client','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','jayson/promise'];(function(_0x1c6b57,_0x1cf4cd){var _0x3fbb5d=function(_0x42b840){while(--_0x42b840){_0x1c6b57['push'](_0x1c6b57['shift']());}};_0x3fbb5d(++_0x1cf4cd);}(_0x2bfa,0x160));var _0xa2bf=function(_0x231a2e,_0x4dd1d6){_0x231a2e=_0x231a2e-0x0;var _0x1db307=_0x2bfa[_0x231a2e];return _0x1db307;};'use strict';var _=require(_0xa2bf('0x0'));var util=require(_0xa2bf('0x1'));var moment=require(_0xa2bf('0x2'));var BPromise=require(_0xa2bf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa2bf('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa2bf('0x5'));var logger=require(_0xa2bf('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa2bf('0x7'));var client=jayson[_0xa2bf('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f4269,_0x47d6a8,_0x5433c6){return new BPromise(function(_0x38b167,_0xb1733f){return client[_0xa2bf('0x9')](_0x1f4269,_0x5433c6)[_0xa2bf('0xa')](function(_0x1b1886){logger[_0xa2bf('0xb')](_0xa2bf('0xc'),_0x47d6a8,_0xa2bf('0xd'));logger['debug'](_0xa2bf('0xe'),_0x47d6a8,'request\x20sent',JSON[_0xa2bf('0xf')](_0x1b1886));if(_0x1b1886[_0xa2bf('0x10')]){if(_0x1b1886[_0xa2bf('0x10')][_0xa2bf('0x11')]===0x1f4){logger[_0xa2bf('0x10')](_0xa2bf('0xc'),_0x47d6a8,_0x1b1886[_0xa2bf('0x10')][_0xa2bf('0x12')]);return _0xb1733f(_0x1b1886[_0xa2bf('0x10')][_0xa2bf('0x12')]);}logger[_0xa2bf('0x10')](_0xa2bf('0xc'),_0x47d6a8,_0x1b1886[_0xa2bf('0x10')][_0xa2bf('0x12')]);return _0x38b167(_0x1b1886['error'][_0xa2bf('0x12')]);}else{logger[_0xa2bf('0xb')](_0xa2bf('0xc'),_0x47d6a8,_0xa2bf('0xd'));_0x38b167(_0x1b1886['result'][_0xa2bf('0x12')]);}})[_0xa2bf('0x13')](function(_0x2a6e5d){logger['error'](_0xa2bf('0xc'),_0x47d6a8,_0x2a6e5d);_0xb1733f(_0x2a6e5d);});});}