36dbcfa667e9de51f8a79131a2e6d7c3144be87c
[motion2.git] / server / api / intZendeskConfiguration / intZendeskConfiguration.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 _0xc544=['jayson/promise','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x2290d4,_0x43d284){var _0x1f68ee=function(_0x129a8b){while(--_0x129a8b){_0x2290d4['push'](_0x2290d4['shift']());}};_0x1f68ee(++_0x43d284);}(_0xc544,0x6a));var _0x4c54=function(_0x4e98a2,_0x13e8aa){_0x4e98a2=_0x4e98a2-0x0;var _0x2f2338=_0xc544[_0x4e98a2];return _0x2f2338;};'use strict';var _=require(_0x4c54('0x0'));var util=require('util');var moment=require(_0x4c54('0x1'));var BPromise=require(_0x4c54('0x2'));var rs=require(_0x4c54('0x3'));var fs=require('fs');var Redis=require(_0x4c54('0x4'));var db=require(_0x4c54('0x5'))['db'];var utils=require(_0x4c54('0x6'));var logger=require('../../config/logger')(_0x4c54('0x7'));var config=require(_0x4c54('0x8'));var jayson=require(_0x4c54('0x9'));var client=jayson[_0x4c54('0xa')][_0x4c54('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5129a4,_0x4d666e,_0x2cae58){return new BPromise(function(_0x2cf071,_0x142365){return client[_0x4c54('0xc')](_0x5129a4,_0x2cae58)[_0x4c54('0xd')](function(_0x440e12){logger[_0x4c54('0xe')](_0x4c54('0xf'),_0x4d666e,'request\x20sent');logger['debug'](_0x4c54('0x10'),_0x4d666e,_0x4c54('0x11'),JSON[_0x4c54('0x12')](_0x440e12));if(_0x440e12[_0x4c54('0x13')]){if(_0x440e12[_0x4c54('0x13')][_0x4c54('0x14')]===0x1f4){logger[_0x4c54('0x13')]('ZendeskConfiguration,\x20%s,\x20%s',_0x4d666e,_0x440e12[_0x4c54('0x13')][_0x4c54('0x15')]);return _0x142365(_0x440e12[_0x4c54('0x13')][_0x4c54('0x15')]);}logger[_0x4c54('0x13')](_0x4c54('0xf'),_0x4d666e,_0x440e12[_0x4c54('0x13')]['message']);return _0x2cf071(_0x440e12[_0x4c54('0x13')][_0x4c54('0x15')]);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x4d666e,'request\x20sent');_0x2cf071(_0x440e12['result'][_0x4c54('0x15')]);}})[_0x4c54('0x16')](function(_0x35e247){logger[_0x4c54('0x13')](_0x4c54('0xf'),_0x4d666e,_0x35e247);_0x142365(_0x35e247);});});}