f658dff320940c50b1c2a63259e20b1dd53893c0
[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 _0xae35=['code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x174767,_0x5b603e){var _0x2a7fbd=function(_0x377894){while(--_0x377894){_0x174767['push'](_0x174767['shift']());}};_0x2a7fbd(++_0x5b603e);}(_0xae35,0x119));var _0x5ae3=function(_0x72fe41,_0x2dbc9c){_0x72fe41=_0x72fe41-0x0;var _0x3971a7=_0xae35[_0x72fe41];return _0x3971a7;};'use strict';var _=require(_0x5ae3('0x0'));var util=require(_0x5ae3('0x1'));var moment=require(_0x5ae3('0x2'));var BPromise=require(_0x5ae3('0x3'));var rs=require(_0x5ae3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5ae3('0x5'))(_0x5ae3('0x6'));var config=require(_0x5ae3('0x7'));var jayson=require(_0x5ae3('0x8'));var client=jayson[_0x5ae3('0x9')][_0x5ae3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x420e4c,_0x352a82,_0x36bad7){return new BPromise(function(_0x30e77b,_0x302737){return client[_0x5ae3('0xb')](_0x420e4c,_0x36bad7)['then'](function(_0x5a5cd1){logger['info'](_0x5ae3('0xc'),_0x352a82,_0x5ae3('0xd'));logger[_0x5ae3('0xe')](_0x5ae3('0xf'),_0x352a82,_0x5ae3('0xd'),JSON[_0x5ae3('0x10')](_0x5a5cd1));if(_0x5a5cd1[_0x5ae3('0x11')]){if(_0x5a5cd1['error'][_0x5ae3('0x12')]===0x1f4){logger[_0x5ae3('0x11')]('CmCustomField,\x20%s,\x20%s',_0x352a82,_0x5a5cd1[_0x5ae3('0x11')][_0x5ae3('0x13')]);return _0x302737(_0x5a5cd1['error']['message']);}logger[_0x5ae3('0x11')](_0x5ae3('0xc'),_0x352a82,_0x5a5cd1[_0x5ae3('0x11')][_0x5ae3('0x13')]);return _0x30e77b(_0x5a5cd1[_0x5ae3('0x11')][_0x5ae3('0x13')]);}else{logger[_0x5ae3('0x14')](_0x5ae3('0xc'),_0x352a82,_0x5ae3('0xd'));_0x30e77b(_0x5a5cd1[_0x5ae3('0x15')][_0x5ae3('0x13')]);}})[_0x5ae3('0x16')](function(_0x5d3a68){logger[_0x5ae3('0x11')]('CmCustomField,\x20%s,\x20%s',_0x352a82,_0x5d3a68);_0x302737(_0x5d3a68);});});}