Built motion from commit (unavailable).|2.4.4
[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 _0xfc27=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SACompanyRelationship,\x20%s,\x20%s','request\x20sent','debug','SACompanyRelationship,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','ioredis'];(function(_0x1fb938,_0x1fa88f){var _0x35315f=function(_0x34c526){while(--_0x34c526){_0x1fb938['push'](_0x1fb938['shift']());}};_0x35315f(++_0x1fa88f);}(_0xfc27,0x14e));var _0x7fc2=function(_0x234841,_0x180393){_0x234841=_0x234841-0x0;var _0x34a939=_0xfc27[_0x234841];return _0x34a939;};'use strict';var _=require('lodash');var util=require(_0x7fc2('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7fc2('0x1'));var db=require(_0x7fc2('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x7fc2('0x3'))(_0x7fc2('0x4'));var config=require(_0x7fc2('0x5'));var jayson=require(_0x7fc2('0x6'));var client=jayson[_0x7fc2('0x7')][_0x7fc2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5df1ff,_0x4fa7cb,_0x274694){return new BPromise(function(_0x363b44,_0x2ef69d){return client['request'](_0x5df1ff,_0x274694)[_0x7fc2('0x9')](function(_0xbbbc9a){logger[_0x7fc2('0xa')](_0x7fc2('0xb'),_0x4fa7cb,_0x7fc2('0xc'));logger[_0x7fc2('0xd')](_0x7fc2('0xe'),_0x4fa7cb,_0x7fc2('0xc'),JSON[_0x7fc2('0xf')](_0xbbbc9a));if(_0xbbbc9a[_0x7fc2('0x10')]){if(_0xbbbc9a[_0x7fc2('0x10')][_0x7fc2('0x11')]===0x1f4){logger['error'](_0x7fc2('0xb'),_0x4fa7cb,_0xbbbc9a['error'][_0x7fc2('0x12')]);return _0x2ef69d(_0xbbbc9a[_0x7fc2('0x10')][_0x7fc2('0x12')]);}logger['error']('SACompanyRelationship,\x20%s,\x20%s',_0x4fa7cb,_0xbbbc9a[_0x7fc2('0x10')][_0x7fc2('0x12')]);return _0x363b44(_0xbbbc9a[_0x7fc2('0x10')][_0x7fc2('0x12')]);}else{logger['info'](_0x7fc2('0xb'),_0x4fa7cb,_0x7fc2('0xc'));_0x363b44(_0xbbbc9a[_0x7fc2('0x13')][_0x7fc2('0x12')]);}})[_0x7fc2('0x14')](function(_0xb5de09){logger[_0x7fc2('0x10')](_0x7fc2('0xb'),_0x4fa7cb,_0xb5de09);_0x2ef69d(_0xb5de09);});});}