Built motion from commit 85328c08.|2.5.50
[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 _0xe1b7=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0xe961d5,_0xabcb0d){var _0x3cf8c3=function(_0x273d93){while(--_0x273d93){_0xe961d5['push'](_0xe961d5['shift']());}};_0x3cf8c3(++_0xabcb0d);}(_0xe1b7,0x179));var _0x7e1b=function(_0x2219bd,_0x9cfd12){_0x2219bd=_0x2219bd-0x0;var _0xb72639=_0xe1b7[_0x2219bd];return _0xb72639;};'use strict';var _=require(_0x7e1b('0x0'));var util=require(_0x7e1b('0x1'));var moment=require(_0x7e1b('0x2'));var BPromise=require(_0x7e1b('0x3'));var rs=require(_0x7e1b('0x4'));var fs=require('fs');var Redis=require(_0x7e1b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7e1b('0x6'));var logger=require(_0x7e1b('0x7'))(_0x7e1b('0x8'));var config=require(_0x7e1b('0x9'));var jayson=require(_0x7e1b('0xa'));var client=jayson[_0x7e1b('0xb')][_0x7e1b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x515fc2,_0xaf42c,_0x5c610e){return new BPromise(function(_0x2a4339,_0x14e303){return client[_0x7e1b('0xd')](_0x515fc2,_0x5c610e)[_0x7e1b('0xe')](function(_0x501a17){logger[_0x7e1b('0xf')](_0x7e1b('0x10'),_0xaf42c,_0x7e1b('0x11'));logger[_0x7e1b('0x12')](_0x7e1b('0x13'),_0xaf42c,'request\x20sent',JSON[_0x7e1b('0x14')](_0x501a17));if(_0x501a17[_0x7e1b('0x15')]){if(_0x501a17[_0x7e1b('0x15')]['code']===0x1f4){logger['error'](_0x7e1b('0x10'),_0xaf42c,_0x501a17['error'][_0x7e1b('0x16')]);return _0x14e303(_0x501a17['error']['message']);}logger[_0x7e1b('0x15')](_0x7e1b('0x10'),_0xaf42c,_0x501a17['error'][_0x7e1b('0x16')]);return _0x2a4339(_0x501a17[_0x7e1b('0x15')][_0x7e1b('0x16')]);}else{logger[_0x7e1b('0xf')](_0x7e1b('0x10'),_0xaf42c,_0x7e1b('0x11'));_0x2a4339(_0x501a17[_0x7e1b('0x17')]['message']);}})[_0x7e1b('0x18')](function(_0x4746bd){logger[_0x7e1b('0x15')](_0x7e1b('0x10'),_0xaf42c,_0x4746bd);_0x14e303(_0x4746bd);});});}