Built motion from commit 85328c08.|2.5.50
[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 _0xbc18=['message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x7c2965,_0x508b8c){var _0xfbcfb1=function(_0x573621){while(--_0x573621){_0x7c2965['push'](_0x7c2965['shift']());}};_0xfbcfb1(++_0x508b8c);}(_0xbc18,0x86));var _0x8bc1=function(_0x3dc538,_0x4f7702){_0x3dc538=_0x3dc538-0x0;var _0x72c2fd=_0xbc18[_0x3dc538];return _0x72c2fd;};'use strict';var _=require('lodash');var util=require(_0x8bc1('0x0'));var moment=require('moment');var BPromise=require(_0x8bc1('0x1'));var rs=require(_0x8bc1('0x2'));var fs=require('fs');var Redis=require(_0x8bc1('0x3'));var db=require(_0x8bc1('0x4'))['db'];var utils=require(_0x8bc1('0x5'));var logger=require(_0x8bc1('0x6'))(_0x8bc1('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8bc1('0x8')][_0x8bc1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf3923,_0x5a112b,_0x549f01){return new BPromise(function(_0x2e4dce,_0x3067fd){return client[_0x8bc1('0xa')](_0xf3923,_0x549f01)[_0x8bc1('0xb')](function(_0x2705cb){logger[_0x8bc1('0xc')](_0x8bc1('0xd'),_0x5a112b,_0x8bc1('0xe'));logger[_0x8bc1('0xf')](_0x8bc1('0x10'),_0x5a112b,'request\x20sent',JSON[_0x8bc1('0x11')](_0x2705cb));if(_0x2705cb[_0x8bc1('0x12')]){if(_0x2705cb[_0x8bc1('0x12')][_0x8bc1('0x13')]===0x1f4){logger[_0x8bc1('0x12')](_0x8bc1('0xd'),_0x5a112b,_0x2705cb[_0x8bc1('0x12')]['message']);return _0x3067fd(_0x2705cb[_0x8bc1('0x12')]['message']);}logger[_0x8bc1('0x12')](_0x8bc1('0xd'),_0x5a112b,_0x2705cb[_0x8bc1('0x12')][_0x8bc1('0x14')]);return _0x2e4dce(_0x2705cb[_0x8bc1('0x12')][_0x8bc1('0x14')]);}else{logger[_0x8bc1('0xc')](_0x8bc1('0xd'),_0x5a112b,'request\x20sent');_0x2e4dce(_0x2705cb['result'][_0x8bc1('0x14')]);}})[_0x8bc1('0x15')](function(_0x249088){logger[_0x8bc1('0x12')](_0x8bc1('0xd'),_0x5a112b,_0x249088);_0x3067fd(_0x249088);});});}