f6c9b95cf0be1b6f45be142d7cc07988bafce2d5
[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 _0x7a2c=['error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','CmCustomField,\x20%s,\x20%s','debug','request\x20sent','stringify'];(function(_0x3e7f2d,_0x43e884){var _0x794fa0=function(_0x2a1d32){while(--_0x2a1d32){_0x3e7f2d['push'](_0x3e7f2d['shift']());}};_0x794fa0(++_0x43e884);}(_0x7a2c,0x17b));var _0xc7a2=function(_0x38b743,_0x2f8c09){_0x38b743=_0x38b743-0x0;var _0x1bd3ad=_0x7a2c[_0x38b743];return _0x1bd3ad;};'use strict';var _=require(_0xc7a2('0x0'));var util=require('util');var moment=require(_0xc7a2('0x1'));var BPromise=require(_0xc7a2('0x2'));var rs=require(_0xc7a2('0x3'));var fs=require('fs');var Redis=require(_0xc7a2('0x4'));var db=require(_0xc7a2('0x5'))['db'];var utils=require(_0xc7a2('0x6'));var logger=require(_0xc7a2('0x7'))(_0xc7a2('0x8'));var config=require('../../config/environment');var jayson=require(_0xc7a2('0x9'));var client=jayson[_0xc7a2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x481430,_0x48773c,_0x1dd150){return new BPromise(function(_0x3de428,_0x3f0573){return client[_0xc7a2('0xb')](_0x481430,_0x1dd150)['then'](function(_0x38518b){logger[_0xc7a2('0xc')](_0xc7a2('0xd'),_0x48773c,'request\x20sent');logger[_0xc7a2('0xe')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x48773c,_0xc7a2('0xf'),JSON[_0xc7a2('0x10')](_0x38518b));if(_0x38518b[_0xc7a2('0x11')]){if(_0x38518b['error'][_0xc7a2('0x12')]===0x1f4){logger[_0xc7a2('0x11')](_0xc7a2('0xd'),_0x48773c,_0x38518b['error'][_0xc7a2('0x13')]);return _0x3f0573(_0x38518b[_0xc7a2('0x11')][_0xc7a2('0x13')]);}logger[_0xc7a2('0x11')](_0xc7a2('0xd'),_0x48773c,_0x38518b[_0xc7a2('0x11')][_0xc7a2('0x13')]);return _0x3de428(_0x38518b[_0xc7a2('0x11')][_0xc7a2('0x13')]);}else{logger[_0xc7a2('0xc')](_0xc7a2('0xd'),_0x48773c,_0xc7a2('0xf'));_0x3de428(_0x38518b[_0xc7a2('0x14')][_0xc7a2('0x13')]);}})[_0xc7a2('0x15')](function(_0x506396){logger[_0xc7a2('0x11')]('CmCustomField,\x20%s,\x20%s',_0x48773c,_0x506396);_0x3f0573(_0x506396);});});}