Built motion from commit c738b9ac.|2.6.25
[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 _0x9538=['../../mysqldb','../../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','error','code','message','result','catch','lodash','util','moment','ioredis'];(function(_0x25aa8a,_0x28aee0){var _0x310b06=function(_0x523775){while(--_0x523775){_0x25aa8a['push'](_0x25aa8a['shift']());}};_0x310b06(++_0x28aee0);}(_0x9538,0x74));var _0x8953=function(_0x5c5f44,_0x469cd8){_0x5c5f44=_0x5c5f44-0x0;var _0x38625d=_0x9538[_0x5c5f44];return _0x38625d;};'use strict';var _=require(_0x8953('0x0'));var util=require(_0x8953('0x1'));var moment=require(_0x8953('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8953('0x3'));var db=require(_0x8953('0x4'))['db'];var utils=require(_0x8953('0x5'));var logger=require(_0x8953('0x6'))(_0x8953('0x7'));var config=require(_0x8953('0x8'));var jayson=require(_0x8953('0x9'));var client=jayson[_0x8953('0xa')][_0x8953('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x59f2b5,_0x5b90c4,_0x478bc8){return new BPromise(function(_0x1af293,_0x16ba1d){return client[_0x8953('0xc')](_0x59f2b5,_0x478bc8)[_0x8953('0xd')](function(_0x4b2b0f){logger[_0x8953('0xe')](_0x8953('0xf'),_0x5b90c4,_0x8953('0x10'));logger[_0x8953('0x11')](_0x8953('0x12'),_0x5b90c4,_0x8953('0x10'),JSON['stringify'](_0x4b2b0f));if(_0x4b2b0f[_0x8953('0x13')]){if(_0x4b2b0f[_0x8953('0x13')][_0x8953('0x14')]===0x1f4){logger[_0x8953('0x13')](_0x8953('0xf'),_0x5b90c4,_0x4b2b0f[_0x8953('0x13')][_0x8953('0x15')]);return _0x16ba1d(_0x4b2b0f['error']['message']);}logger[_0x8953('0x13')]('CmCompany,\x20%s,\x20%s',_0x5b90c4,_0x4b2b0f[_0x8953('0x13')][_0x8953('0x15')]);return _0x1af293(_0x4b2b0f[_0x8953('0x13')][_0x8953('0x15')]);}else{logger[_0x8953('0xe')](_0x8953('0xf'),_0x5b90c4,_0x8953('0x10'));_0x1af293(_0x4b2b0f[_0x8953('0x16')][_0x8953('0x15')]);}})[_0x8953('0x17')](function(_0x3e7212){logger['error'](_0x8953('0xf'),_0x5b90c4,_0x3e7212);_0x16ba1d(_0x3e7212);});});}