d3e2be3f2ca1a0c7aadc1799ffaafd9f2f1d218c
[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 _0x053e=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s'];(function(_0x7e557a,_0x3e41ab){var _0x3aba18=function(_0x591db6){while(--_0x591db6){_0x7e557a['push'](_0x7e557a['shift']());}};_0x3aba18(++_0x3e41ab);}(_0x053e,0x1e9));var _0xe053=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x053e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe053('0x0'));var util=require('util');var moment=require(_0xe053('0x1'));var BPromise=require(_0xe053('0x2'));var rs=require(_0xe053('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe053('0x4'))['db'];var utils=require(_0xe053('0x5'));var logger=require('../../config/logger')(_0xe053('0x6'));var config=require('../../config/environment');var jayson=require(_0xe053('0x7'));var client=jayson[_0xe053('0x8')][_0xe053('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x7ac646,_0x16a95b,_0x59358a){return new BPromise(function(_0x4b2a8b,_0xf73ed9){return client[_0xe053('0xa')](_0x7ac646,_0x59358a)[_0xe053('0xb')](function(_0x3da905){logger[_0xe053('0xc')](_0xe053('0xd'),_0x16a95b,_0xe053('0xe'));logger[_0xe053('0xf')](_0xe053('0x10'),_0x16a95b,_0xe053('0xe'),JSON[_0xe053('0x11')](_0x3da905));if(_0x3da905[_0xe053('0x12')]){if(_0x3da905['error'][_0xe053('0x13')]===0x1f4){logger[_0xe053('0x12')](_0xe053('0xd'),_0x16a95b,_0x3da905[_0xe053('0x12')]['message']);return _0xf73ed9(_0x3da905[_0xe053('0x12')][_0xe053('0x14')]);}logger[_0xe053('0x12')](_0xe053('0xd'),_0x16a95b,_0x3da905['error'][_0xe053('0x14')]);return _0x4b2a8b(_0x3da905[_0xe053('0x12')][_0xe053('0x14')]);}else{logger[_0xe053('0xc')](_0xe053('0xd'),_0x16a95b,_0xe053('0xe'));_0x4b2a8b(_0x3da905[_0xe053('0x15')][_0xe053('0x14')]);}})[_0xe053('0x16')](function(_0x42188f){logger[_0xe053('0x12')](_0xe053('0xd'),_0x16a95b,_0x42188f);_0xf73ed9(_0x42188f);});});}