b1c1d16a968fc224b0eaa43566c6ad15028dfc52
[motion2.git] / server / api / intDeskField / intDeskField.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 _0x6d65=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','bluebird','randomstring','ioredis'];(function(_0x40ab41,_0x5d535e){var _0x36962d=function(_0x3300e7){while(--_0x3300e7){_0x40ab41['push'](_0x40ab41['shift']());}};_0x36962d(++_0x5d535e);}(_0x6d65,0x16c));var _0x56d6=function(_0xe8248c,_0x2fc5dd){_0xe8248c=_0xe8248c-0x0;var _0x9db083=_0x6d65[_0xe8248c];return _0x9db083;};'use strict';var _=require('lodash');var util=require(_0x56d6('0x0'));var moment=require('moment');var BPromise=require(_0x56d6('0x1'));var rs=require(_0x56d6('0x2'));var fs=require('fs');var Redis=require(_0x56d6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x56d6('0x4'));var logger=require(_0x56d6('0x5'))(_0x56d6('0x6'));var config=require(_0x56d6('0x7'));var jayson=require(_0x56d6('0x8'));var client=jayson[_0x56d6('0x9')][_0x56d6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cd9d7,_0xb37609,_0x57e52a){return new BPromise(function(_0x3e1ecc,_0x54863f){return client[_0x56d6('0xb')](_0x3cd9d7,_0x57e52a)[_0x56d6('0xc')](function(_0x538155){logger[_0x56d6('0xd')](_0x56d6('0xe'),_0xb37609,_0x56d6('0xf'));logger[_0x56d6('0x10')](_0x56d6('0x11'),_0xb37609,_0x56d6('0xf'),JSON[_0x56d6('0x12')](_0x538155));if(_0x538155[_0x56d6('0x13')]){if(_0x538155[_0x56d6('0x13')][_0x56d6('0x14')]===0x1f4){logger[_0x56d6('0x13')]('DeskField,\x20%s,\x20%s',_0xb37609,_0x538155[_0x56d6('0x13')][_0x56d6('0x15')]);return _0x54863f(_0x538155[_0x56d6('0x13')][_0x56d6('0x15')]);}logger['error']('DeskField,\x20%s,\x20%s',_0xb37609,_0x538155['error'][_0x56d6('0x15')]);return _0x3e1ecc(_0x538155[_0x56d6('0x13')][_0x56d6('0x15')]);}else{logger[_0x56d6('0xd')](_0x56d6('0xe'),_0xb37609,_0x56d6('0xf'));_0x3e1ecc(_0x538155[_0x56d6('0x16')][_0x56d6('0x15')]);}})['catch'](function(_0x39a96d){logger[_0x56d6('0x13')]('DeskField,\x20%s,\x20%s',_0xb37609,_0x39a96d);_0x54863f(_0x39a96d);});});}