Built motion from commit 936e8062.|2.5.33
[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 _0xa62f=['http','request','then','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x296c3e,_0x34c19f){var _0x46b68a=function(_0x1a3c44){while(--_0x1a3c44){_0x296c3e['push'](_0x296c3e['shift']());}};_0x46b68a(++_0x34c19f);}(_0xa62f,0x1c6));var _0xfa62=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa62f[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0xfa62('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xfa62('0x1'));var rs=require(_0xfa62('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfa62('0x3'));var logger=require(_0xfa62('0x4'))(_0xfa62('0x5'));var config=require(_0xfa62('0x6'));var jayson=require(_0xfa62('0x7'));var client=jayson['client'][_0xfa62('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2ae332,_0x1113f9,_0x12d577){return new BPromise(function(_0x3f7e7d,_0x5ce9c0){return client[_0xfa62('0x9')](_0x2ae332,_0x12d577)[_0xfa62('0xa')](function(_0x16ec25){logger['info'](_0xfa62('0xb'),_0x1113f9,_0xfa62('0xc'));logger[_0xfa62('0xd')](_0xfa62('0xe'),_0x1113f9,'request\x20sent',JSON['stringify'](_0x16ec25));if(_0x16ec25[_0xfa62('0xf')]){if(_0x16ec25['error'][_0xfa62('0x10')]===0x1f4){logger[_0xfa62('0xf')](_0xfa62('0xb'),_0x1113f9,_0x16ec25['error'][_0xfa62('0x11')]);return _0x5ce9c0(_0x16ec25[_0xfa62('0xf')]['message']);}logger[_0xfa62('0xf')](_0xfa62('0xb'),_0x1113f9,_0x16ec25[_0xfa62('0xf')][_0xfa62('0x11')]);return _0x3f7e7d(_0x16ec25[_0xfa62('0xf')][_0xfa62('0x11')]);}else{logger[_0xfa62('0x12')](_0xfa62('0xb'),_0x1113f9,_0xfa62('0xc'));_0x3f7e7d(_0x16ec25[_0xfa62('0x13')]['message']);}})[_0xfa62('0x14')](function(_0x40c030){logger[_0xfa62('0xf')](_0xfa62('0xb'),_0x1113f9,_0x40c030);_0x5ce9c0(_0x40c030);});});}