Built motion from commit fe909640.|2.6.8
[motion2.git] / server / api / contactItemType / contactItemType.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 _0xce3a=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0xdc2c8b,_0x2fe46c){var _0x51c24f=function(_0x37793d){while(--_0x37793d){_0xdc2c8b['push'](_0xdc2c8b['shift']());}};_0x51c24f(++_0x2fe46c);}(_0xce3a,0x194));var _0xace3=function(_0x394ca5,_0x16d6da){_0x394ca5=_0x394ca5-0x0;var _0x3b51f8=_0xce3a[_0x394ca5];return _0x3b51f8;};'use strict';var _=require(_0xace3('0x0'));var util=require(_0xace3('0x1'));var moment=require(_0xace3('0x2'));var BPromise=require(_0xace3('0x3'));var rs=require(_0xace3('0x4'));var fs=require('fs');var Redis=require(_0xace3('0x5'));var db=require(_0xace3('0x6'))['db'];var utils=require(_0xace3('0x7'));var logger=require(_0xace3('0x8'))(_0xace3('0x9'));var config=require(_0xace3('0xa'));var jayson=require(_0xace3('0xb'));var client=jayson['client'][_0xace3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3d4ebc,_0x4d5360,_0x22f00a){return new BPromise(function(_0x4e27ad,_0x3baa73){return client['request'](_0x3d4ebc,_0x22f00a)[_0xace3('0xd')](function(_0x104ce){logger[_0xace3('0xe')](_0xace3('0xf'),_0x4d5360,_0xace3('0x10'));logger[_0xace3('0x11')](_0xace3('0x12'),_0x4d5360,_0xace3('0x10'),JSON['stringify'](_0x104ce));if(_0x104ce['error']){if(_0x104ce['error'][_0xace3('0x13')]===0x1f4){logger['error']('ContactItemType,\x20%s,\x20%s',_0x4d5360,_0x104ce[_0xace3('0x14')]['message']);return _0x3baa73(_0x104ce[_0xace3('0x14')]['message']);}logger[_0xace3('0x14')](_0xace3('0xf'),_0x4d5360,_0x104ce[_0xace3('0x14')]['message']);return _0x4e27ad(_0x104ce[_0xace3('0x14')][_0xace3('0x15')]);}else{logger[_0xace3('0xe')](_0xace3('0xf'),_0x4d5360,'request\x20sent');_0x4e27ad(_0x104ce[_0xace3('0x16')][_0xace3('0x15')]);}})[_0xace3('0x17')](function(_0x142bb6){logger['error'](_0xace3('0xf'),_0x4d5360,_0x142bb6);_0x3baa73(_0x142bb6);});});}