Built motion from commit (unavailable).|2.5.23
[motion2.git] / server / api / tag / tag.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 _0xa902=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Tag,\x20%s,\x20%s','debug','Tag,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0xabfec4,_0x35076e){var _0x7bafa2=function(_0x52d551){while(--_0x52d551){_0xabfec4['push'](_0xabfec4['shift']());}};_0x7bafa2(++_0x35076e);}(_0xa902,0x8d));var _0x2a90=function(_0x325ae8,_0x2c21ba){_0x325ae8=_0x325ae8-0x0;var _0x4c272c=_0xa902[_0x325ae8];return _0x4c272c;};'use strict';var _=require(_0x2a90('0x0'));var util=require(_0x2a90('0x1'));var moment=require(_0x2a90('0x2'));var BPromise=require(_0x2a90('0x3'));var rs=require(_0x2a90('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2a90('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2a90('0x6'));var config=require(_0x2a90('0x7'));var jayson=require(_0x2a90('0x8'));var client=jayson[_0x2a90('0x9')][_0x2a90('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25bcfc,_0x58369a,_0x4109e6){return new BPromise(function(_0x570659,_0x5ec2b9){return client[_0x2a90('0xb')](_0x25bcfc,_0x4109e6)[_0x2a90('0xc')](function(_0xe500bc){logger[_0x2a90('0xd')](_0x2a90('0xe'),_0x58369a,'request\x20sent');logger[_0x2a90('0xf')](_0x2a90('0x10'),_0x58369a,_0x2a90('0x11'),JSON[_0x2a90('0x12')](_0xe500bc));if(_0xe500bc['error']){if(_0xe500bc[_0x2a90('0x13')]['code']===0x1f4){logger[_0x2a90('0x13')]('Tag,\x20%s,\x20%s',_0x58369a,_0xe500bc[_0x2a90('0x13')]['message']);return _0x5ec2b9(_0xe500bc[_0x2a90('0x13')][_0x2a90('0x14')]);}logger[_0x2a90('0x13')]('Tag,\x20%s,\x20%s',_0x58369a,_0xe500bc['error']['message']);return _0x570659(_0xe500bc[_0x2a90('0x13')][_0x2a90('0x14')]);}else{logger['info'](_0x2a90('0xe'),_0x58369a,_0x2a90('0x11'));_0x570659(_0xe500bc[_0x2a90('0x15')][_0x2a90('0x14')]);}})[_0x2a90('0x16')](function(_0x37858e){logger[_0x2a90('0x13')](_0x2a90('0xe'),_0x58369a,_0x37858e);_0x5ec2b9(_0x37858e);});});}