25f88796da0aadf43bbe9a910883bea83bd9e0a0
[motion2.git] / server / api / userProfileSection / userProfileSection.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 _0x28fd=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment'];(function(_0x92bfee,_0x432620){var _0x49cca2=function(_0x8336a4){while(--_0x8336a4){_0x92bfee['push'](_0x92bfee['shift']());}};_0x49cca2(++_0x432620);}(_0x28fd,0x135));var _0xd28f=function(_0x24fa1a,_0x16d9c2){_0x24fa1a=_0x24fa1a-0x0;var _0xc5621f=_0x28fd[_0x24fa1a];return _0xc5621f;};'use strict';var _=require(_0xd28f('0x0'));var util=require(_0xd28f('0x1'));var moment=require(_0xd28f('0x2'));var BPromise=require(_0xd28f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd28f('0x4'));var db=require(_0xd28f('0x5'))['db'];var utils=require(_0xd28f('0x6'));var logger=require(_0xd28f('0x7'))(_0xd28f('0x8'));var config=require(_0xd28f('0x9'));var jayson=require(_0xd28f('0xa'));var client=jayson[_0xd28f('0xb')][_0xd28f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x58c5f8,_0x2eda16,_0x28acdf){return new BPromise(function(_0x1ffa2c,_0x307a2e){return client[_0xd28f('0xd')](_0x58c5f8,_0x28acdf)[_0xd28f('0xe')](function(_0x46c5cc){logger[_0xd28f('0xf')](_0xd28f('0x10'),_0x2eda16,_0xd28f('0x11'));logger['debug'](_0xd28f('0x12'),_0x2eda16,_0xd28f('0x11'),JSON[_0xd28f('0x13')](_0x46c5cc));if(_0x46c5cc[_0xd28f('0x14')]){if(_0x46c5cc[_0xd28f('0x14')]['code']===0x1f4){logger['error'](_0xd28f('0x10'),_0x2eda16,_0x46c5cc[_0xd28f('0x14')][_0xd28f('0x15')]);return _0x307a2e(_0x46c5cc[_0xd28f('0x14')][_0xd28f('0x15')]);}logger[_0xd28f('0x14')]('UserProfileSection,\x20%s,\x20%s',_0x2eda16,_0x46c5cc[_0xd28f('0x14')][_0xd28f('0x15')]);return _0x1ffa2c(_0x46c5cc[_0xd28f('0x14')][_0xd28f('0x15')]);}else{logger[_0xd28f('0xf')]('UserProfileSection,\x20%s,\x20%s',_0x2eda16,_0xd28f('0x11'));_0x1ffa2c(_0x46c5cc[_0xd28f('0x16')][_0xd28f('0x15')]);}})[_0xd28f('0x17')](function(_0x594e7a){logger['error'](_0xd28f('0x10'),_0x2eda16,_0x594e7a);_0x307a2e(_0x594e7a);});});}