Built motion from commit (unavailable).|2.4.19
[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 _0xef29=['error','DeskField,\x20%s,\x20%s','message','info','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4bfde4,_0x3f942b){var _0x365b9b=function(_0x223572){while(--_0x223572){_0x4bfde4['push'](_0x4bfde4['shift']());}};_0x365b9b(++_0x3f942b);}(_0xef29,0x95));var _0x9ef2=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xef29[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x9ef2('0x0'));var util=require('util');var moment=require(_0x9ef2('0x1'));var BPromise=require(_0x9ef2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9ef2('0x3'))['db'];var utils=require(_0x9ef2('0x4'));var logger=require(_0x9ef2('0x5'))(_0x9ef2('0x6'));var config=require(_0x9ef2('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5973b4,_0x2a9109,_0x41be0f){return new BPromise(function(_0x23cc63,_0x1716f5){return client[_0x9ef2('0x8')](_0x5973b4,_0x41be0f)[_0x9ef2('0x9')](function(_0x292a5a){logger['info']('DeskField,\x20%s,\x20%s',_0x2a9109,'request\x20sent');logger[_0x9ef2('0xa')](_0x9ef2('0xb'),_0x2a9109,'request\x20sent',JSON[_0x9ef2('0xc')](_0x292a5a));if(_0x292a5a[_0x9ef2('0xd')]){if(_0x292a5a[_0x9ef2('0xd')]['code']===0x1f4){logger['error'](_0x9ef2('0xe'),_0x2a9109,_0x292a5a[_0x9ef2('0xd')]['message']);return _0x1716f5(_0x292a5a['error'][_0x9ef2('0xf')]);}logger[_0x9ef2('0xd')]('DeskField,\x20%s,\x20%s',_0x2a9109,_0x292a5a[_0x9ef2('0xd')][_0x9ef2('0xf')]);return _0x23cc63(_0x292a5a[_0x9ef2('0xd')][_0x9ef2('0xf')]);}else{logger[_0x9ef2('0x10')](_0x9ef2('0xe'),_0x2a9109,'request\x20sent');_0x23cc63(_0x292a5a['result']['message']);}})[_0x9ef2('0x11')](function(_0x1bf0b5){logger[_0x9ef2('0xd')]('DeskField,\x20%s,\x20%s',_0x2a9109,_0x1bf0b5);_0x1716f5(_0x1bf0b5);});});}