Built motion from commit 85328c08.|2.5.50
[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 _0x9fe6=['code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','DeskField,\x20%s,\x20%s','DeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x26f1b2,_0x33d843){var _0x1624a4=function(_0x58dfb7){while(--_0x58dfb7){_0x26f1b2['push'](_0x26f1b2['shift']());}};_0x1624a4(++_0x33d843);}(_0x9fe6,0x1bc));var _0x69fe=function(_0x3ad850,_0x4d8004){_0x3ad850=_0x3ad850-0x0;var _0x5326ab=_0x9fe6[_0x3ad850];return _0x5326ab;};'use strict';var _=require('lodash');var util=require(_0x69fe('0x0'));var moment=require(_0x69fe('0x1'));var BPromise=require(_0x69fe('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x69fe('0x3'));var db=require(_0x69fe('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x69fe('0x5'))(_0x69fe('0x6'));var config=require('../../config/environment');var jayson=require(_0x69fe('0x7'));var client=jayson[_0x69fe('0x8')][_0x69fe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xd2e696,_0x1c1f2f,_0xf22e83){return new BPromise(function(_0xb7312c,_0x1e90af){return client[_0x69fe('0xa')](_0xd2e696,_0xf22e83)[_0x69fe('0xb')](function(_0x3a83de){logger[_0x69fe('0xc')](_0x69fe('0xd'),_0x1c1f2f,'request\x20sent');logger['debug'](_0x69fe('0xe'),_0x1c1f2f,_0x69fe('0xf'),JSON[_0x69fe('0x10')](_0x3a83de));if(_0x3a83de[_0x69fe('0x11')]){if(_0x3a83de[_0x69fe('0x11')][_0x69fe('0x12')]===0x1f4){logger[_0x69fe('0x11')](_0x69fe('0xd'),_0x1c1f2f,_0x3a83de['error']['message']);return _0x1e90af(_0x3a83de[_0x69fe('0x11')][_0x69fe('0x13')]);}logger[_0x69fe('0x11')](_0x69fe('0xd'),_0x1c1f2f,_0x3a83de['error'][_0x69fe('0x13')]);return _0xb7312c(_0x3a83de[_0x69fe('0x11')]['message']);}else{logger['info'](_0x69fe('0xd'),_0x1c1f2f,_0x69fe('0xf'));_0xb7312c(_0x3a83de[_0x69fe('0x14')][_0x69fe('0x13')]);}})[_0x69fe('0x15')](function(_0x3440c7){logger['error'](_0x69fe('0xd'),_0x1c1f2f,_0x3440c7);_0x1e90af(_0x3440c7);});});}