Built motion from commit 639a1a7f.|2.6.19
[motion2.git] / server / api / contactItemType / contactItemType.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 _0x3407=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird'];(function(_0x180f68,_0xf2efe9){var _0x5db9c4=function(_0x447cf5){while(--_0x447cf5){_0x180f68['push'](_0x180f68['shift']());}};_0x5db9c4(++_0xf2efe9);}(_0x3407,0x1c8));var _0x7340=function(_0x568696,_0x9a9454){_0x568696=_0x568696-0x0;var _0x27ec2b=_0x3407[_0x568696];return _0x27ec2b;};'use strict';var _=require(_0x7340('0x0'));var util=require(_0x7340('0x1'));var moment=require(_0x7340('0x2'));var BPromise=require(_0x7340('0x3'));var rs=require(_0x7340('0x4'));var fs=require('fs');var Redis=require(_0x7340('0x5'));var db=require(_0x7340('0x6'))['db'];var utils=require(_0x7340('0x7'));var logger=require(_0x7340('0x8'))(_0x7340('0x9'));var config=require(_0x7340('0xa'));var jayson=require(_0x7340('0xb'));var client=jayson[_0x7340('0xc')][_0x7340('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5ea01b,_0xd132c7,_0x2bc5d4){return new BPromise(function(_0x57b87c,_0x3645fc){return client['request'](_0x5ea01b,_0x2bc5d4)[_0x7340('0xe')](function(_0x4efc73){logger['info'](_0x7340('0xf'),_0xd132c7,_0x7340('0x10'));logger[_0x7340('0x11')](_0x7340('0x12'),_0xd132c7,_0x7340('0x10'),JSON[_0x7340('0x13')](_0x4efc73));if(_0x4efc73['error']){if(_0x4efc73[_0x7340('0x14')]['code']===0x1f4){logger[_0x7340('0x14')](_0x7340('0xf'),_0xd132c7,_0x4efc73[_0x7340('0x14')][_0x7340('0x15')]);return _0x3645fc(_0x4efc73[_0x7340('0x14')]['message']);}logger[_0x7340('0x14')](_0x7340('0xf'),_0xd132c7,_0x4efc73['error']['message']);return _0x57b87c(_0x4efc73['error']['message']);}else{logger['info'](_0x7340('0xf'),_0xd132c7,'request\x20sent');_0x57b87c(_0x4efc73['result'][_0x7340('0x15')]);}})[_0x7340('0x16')](function(_0x224f9b){logger['error'](_0x7340('0xf'),_0xd132c7,_0x224f9b);_0x3645fc(_0x224f9b);});});}