Built motion from commit (unavailable).|2.5.26
[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 _0xa3d3=['../../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','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2a6f07,_0x62162b){var _0x1a421b=function(_0x167513){while(--_0x167513){_0x2a6f07['push'](_0x2a6f07['shift']());}};_0x1a421b(++_0x62162b);}(_0xa3d3,0x70));var _0x3a3d=function(_0x20a558,_0x160e0e){_0x20a558=_0x20a558-0x0;var _0x53d3f7=_0xa3d3[_0x20a558];return _0x53d3f7;};'use strict';var _=require('lodash');var util=require(_0x3a3d('0x0'));var moment=require(_0x3a3d('0x1'));var BPromise=require(_0x3a3d('0x2'));var rs=require(_0x3a3d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3a3d('0x4'))['db'];var utils=require(_0x3a3d('0x5'));var logger=require(_0x3a3d('0x6'))(_0x3a3d('0x7'));var config=require(_0x3a3d('0x8'));var jayson=require(_0x3a3d('0x9'));var client=jayson[_0x3a3d('0xa')][_0x3a3d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16e59d,_0x3e1961,_0x13a108){return new BPromise(function(_0x42415e,_0x547e96){return client[_0x3a3d('0xc')](_0x16e59d,_0x13a108)[_0x3a3d('0xd')](function(_0x18bc37){logger[_0x3a3d('0xe')](_0x3a3d('0xf'),_0x3e1961,_0x3a3d('0x10'));logger[_0x3a3d('0x11')](_0x3a3d('0x12'),_0x3e1961,_0x3a3d('0x10'),JSON['stringify'](_0x18bc37));if(_0x18bc37['error']){if(_0x18bc37[_0x3a3d('0x13')][_0x3a3d('0x14')]===0x1f4){logger[_0x3a3d('0x13')]('CmCompany,\x20%s,\x20%s',_0x3e1961,_0x18bc37[_0x3a3d('0x13')][_0x3a3d('0x15')]);return _0x547e96(_0x18bc37['error'][_0x3a3d('0x15')]);}logger['error'](_0x3a3d('0xf'),_0x3e1961,_0x18bc37['error'][_0x3a3d('0x15')]);return _0x42415e(_0x18bc37[_0x3a3d('0x13')]['message']);}else{logger[_0x3a3d('0xe')](_0x3a3d('0xf'),_0x3e1961,_0x3a3d('0x10'));_0x42415e(_0x18bc37[_0x3a3d('0x16')][_0x3a3d('0x15')]);}})[_0x3a3d('0x17')](function(_0x32114f){logger[_0x3a3d('0x13')](_0x3a3d('0xf'),_0x3e1961,_0x32114f);_0x547e96(_0x32114f);});});}