Built motion from commit (unavailable).|2.3.4
[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 _0x72da=['info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0xc368af,_0x1a5b71){var _0x1dcbc6=function(_0x4f648f){while(--_0x4f648f){_0xc368af['push'](_0xc368af['shift']());}};_0x1dcbc6(++_0x1a5b71);}(_0x72da,0xca));var _0xa72d=function(_0x2d1cf4,_0x2ea9ee){_0x2d1cf4=_0x2d1cf4-0x0;var _0x554a7c=_0x72da[_0x2d1cf4];return _0x554a7c;};'use strict';var _=require(_0xa72d('0x0'));var util=require(_0xa72d('0x1'));var moment=require(_0xa72d('0x2'));var BPromise=require('bluebird');var rs=require(_0xa72d('0x3'));var fs=require('fs');var Redis=require(_0xa72d('0x4'));var db=require(_0xa72d('0x5'))['db'];var utils=require(_0xa72d('0x6'));var logger=require(_0xa72d('0x7'))(_0xa72d('0x8'));var config=require(_0xa72d('0x9'));var jayson=require(_0xa72d('0xa'));var client=jayson[_0xa72d('0xb')][_0xa72d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2028c3,_0x508098,_0x18b326){return new BPromise(function(_0x4a5118,_0x572f3f){return client['request'](_0x2028c3,_0x18b326)[_0xa72d('0xd')](function(_0x49f9c7){logger[_0xa72d('0xe')](_0xa72d('0xf'),_0x508098,_0xa72d('0x10'));logger[_0xa72d('0x11')](_0xa72d('0x12'),_0x508098,'request\x20sent',JSON['stringify'](_0x49f9c7));if(_0x49f9c7[_0xa72d('0x13')]){if(_0x49f9c7['error'][_0xa72d('0x14')]===0x1f4){logger['error'](_0xa72d('0xf'),_0x508098,_0x49f9c7['error'][_0xa72d('0x15')]);return _0x572f3f(_0x49f9c7[_0xa72d('0x13')][_0xa72d('0x15')]);}logger[_0xa72d('0x13')]('Tag,\x20%s,\x20%s',_0x508098,_0x49f9c7[_0xa72d('0x13')][_0xa72d('0x15')]);return _0x4a5118(_0x49f9c7[_0xa72d('0x13')][_0xa72d('0x15')]);}else{logger[_0xa72d('0xe')](_0xa72d('0xf'),_0x508098,'request\x20sent');_0x4a5118(_0x49f9c7[_0xa72d('0x16')]['message']);}})[_0xa72d('0x17')](function(_0x5350a5){logger[_0xa72d('0x13')](_0xa72d('0xf'),_0x508098,_0x5350a5);_0x572f3f(_0x5350a5);});});}