Built motion from commit 3e059bc2.|2.5.32
[motion2.git] / server / api / cmCustomField / cmCustomField.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 _0x5b90=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','request','info','debug','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CmCustomField,\x20%s,\x20%s','message','result','catch'];(function(_0x32e61d,_0x5733b7){var _0x4db536=function(_0x23cdfb){while(--_0x23cdfb){_0x32e61d['push'](_0x32e61d['shift']());}};_0x4db536(++_0x5733b7);}(_0x5b90,0x13b));var _0x05b9=function(_0x5bc440,_0x2b6060){_0x5bc440=_0x5bc440-0x0;var _0x422868=_0x5b90[_0x5bc440];return _0x422868;};'use strict';var _=require(_0x05b9('0x0'));var util=require('util');var moment=require(_0x05b9('0x1'));var BPromise=require(_0x05b9('0x2'));var rs=require(_0x05b9('0x3'));var fs=require('fs');var Redis=require(_0x05b9('0x4'));var db=require(_0x05b9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x05b9('0x6'))(_0x05b9('0x7'));var config=require(_0x05b9('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x42a093,_0x3acf35,_0x1dbe7a){return new BPromise(function(_0x4a9661,_0x1e37c5){return client[_0x05b9('0x9')](_0x42a093,_0x1dbe7a)['then'](function(_0x4fd998){logger[_0x05b9('0xa')]('CmCustomField,\x20%s,\x20%s',_0x3acf35,'request\x20sent');logger[_0x05b9('0xb')](_0x05b9('0xc'),_0x3acf35,_0x05b9('0xd'),JSON[_0x05b9('0xe')](_0x4fd998));if(_0x4fd998[_0x05b9('0xf')]){if(_0x4fd998['error'][_0x05b9('0x10')]===0x1f4){logger[_0x05b9('0xf')](_0x05b9('0x11'),_0x3acf35,_0x4fd998['error'][_0x05b9('0x12')]);return _0x1e37c5(_0x4fd998[_0x05b9('0xf')][_0x05b9('0x12')]);}logger[_0x05b9('0xf')](_0x05b9('0x11'),_0x3acf35,_0x4fd998[_0x05b9('0xf')]['message']);return _0x4a9661(_0x4fd998[_0x05b9('0xf')]['message']);}else{logger[_0x05b9('0xa')]('CmCustomField,\x20%s,\x20%s',_0x3acf35,_0x05b9('0xd'));_0x4a9661(_0x4fd998[_0x05b9('0x13')][_0x05b9('0x12')]);}})[_0x05b9('0x14')](function(_0x309f9d){logger[_0x05b9('0xf')](_0x05b9('0x11'),_0x3acf35,_0x309f9d);_0x1e37c5(_0x309f9d);});});}