99c3125d0aafdcba7841aef5d456f1fb8a943a6a
[motion2.git] / server / api / saCompanyRelationship / saCompanyRelationship.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 _0xcd6d=['then','info','SACompanyRelationship,\x20%s,\x20%s','debug','SACompanyRelationship,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x1ebbd0,_0x15c131){var _0x2dc063=function(_0x1cda93){while(--_0x1cda93){_0x1ebbd0['push'](_0x1ebbd0['shift']());}};_0x2dc063(++_0x15c131);}(_0xcd6d,0xfd));var _0xdcd6=function(_0x502f45,_0x308d02){_0x502f45=_0x502f45-0x0;var _0x30c21b=_0xcd6d[_0x502f45];return _0x30c21b;};'use strict';var _=require(_0xdcd6('0x0'));var util=require(_0xdcd6('0x1'));var moment=require(_0xdcd6('0x2'));var BPromise=require(_0xdcd6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdcd6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdcd6('0x5'));var logger=require(_0xdcd6('0x6'))(_0xdcd6('0x7'));var config=require(_0xdcd6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xdcd6('0x9')][_0xdcd6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xcd12df,_0x262417,_0x2b8c49){return new BPromise(function(_0x3c697b,_0x3d1751){return client['request'](_0xcd12df,_0x2b8c49)[_0xdcd6('0xb')](function(_0x3fa4f6){logger[_0xdcd6('0xc')](_0xdcd6('0xd'),_0x262417,'request\x20sent');logger[_0xdcd6('0xe')](_0xdcd6('0xf'),_0x262417,'request\x20sent',JSON[_0xdcd6('0x10')](_0x3fa4f6));if(_0x3fa4f6[_0xdcd6('0x11')]){if(_0x3fa4f6[_0xdcd6('0x11')][_0xdcd6('0x12')]===0x1f4){logger[_0xdcd6('0x11')](_0xdcd6('0xd'),_0x262417,_0x3fa4f6[_0xdcd6('0x11')][_0xdcd6('0x13')]);return _0x3d1751(_0x3fa4f6['error'][_0xdcd6('0x13')]);}logger[_0xdcd6('0x11')]('SACompanyRelationship,\x20%s,\x20%s',_0x262417,_0x3fa4f6['error'][_0xdcd6('0x13')]);return _0x3c697b(_0x3fa4f6[_0xdcd6('0x11')]['message']);}else{logger['info'](_0xdcd6('0xd'),_0x262417,_0xdcd6('0x14'));_0x3c697b(_0x3fa4f6[_0xdcd6('0x15')][_0xdcd6('0x13')]);}})['catch'](function(_0x435976){logger[_0xdcd6('0x11')]('SACompanyRelationship,\x20%s,\x20%s',_0x262417,_0x435976);_0x3d1751(_0x435976);});});}