Built motion from commit f74363e9.|2.6.34
[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 _0x0f49=['../../config/logger','rpc','../../config/environment','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','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x0f49,0xb2));var _0x90f4=function(_0x3ce2c4,_0x4544c1){_0x3ce2c4=_0x3ce2c4-0x0;var _0x4047c1=_0x0f49[_0x3ce2c4];return _0x4047c1;};'use strict';var _=require('lodash');var util=require(_0x90f4('0x0'));var moment=require(_0x90f4('0x1'));var BPromise=require('bluebird');var rs=require(_0x90f4('0x2'));var fs=require('fs');var Redis=require(_0x90f4('0x3'));var db=require(_0x90f4('0x4'))['db'];var utils=require(_0x90f4('0x5'));var logger=require(_0x90f4('0x6'))(_0x90f4('0x7'));var config=require(_0x90f4('0x8'));var jayson=require(_0x90f4('0x9'));var client=jayson[_0x90f4('0xa')][_0x90f4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x91acbe,_0x4e0531,_0x32aea2){return new BPromise(function(_0x2aadc8,_0x384b77){return client[_0x90f4('0xc')](_0x91acbe,_0x32aea2)[_0x90f4('0xd')](function(_0x6d8d6e){logger[_0x90f4('0xe')](_0x90f4('0xf'),_0x4e0531,_0x90f4('0x10'));logger['debug'](_0x90f4('0x11'),_0x4e0531,_0x90f4('0x10'),JSON[_0x90f4('0x12')](_0x6d8d6e));if(_0x6d8d6e[_0x90f4('0x13')]){if(_0x6d8d6e[_0x90f4('0x13')][_0x90f4('0x14')]===0x1f4){logger[_0x90f4('0x13')]('ContactItemType,\x20%s,\x20%s',_0x4e0531,_0x6d8d6e['error']['message']);return _0x384b77(_0x6d8d6e[_0x90f4('0x13')][_0x90f4('0x15')]);}logger[_0x90f4('0x13')]('ContactItemType,\x20%s,\x20%s',_0x4e0531,_0x6d8d6e['error'][_0x90f4('0x15')]);return _0x2aadc8(_0x6d8d6e[_0x90f4('0x13')][_0x90f4('0x15')]);}else{logger[_0x90f4('0xe')](_0x90f4('0xf'),_0x4e0531,_0x90f4('0x10'));_0x2aadc8(_0x6d8d6e['result']['message']);}})[_0x90f4('0x16')](function(_0x4da2b6){logger[_0x90f4('0x13')](_0x90f4('0xf'),_0x4e0531,_0x4da2b6);_0x384b77(_0x4da2b6);});});}