678333f06dc9bcd3747f2deb109fe62e1d5c0103
[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 _0x9e58=['result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','debug','ContactItemType,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ContactItemType,\x20%s,\x20%s','message'];(function(_0x5ef7b8,_0x15cc07){var _0x2c7148=function(_0x398519){while(--_0x398519){_0x5ef7b8['push'](_0x5ef7b8['shift']());}};_0x2c7148(++_0x15cc07);}(_0x9e58,0x80));var _0x89e5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9e58[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x89e5('0x0'));var moment=require('moment');var BPromise=require(_0x89e5('0x1'));var rs=require(_0x89e5('0x2'));var fs=require('fs');var Redis=require(_0x89e5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x89e5('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x89e5('0x5'));var jayson=require(_0x89e5('0x6'));var client=jayson['client'][_0x89e5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x241b0f,_0x47eda0,_0x58b055){return new BPromise(function(_0x271405,_0x471880){return client[_0x89e5('0x8')](_0x241b0f,_0x58b055)[_0x89e5('0x9')](function(_0x2a58bf){logger[_0x89e5('0xa')]('ContactItemType,\x20%s,\x20%s',_0x47eda0,'request\x20sent');logger[_0x89e5('0xb')](_0x89e5('0xc'),_0x47eda0,_0x89e5('0xd'),JSON[_0x89e5('0xe')](_0x2a58bf));if(_0x2a58bf[_0x89e5('0xf')]){if(_0x2a58bf[_0x89e5('0xf')][_0x89e5('0x10')]===0x1f4){logger[_0x89e5('0xf')](_0x89e5('0x11'),_0x47eda0,_0x2a58bf['error'][_0x89e5('0x12')]);return _0x471880(_0x2a58bf[_0x89e5('0xf')][_0x89e5('0x12')]);}logger['error'](_0x89e5('0x11'),_0x47eda0,_0x2a58bf[_0x89e5('0xf')][_0x89e5('0x12')]);return _0x271405(_0x2a58bf[_0x89e5('0xf')][_0x89e5('0x12')]);}else{logger[_0x89e5('0xa')]('ContactItemType,\x20%s,\x20%s',_0x47eda0,_0x89e5('0xd'));_0x271405(_0x2a58bf[_0x89e5('0x13')][_0x89e5('0x12')]);}})[_0x89e5('0x14')](function(_0xc3007b){logger[_0x89e5('0xf')](_0x89e5('0x11'),_0x47eda0,_0xc3007b);_0x471880(_0xc3007b);});});}