1c22a4ffaa7a2a52349540c5e1b9fff5c80ea745
[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 _0xd495=['stringify','error','code','DeskField,\x20%s,\x20%s','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s'];(function(_0x172948,_0x4262cc){var _0x4aeaa9=function(_0x5ec4b3){while(--_0x5ec4b3){_0x172948['push'](_0x172948['shift']());}};_0x4aeaa9(++_0x4262cc);}(_0xd495,0xdf));var _0x5d49=function(_0x2b55b5,_0x78505e){_0x2b55b5=_0x2b55b5-0x0;var _0x103d28=_0xd495[_0x2b55b5];return _0x103d28;};'use strict';var _=require('lodash');var util=require(_0x5d49('0x0'));var moment=require('moment');var BPromise=require(_0x5d49('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5d49('0x2'));var db=require(_0x5d49('0x3'))['db'];var utils=require(_0x5d49('0x4'));var logger=require(_0x5d49('0x5'))(_0x5d49('0x6'));var config=require(_0x5d49('0x7'));var jayson=require(_0x5d49('0x8'));var client=jayson[_0x5d49('0x9')][_0x5d49('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x68d06a,_0x317fdc,_0x4cc996){return new BPromise(function(_0xd5c74c,_0x477dba){return client[_0x5d49('0xb')](_0x68d06a,_0x4cc996)[_0x5d49('0xc')](function(_0x5ac65d){logger[_0x5d49('0xd')]('DeskField,\x20%s,\x20%s',_0x317fdc,_0x5d49('0xe'));logger[_0x5d49('0xf')](_0x5d49('0x10'),_0x317fdc,_0x5d49('0xe'),JSON[_0x5d49('0x11')](_0x5ac65d));if(_0x5ac65d[_0x5d49('0x12')]){if(_0x5ac65d[_0x5d49('0x12')][_0x5d49('0x13')]===0x1f4){logger[_0x5d49('0x12')](_0x5d49('0x14'),_0x317fdc,_0x5ac65d[_0x5d49('0x12')][_0x5d49('0x15')]);return _0x477dba(_0x5ac65d[_0x5d49('0x12')][_0x5d49('0x15')]);}logger['error'](_0x5d49('0x14'),_0x317fdc,_0x5ac65d[_0x5d49('0x12')][_0x5d49('0x15')]);return _0xd5c74c(_0x5ac65d[_0x5d49('0x12')][_0x5d49('0x15')]);}else{logger[_0x5d49('0xd')](_0x5d49('0x14'),_0x317fdc,_0x5d49('0xe'));_0xd5c74c(_0x5ac65d[_0x5d49('0x16')][_0x5d49('0x15')]);}})[_0x5d49('0x17')](function(_0x556d0f){logger[_0x5d49('0x12')](_0x5d49('0x14'),_0x317fdc,_0x556d0f);_0x477dba(_0x556d0f);});});}