0d36fb27d2b11f059bf8c01ce3ed3eb13c9c09a3
[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 _0x620f=['../../mysqldb','rpc','jayson/promise','client','http','request','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis'];(function(_0x2be3a1,_0x133950){var _0x149877=function(_0x4c92cc){while(--_0x4c92cc){_0x2be3a1['push'](_0x2be3a1['shift']());}};_0x149877(++_0x133950);}(_0x620f,0x160));var _0xf620=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x620f[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0xf620('0x0'));var util=require(_0xf620('0x1'));var moment=require(_0xf620('0x2'));var BPromise=require('bluebird');var rs=require(_0xf620('0x3'));var fs=require('fs');var Redis=require(_0xf620('0x4'));var db=require(_0xf620('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf620('0x6'));var config=require('../../config/environment');var jayson=require(_0xf620('0x7'));var client=jayson[_0xf620('0x8')][_0xf620('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x288521,_0x1c308b,_0x17c0c1){return new BPromise(function(_0x98379c,_0x54231d){return client[_0xf620('0xa')](_0x288521,_0x17c0c1)[_0xf620('0xb')](function(_0x5924d7){logger[_0xf620('0xc')](_0xf620('0xd'),_0x1c308b,_0xf620('0xe'));logger['debug'](_0xf620('0xf'),_0x1c308b,_0xf620('0xe'),JSON[_0xf620('0x10')](_0x5924d7));if(_0x5924d7[_0xf620('0x11')]){if(_0x5924d7[_0xf620('0x11')][_0xf620('0x12')]===0x1f4){logger[_0xf620('0x11')](_0xf620('0xd'),_0x1c308b,_0x5924d7[_0xf620('0x11')][_0xf620('0x13')]);return _0x54231d(_0x5924d7[_0xf620('0x11')][_0xf620('0x13')]);}logger[_0xf620('0x11')](_0xf620('0xd'),_0x1c308b,_0x5924d7[_0xf620('0x11')]['message']);return _0x98379c(_0x5924d7[_0xf620('0x11')][_0xf620('0x13')]);}else{logger[_0xf620('0xc')](_0xf620('0xd'),_0x1c308b,'request\x20sent');_0x98379c(_0x5924d7[_0xf620('0x14')]['message']);}})['catch'](function(_0x18f05f){logger[_0xf620('0x11')](_0xf620('0xd'),_0x1c308b,_0x18f05f);_0x54231d(_0x18f05f);});});}