Built motion from commit (unavailable).|2.5.5
[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 _0x9f62=['util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','CmCustomField,\x20%s,\x20%s','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch'];(function(_0x23f0df,_0x55e679){var _0x1564b2=function(_0x53e00c){while(--_0x53e00c){_0x23f0df['push'](_0x23f0df['shift']());}};_0x1564b2(++_0x55e679);}(_0x9f62,0x154));var _0x29f6=function(_0x4bceeb,_0x2ca7ae){_0x4bceeb=_0x4bceeb-0x0;var _0x212485=_0x9f62[_0x4bceeb];return _0x212485;};'use strict';var _=require('lodash');var util=require(_0x29f6('0x0'));var moment=require('moment');var BPromise=require(_0x29f6('0x1'));var rs=require(_0x29f6('0x2'));var fs=require('fs');var Redis=require(_0x29f6('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x29f6('0x4'))(_0x29f6('0x5'));var config=require(_0x29f6('0x6'));var jayson=require(_0x29f6('0x7'));var client=jayson['client'][_0x29f6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x272876,_0x9a43fe,_0x2ba602){return new BPromise(function(_0x416c6c,_0x5e9945){return client['request'](_0x272876,_0x2ba602)['then'](function(_0x549f64){logger[_0x29f6('0x9')](_0x29f6('0xa'),_0x9a43fe,'request\x20sent');logger['debug'](_0x29f6('0xb'),_0x9a43fe,_0x29f6('0xc'),JSON['stringify'](_0x549f64));if(_0x549f64[_0x29f6('0xd')]){if(_0x549f64[_0x29f6('0xd')]['code']===0x1f4){logger['error']('CmCustomField,\x20%s,\x20%s',_0x9a43fe,_0x549f64['error'][_0x29f6('0xe')]);return _0x5e9945(_0x549f64[_0x29f6('0xd')][_0x29f6('0xe')]);}logger[_0x29f6('0xd')](_0x29f6('0xa'),_0x9a43fe,_0x549f64[_0x29f6('0xd')][_0x29f6('0xe')]);return _0x416c6c(_0x549f64[_0x29f6('0xd')][_0x29f6('0xe')]);}else{logger[_0x29f6('0x9')](_0x29f6('0xa'),_0x9a43fe,_0x29f6('0xc'));_0x416c6c(_0x549f64[_0x29f6('0xf')][_0x29f6('0xe')]);}})[_0x29f6('0x10')](function(_0x14dd56){logger[_0x29f6('0xd')]('CmCustomField,\x20%s,\x20%s',_0x9a43fe,_0x14dd56);_0x5e9945(_0x14dd56);});});}