Built motion from commit (unavailable).|2.5.29
[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 _0xc854=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xc7b40c,_0x34c13d){var _0x10ede3=function(_0x2a2273){while(--_0x2a2273){_0xc7b40c['push'](_0xc7b40c['shift']());}};_0x10ede3(++_0x34c13d);}(_0xc854,0xd5));var _0x4c85=function(_0x19ef32,_0x3b78ff){_0x19ef32=_0x19ef32-0x0;var _0x20034e=_0xc854[_0x19ef32];return _0x20034e;};'use strict';var _=require(_0x4c85('0x0'));var util=require(_0x4c85('0x1'));var moment=require(_0x4c85('0x2'));var BPromise=require(_0x4c85('0x3'));var rs=require(_0x4c85('0x4'));var fs=require('fs');var Redis=require(_0x4c85('0x5'));var db=require(_0x4c85('0x6'))['db'];var utils=require(_0x4c85('0x7'));var logger=require(_0x4c85('0x8'))(_0x4c85('0x9'));var config=require(_0x4c85('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x4c85('0xb')][_0x4c85('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x33c4e6,_0x2ba80a,_0x3eb68c){return new BPromise(function(_0x30b266,_0x1da6eb){return client['request'](_0x33c4e6,_0x3eb68c)[_0x4c85('0xd')](function(_0x35f29f){logger['info'](_0x4c85('0xe'),_0x2ba80a,_0x4c85('0xf'));logger[_0x4c85('0x10')](_0x4c85('0x11'),_0x2ba80a,_0x4c85('0xf'),JSON[_0x4c85('0x12')](_0x35f29f));if(_0x35f29f[_0x4c85('0x13')]){if(_0x35f29f[_0x4c85('0x13')]['code']===0x1f4){logger[_0x4c85('0x13')]('CmCompany,\x20%s,\x20%s',_0x2ba80a,_0x35f29f[_0x4c85('0x13')][_0x4c85('0x14')]);return _0x1da6eb(_0x35f29f[_0x4c85('0x13')][_0x4c85('0x14')]);}logger[_0x4c85('0x13')](_0x4c85('0xe'),_0x2ba80a,_0x35f29f['error']['message']);return _0x30b266(_0x35f29f['error'][_0x4c85('0x14')]);}else{logger['info'](_0x4c85('0xe'),_0x2ba80a,_0x4c85('0xf'));_0x30b266(_0x35f29f['result'][_0x4c85('0x14')]);}})[_0x4c85('0x15')](function(_0xda3803){logger[_0x4c85('0x13')](_0x4c85('0xe'),_0x2ba80a,_0xda3803);_0x1da6eb(_0xda3803);});});}