Built motion from commit d5e4af8c.|2.6.23
[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 _0xe06b=['debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x21c2c8,_0x44257e){var _0x4dd745=function(_0x1b3196){while(--_0x1b3196){_0x21c2c8['push'](_0x21c2c8['shift']());}};_0x4dd745(++_0x44257e);}(_0xe06b,0x11a));var _0xbe06=function(_0x3039e2,_0x31f0b9){_0x3039e2=_0x3039e2-0x0;var _0x53d88e=_0xe06b[_0x3039e2];return _0x53d88e;};'use strict';var _=require('lodash');var util=require(_0xbe06('0x0'));var moment=require(_0xbe06('0x1'));var BPromise=require(_0xbe06('0x2'));var rs=require(_0xbe06('0x3'));var fs=require('fs');var Redis=require(_0xbe06('0x4'));var db=require(_0xbe06('0x5'))['db'];var utils=require(_0xbe06('0x6'));var logger=require(_0xbe06('0x7'))(_0xbe06('0x8'));var config=require(_0xbe06('0x9'));var jayson=require(_0xbe06('0xa'));var client=jayson[_0xbe06('0xb')][_0xbe06('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4893e2,_0x2e9923,_0x4d9700){return new BPromise(function(_0x9f75a9,_0x5857c1){return client[_0xbe06('0xd')](_0x4893e2,_0x4d9700)[_0xbe06('0xe')](function(_0x1bbaf8){logger[_0xbe06('0xf')](_0xbe06('0x10'),_0x2e9923,_0xbe06('0x11'));logger[_0xbe06('0x12')](_0xbe06('0x13'),_0x2e9923,_0xbe06('0x11'),JSON[_0xbe06('0x14')](_0x1bbaf8));if(_0x1bbaf8[_0xbe06('0x15')]){if(_0x1bbaf8[_0xbe06('0x15')][_0xbe06('0x16')]===0x1f4){logger[_0xbe06('0x15')](_0xbe06('0x10'),_0x2e9923,_0x1bbaf8[_0xbe06('0x15')][_0xbe06('0x17')]);return _0x5857c1(_0x1bbaf8['error'][_0xbe06('0x17')]);}logger[_0xbe06('0x15')]('ZendeskConfiguration,\x20%s,\x20%s',_0x2e9923,_0x1bbaf8[_0xbe06('0x15')][_0xbe06('0x17')]);return _0x9f75a9(_0x1bbaf8['error']['message']);}else{logger[_0xbe06('0xf')](_0xbe06('0x10'),_0x2e9923,_0xbe06('0x11'));_0x9f75a9(_0x1bbaf8['result'][_0xbe06('0x17')]);}})[_0xbe06('0x18')](function(_0x458929){logger[_0xbe06('0x15')]('ZendeskConfiguration,\x20%s,\x20%s',_0x2e9923,_0x458929);_0x5857c1(_0x458929);});});}