Built motion from commit 3061e47c.|2.6.31
[motion2.git] / server / api / intFreshdeskConfiguration / intFreshdeskConfiguration.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 _0x838e=['request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x14b378,_0x18dbb1){var _0x566c0b=function(_0x585c62){while(--_0x585c62){_0x14b378['push'](_0x14b378['shift']());}};_0x566c0b(++_0x18dbb1);}(_0x838e,0x1e9));var _0xe838=function(_0x25576b,_0x128320){_0x25576b=_0x25576b-0x0;var _0x55c79e=_0x838e[_0x25576b];return _0x55c79e;};'use strict';var _=require(_0xe838('0x0'));var util=require(_0xe838('0x1'));var moment=require(_0xe838('0x2'));var BPromise=require(_0xe838('0x3'));var rs=require(_0xe838('0x4'));var fs=require('fs');var Redis=require(_0xe838('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe838('0x6'));var logger=require(_0xe838('0x7'))(_0xe838('0x8'));var config=require('../../config/environment');var jayson=require(_0xe838('0x9'));var client=jayson['client'][_0xe838('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32c486,_0x52cf80,_0xdf88bc){return new BPromise(function(_0x3bb7dd,_0x13e433){return client[_0xe838('0xb')](_0x32c486,_0xdf88bc)[_0xe838('0xc')](function(_0x54d3cd){logger[_0xe838('0xd')](_0xe838('0xe'),_0x52cf80,'request\x20sent');logger[_0xe838('0xf')](_0xe838('0x10'),_0x52cf80,_0xe838('0x11'),JSON[_0xe838('0x12')](_0x54d3cd));if(_0x54d3cd[_0xe838('0x13')]){if(_0x54d3cd['error']['code']===0x1f4){logger[_0xe838('0x13')](_0xe838('0xe'),_0x52cf80,_0x54d3cd[_0xe838('0x13')][_0xe838('0x14')]);return _0x13e433(_0x54d3cd[_0xe838('0x13')][_0xe838('0x14')]);}logger['error'](_0xe838('0xe'),_0x52cf80,_0x54d3cd[_0xe838('0x13')][_0xe838('0x14')]);return _0x3bb7dd(_0x54d3cd[_0xe838('0x13')][_0xe838('0x14')]);}else{logger[_0xe838('0xd')](_0xe838('0xe'),_0x52cf80,'request\x20sent');_0x3bb7dd(_0x54d3cd[_0xe838('0x15')]['message']);}})[_0xe838('0x16')](function(_0x7e8ae){logger['error'](_0xe838('0xe'),_0x52cf80,_0x7e8ae);_0x13e433(_0x7e8ae);});});}