Built motion from commit a61a4a20.|2.5.46
[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 _0xdbbf=['error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4e0bb2,_0x46be29){var _0x19b32d=function(_0x30bd13){while(--_0x30bd13){_0x4e0bb2['push'](_0x4e0bb2['shift']());}};_0x19b32d(++_0x46be29);}(_0xdbbf,0x1d3));var _0xfdbb=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xdbbf[_0x4ff09b];return _0x3f5c2e;};'use strict';var _=require(_0xfdbb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xfdbb('0x1'));var rs=require(_0xfdbb('0x2'));var fs=require('fs');var Redis=require(_0xfdbb('0x3'));var db=require(_0xfdbb('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfdbb('0x5'));var config=require(_0xfdbb('0x6'));var jayson=require(_0xfdbb('0x7'));var client=jayson[_0xfdbb('0x8')][_0xfdbb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x24d06d,_0x2bf06d,_0x383938){return new BPromise(function(_0x2f489a,_0x5ea921){return client['request'](_0x24d06d,_0x383938)['then'](function(_0x46dc7a){logger[_0xfdbb('0xa')](_0xfdbb('0xb'),_0x2bf06d,_0xfdbb('0xc'));logger[_0xfdbb('0xd')](_0xfdbb('0xe'),_0x2bf06d,_0xfdbb('0xc'),JSON[_0xfdbb('0xf')](_0x46dc7a));if(_0x46dc7a[_0xfdbb('0x10')]){if(_0x46dc7a['error'][_0xfdbb('0x11')]===0x1f4){logger[_0xfdbb('0x10')](_0xfdbb('0xb'),_0x2bf06d,_0x46dc7a['error'][_0xfdbb('0x12')]);return _0x5ea921(_0x46dc7a[_0xfdbb('0x10')][_0xfdbb('0x12')]);}logger['error'](_0xfdbb('0xb'),_0x2bf06d,_0x46dc7a['error'][_0xfdbb('0x12')]);return _0x2f489a(_0x46dc7a['error'][_0xfdbb('0x12')]);}else{logger[_0xfdbb('0xa')]('CmCustomField,\x20%s,\x20%s',_0x2bf06d,_0xfdbb('0xc'));_0x2f489a(_0x46dc7a[_0xfdbb('0x13')][_0xfdbb('0x12')]);}})[_0xfdbb('0x14')](function(_0x204350){logger[_0xfdbb('0x10')](_0xfdbb('0xb'),_0x2bf06d,_0x204350);_0x5ea921(_0x204350);});});}