Built motion from commit 1efd3d96.|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 _0x2762=['stringify','error','FreshdeskConfiguration,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x2762,0x195));var _0x2276=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2762[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2276('0x0'));var BPromise=require(_0x2276('0x1'));var rs=require(_0x2276('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2276('0x3'))['db'];var utils=require(_0x2276('0x4'));var logger=require(_0x2276('0x5'))('rpc');var config=require(_0x2276('0x6'));var jayson=require(_0x2276('0x7'));var client=jayson['client'][_0x2276('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4271d4,_0x1fbc28,_0x29b043){return new BPromise(function(_0x28175e,_0x403b06){return client[_0x2276('0x9')](_0x4271d4,_0x29b043)[_0x2276('0xa')](function(_0x2ecda4){logger[_0x2276('0xb')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x1fbc28,'request\x20sent');logger[_0x2276('0xc')](_0x2276('0xd'),_0x1fbc28,_0x2276('0xe'),JSON[_0x2276('0xf')](_0x2ecda4));if(_0x2ecda4[_0x2276('0x10')]){if(_0x2ecda4['error']['code']===0x1f4){logger['error'](_0x2276('0x11'),_0x1fbc28,_0x2ecda4['error'][_0x2276('0x12')]);return _0x403b06(_0x2ecda4[_0x2276('0x10')][_0x2276('0x12')]);}logger[_0x2276('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x1fbc28,_0x2ecda4[_0x2276('0x10')][_0x2276('0x12')]);return _0x28175e(_0x2ecda4['error'][_0x2276('0x12')]);}else{logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x1fbc28,'request\x20sent');_0x28175e(_0x2ecda4[_0x2276('0x13')][_0x2276('0x12')]);}})[_0x2276('0x14')](function(_0x19bab2){logger[_0x2276('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x1fbc28,_0x19bab2);_0x403b06(_0x19bab2);});});}