Built motion from commit (unavailable).|2.2.0
[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 _0x5d65=['request\x20sent','debug','stringify','error','code','message','CmCompany,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x576e94,_0xb93f66){var _0x45675d=function(_0x4eba68){while(--_0x4eba68){_0x576e94['push'](_0x576e94['shift']());}};_0x45675d(++_0xb93f66);}(_0x5d65,0x99));var _0x55d6=function(_0x599e60,_0x5b6519){_0x599e60=_0x599e60-0x0;var _0x468e19=_0x5d65[_0x599e60];return _0x468e19;};'use strict';var _=require(_0x55d6('0x0'));var util=require('util');var moment=require(_0x55d6('0x1'));var BPromise=require(_0x55d6('0x2'));var rs=require(_0x55d6('0x3'));var fs=require('fs');var Redis=require(_0x55d6('0x4'));var db=require(_0x55d6('0x5'))['db'];var utils=require(_0x55d6('0x6'));var logger=require(_0x55d6('0x7'))(_0x55d6('0x8'));var config=require(_0x55d6('0x9'));var jayson=require(_0x55d6('0xa'));var client=jayson['client'][_0x55d6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x58fb28,_0x2624eb,_0x54b756){return new BPromise(function(_0x240303,_0x310dce){return client[_0x55d6('0xc')](_0x58fb28,_0x54b756)[_0x55d6('0xd')](function(_0x258c3d){logger[_0x55d6('0xe')]('CmCompany,\x20%s,\x20%s',_0x2624eb,_0x55d6('0xf'));logger[_0x55d6('0x10')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x2624eb,'request\x20sent',JSON[_0x55d6('0x11')](_0x258c3d));if(_0x258c3d[_0x55d6('0x12')]){if(_0x258c3d[_0x55d6('0x12')][_0x55d6('0x13')]===0x1f4){logger[_0x55d6('0x12')]('CmCompany,\x20%s,\x20%s',_0x2624eb,_0x258c3d[_0x55d6('0x12')][_0x55d6('0x14')]);return _0x310dce(_0x258c3d[_0x55d6('0x12')][_0x55d6('0x14')]);}logger[_0x55d6('0x12')](_0x55d6('0x15'),_0x2624eb,_0x258c3d[_0x55d6('0x12')][_0x55d6('0x14')]);return _0x240303(_0x258c3d['error'][_0x55d6('0x14')]);}else{logger[_0x55d6('0xe')](_0x55d6('0x15'),_0x2624eb,_0x55d6('0xf'));_0x240303(_0x258c3d[_0x55d6('0x16')]['message']);}})[_0x55d6('0x17')](function(_0x408efd){logger[_0x55d6('0x12')](_0x55d6('0x15'),_0x2624eb,_0x408efd);_0x310dce(_0x408efd);});});}