Built motion from commit (unavailable).|2.5.4
[motion2.git] / server / api / cmCompany / cmCompany.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 _0xa8ce=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','CmCompany,\x20%s,\x20%s','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x325c1b,_0x4ce004){var _0x51912d=function(_0x1bb073){while(--_0x1bb073){_0x325c1b['push'](_0x325c1b['shift']());}};_0x51912d(++_0x4ce004);}(_0xa8ce,0x15e));var _0xea8c=function(_0x2f7fb4,_0x162fff){_0x2f7fb4=_0x2f7fb4-0x0;var _0x2ca79d=_0xa8ce[_0x2f7fb4];return _0x2ca79d;};'use strict';var _=require(_0xea8c('0x0'));var util=require(_0xea8c('0x1'));var moment=require(_0xea8c('0x2'));var BPromise=require(_0xea8c('0x3'));var rs=require(_0xea8c('0x4'));var fs=require('fs');var Redis=require(_0xea8c('0x5'));var db=require(_0xea8c('0x6'))['db'];var utils=require(_0xea8c('0x7'));var logger=require(_0xea8c('0x8'))('rpc');var config=require(_0xea8c('0x9'));var jayson=require(_0xea8c('0xa'));var client=jayson['client'][_0xea8c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x320367,_0xd95a7f,_0x5f5b18){return new BPromise(function(_0x43e0ff,_0x3e024d){return client[_0xea8c('0xc')](_0x320367,_0x5f5b18)[_0xea8c('0xd')](function(_0x5c29c4){logger[_0xea8c('0xe')](_0xea8c('0xf'),_0xd95a7f,'request\x20sent');logger['debug'](_0xea8c('0x10'),_0xd95a7f,_0xea8c('0x11'),JSON['stringify'](_0x5c29c4));if(_0x5c29c4[_0xea8c('0x12')]){if(_0x5c29c4['error'][_0xea8c('0x13')]===0x1f4){logger[_0xea8c('0x12')](_0xea8c('0xf'),_0xd95a7f,_0x5c29c4[_0xea8c('0x12')]['message']);return _0x3e024d(_0x5c29c4[_0xea8c('0x12')][_0xea8c('0x14')]);}logger[_0xea8c('0x12')]('CmCompany,\x20%s,\x20%s',_0xd95a7f,_0x5c29c4[_0xea8c('0x12')]['message']);return _0x43e0ff(_0x5c29c4[_0xea8c('0x12')][_0xea8c('0x14')]);}else{logger[_0xea8c('0xe')](_0xea8c('0xf'),_0xd95a7f,_0xea8c('0x11'));_0x43e0ff(_0x5c29c4[_0xea8c('0x15')]['message']);}})[_0xea8c('0x16')](function(_0x2d9da4){logger[_0xea8c('0x12')](_0xea8c('0xf'),_0xd95a7f,_0x2d9da4);_0x3e024d(_0x2d9da4);});});}