5596a6be822e1abd93f7a3e35bfaa8e08a72cf59
[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 _0x8f1c=['stringify','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0x8f1c,0x1bd));var _0xc8f1=function(_0x306eac,_0x509b7f){_0x306eac=_0x306eac-0x0;var _0x45e58d=_0x8f1c[_0x306eac];return _0x45e58d;};'use strict';var _=require(_0xc8f1('0x0'));var util=require('util');var moment=require(_0xc8f1('0x1'));var BPromise=require(_0xc8f1('0x2'));var rs=require(_0xc8f1('0x3'));var fs=require('fs');var Redis=require(_0xc8f1('0x4'));var db=require(_0xc8f1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc8f1('0x6'))(_0xc8f1('0x7'));var config=require(_0xc8f1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc8f1('0x9')][_0xc8f1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5d67d9,_0x558b32,_0x3334dc){return new BPromise(function(_0x5d0da8,_0x3560d7){return client[_0xc8f1('0xb')](_0x5d67d9,_0x3334dc)[_0xc8f1('0xc')](function(_0x59ec78){logger[_0xc8f1('0xd')](_0xc8f1('0xe'),_0x558b32,_0xc8f1('0xf'));logger['debug'](_0xc8f1('0x10'),_0x558b32,_0xc8f1('0xf'),JSON[_0xc8f1('0x11')](_0x59ec78));if(_0x59ec78[_0xc8f1('0x12')]){if(_0x59ec78[_0xc8f1('0x12')]['code']===0x1f4){logger[_0xc8f1('0x12')]('ZendeskConfiguration,\x20%s,\x20%s',_0x558b32,_0x59ec78[_0xc8f1('0x12')][_0xc8f1('0x13')]);return _0x3560d7(_0x59ec78[_0xc8f1('0x12')][_0xc8f1('0x13')]);}logger[_0xc8f1('0x12')]('ZendeskConfiguration,\x20%s,\x20%s',_0x558b32,_0x59ec78[_0xc8f1('0x12')]['message']);return _0x5d0da8(_0x59ec78[_0xc8f1('0x12')][_0xc8f1('0x13')]);}else{logger[_0xc8f1('0xd')]('ZendeskConfiguration,\x20%s,\x20%s',_0x558b32,_0xc8f1('0xf'));_0x5d0da8(_0x59ec78['result'][_0xc8f1('0x13')]);}})[_0xc8f1('0x14')](function(_0x1c6670){logger[_0xc8f1('0x12')](_0xc8f1('0xe'),_0x558b32,_0x1c6670);_0x3560d7(_0x1c6670);});});}