Built motion from commit da617fac.|2.6.6
[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 _0xcb1c=['result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x2b0fed,_0x2a4779){var _0x34bfad=function(_0x47852b){while(--_0x47852b){_0x2b0fed['push'](_0x2b0fed['shift']());}};_0x34bfad(++_0x2a4779);}(_0xcb1c,0x1e6));var _0xccb1=function(_0x3a17b0,_0x32a3b6){_0x3a17b0=_0x3a17b0-0x0;var _0xda8c4=_0xcb1c[_0x3a17b0];return _0xda8c4;};'use strict';var _=require(_0xccb1('0x0'));var util=require(_0xccb1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xccb1('0x2'));var fs=require('fs');var Redis=require(_0xccb1('0x3'));var db=require(_0xccb1('0x4'))['db'];var utils=require(_0xccb1('0x5'));var logger=require(_0xccb1('0x6'))(_0xccb1('0x7'));var config=require(_0xccb1('0x8'));var jayson=require(_0xccb1('0x9'));var client=jayson['client'][_0xccb1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x12730c,_0x4f8ace,_0x43d6f9){return new BPromise(function(_0x7e694d,_0x462892){return client[_0xccb1('0xb')](_0x12730c,_0x43d6f9)[_0xccb1('0xc')](function(_0x6be1ce){logger[_0xccb1('0xd')](_0xccb1('0xe'),_0x4f8ace,_0xccb1('0xf'));logger['debug'](_0xccb1('0x10'),_0x4f8ace,_0xccb1('0xf'),JSON[_0xccb1('0x11')](_0x6be1ce));if(_0x6be1ce['error']){if(_0x6be1ce[_0xccb1('0x12')]['code']===0x1f4){logger[_0xccb1('0x12')](_0xccb1('0xe'),_0x4f8ace,_0x6be1ce[_0xccb1('0x12')]['message']);return _0x462892(_0x6be1ce[_0xccb1('0x12')]['message']);}logger[_0xccb1('0x12')]('CmCompany,\x20%s,\x20%s',_0x4f8ace,_0x6be1ce[_0xccb1('0x12')]['message']);return _0x7e694d(_0x6be1ce[_0xccb1('0x12')][_0xccb1('0x13')]);}else{logger[_0xccb1('0xd')]('CmCompany,\x20%s,\x20%s',_0x4f8ace,_0xccb1('0xf'));_0x7e694d(_0x6be1ce[_0xccb1('0x14')][_0xccb1('0x13')]);}})[_0xccb1('0x15')](function(_0x11791b){logger[_0xccb1('0x12')](_0xccb1('0xe'),_0x4f8ace,_0x11791b);_0x462892(_0x11791b);});});}