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 _0x901d=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','error','code','CmCompany,\x20%s,\x20%s','message','result','catch'];(function(_0x56a756,_0xd33ea2){var _0x475344=function(_0x2c1419){while(--_0x2c1419){_0x56a756['push'](_0x56a756['shift']());}};_0x475344(++_0xd33ea2);}(_0x901d,0xb0));var _0xd901=function(_0x2311b1,_0x2ec25d){_0x2311b1=_0x2311b1-0x0;var _0x1ae21c=_0x901d[_0x2311b1];return _0x1ae21c;};'use strict';var _=require(_0xd901('0x0'));var util=require(_0xd901('0x1'));var moment=require(_0xd901('0x2'));var BPromise=require(_0xd901('0x3'));var rs=require(_0xd901('0x4'));var fs=require('fs');var Redis=require(_0xd901('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd901('0x6'));var logger=require(_0xd901('0x7'))(_0xd901('0x8'));var config=require(_0xd901('0x9'));var jayson=require(_0xd901('0xa'));var client=jayson[_0xd901('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a2b18,_0x3a228b,_0x52e7c8){return new BPromise(function(_0x536580,_0x36778c){return client['request'](_0x5a2b18,_0x52e7c8)[_0xd901('0xc')](function(_0x2e1741){logger[_0xd901('0xd')]('CmCompany,\x20%s,\x20%s',_0x3a228b,_0xd901('0xe'));logger[_0xd901('0xf')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x3a228b,_0xd901('0xe'),JSON['stringify'](_0x2e1741));if(_0x2e1741[_0xd901('0x10')]){if(_0x2e1741[_0xd901('0x10')][_0xd901('0x11')]===0x1f4){logger['error'](_0xd901('0x12'),_0x3a228b,_0x2e1741[_0xd901('0x10')]['message']);return _0x36778c(_0x2e1741[_0xd901('0x10')][_0xd901('0x13')]);}logger[_0xd901('0x10')]('CmCompany,\x20%s,\x20%s',_0x3a228b,_0x2e1741['error'][_0xd901('0x13')]);return _0x536580(_0x2e1741[_0xd901('0x10')][_0xd901('0x13')]);}else{logger[_0xd901('0xd')]('CmCompany,\x20%s,\x20%s',_0x3a228b,'request\x20sent');_0x536580(_0x2e1741[_0xd901('0x14')][_0xd901('0x13')]);}})[_0xd901('0x15')](function(_0xf96f9c){logger[_0xd901('0x10')](_0xd901('0x12'),_0x3a228b,_0xf96f9c);_0x36778c(_0xf96f9c);});});}