Built motion from commit (unavailable).|2.5.15
[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 _0x2d20=['CmCompany,\x20%s,\x20%s','info','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0xca48f2,_0x3102f5){var _0x15da0a=function(_0x3c8e74){while(--_0x3c8e74){_0xca48f2['push'](_0xca48f2['shift']());}};_0x15da0a(++_0x3102f5);}(_0x2d20,0x8e));var _0x02d2=function(_0x188122,_0x2f8f6f){_0x188122=_0x188122-0x0;var _0x3739c3=_0x2d20[_0x188122];return _0x3739c3;};'use strict';var _=require('lodash');var util=require(_0x02d2('0x0'));var moment=require('moment');var BPromise=require(_0x02d2('0x1'));var rs=require(_0x02d2('0x2'));var fs=require('fs');var Redis=require(_0x02d2('0x3'));var db=require(_0x02d2('0x4'))['db'];var utils=require(_0x02d2('0x5'));var logger=require(_0x02d2('0x6'))(_0x02d2('0x7'));var config=require(_0x02d2('0x8'));var jayson=require(_0x02d2('0x9'));var client=jayson[_0x02d2('0xa')][_0x02d2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x267938,_0x31fade,_0x1a08c2){return new BPromise(function(_0x4ac121,_0xf19b00){return client[_0x02d2('0xc')](_0x267938,_0x1a08c2)['then'](function(_0x46e26e){logger['info']('CmCompany,\x20%s,\x20%s',_0x31fade,_0x02d2('0xd'));logger['debug'](_0x02d2('0xe'),_0x31fade,_0x02d2('0xd'),JSON[_0x02d2('0xf')](_0x46e26e));if(_0x46e26e[_0x02d2('0x10')]){if(_0x46e26e[_0x02d2('0x10')][_0x02d2('0x11')]===0x1f4){logger[_0x02d2('0x10')]('CmCompany,\x20%s,\x20%s',_0x31fade,_0x46e26e['error'][_0x02d2('0x12')]);return _0xf19b00(_0x46e26e[_0x02d2('0x10')][_0x02d2('0x12')]);}logger['error'](_0x02d2('0x13'),_0x31fade,_0x46e26e[_0x02d2('0x10')][_0x02d2('0x12')]);return _0x4ac121(_0x46e26e[_0x02d2('0x10')][_0x02d2('0x12')]);}else{logger[_0x02d2('0x14')]('CmCompany,\x20%s,\x20%s',_0x31fade,_0x02d2('0xd'));_0x4ac121(_0x46e26e[_0x02d2('0x15')][_0x02d2('0x12')]);}})[_0x02d2('0x16')](function(_0x350363){logger[_0x02d2('0x10')](_0x02d2('0x13'),_0x31fade,_0x350363);_0xf19b00(_0x350363);});});}