Built motion from commit (unavailable).|2.5.1
[motion2.git] / server / api / jscriptyProject / jscriptyProject.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 _0x34cd=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','lodash','util','moment'];(function(_0x3f1861,_0x7b4285){var _0x7ca70a=function(_0x119b09){while(--_0x119b09){_0x3f1861['push'](_0x3f1861['shift']());}};_0x7ca70a(++_0x7b4285);}(_0x34cd,0x6b));var _0xd34c=function(_0x5f5b04,_0x57cc4e){_0x5f5b04=_0x5f5b04-0x0;var _0x2ba5f7=_0x34cd[_0x5f5b04];return _0x2ba5f7;};'use strict';var _=require(_0xd34c('0x0'));var util=require(_0xd34c('0x1'));var moment=require(_0xd34c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd34c('0x3'));var db=require(_0xd34c('0x4'))['db'];var utils=require(_0xd34c('0x5'));var logger=require(_0xd34c('0x6'))(_0xd34c('0x7'));var config=require(_0xd34c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd34c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d1b01,_0x4670c,_0x362428){return new BPromise(function(_0xb63ddd,_0x5c4438){return client[_0xd34c('0xa')](_0x1d1b01,_0x362428)[_0xd34c('0xb')](function(_0x7b7924){logger[_0xd34c('0xc')](_0xd34c('0xd'),_0x4670c,_0xd34c('0xe'));logger[_0xd34c('0xf')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x4670c,_0xd34c('0xe'),JSON[_0xd34c('0x10')](_0x7b7924));if(_0x7b7924['error']){if(_0x7b7924['error'][_0xd34c('0x11')]===0x1f4){logger[_0xd34c('0x12')](_0xd34c('0xd'),_0x4670c,_0x7b7924[_0xd34c('0x12')]['message']);return _0x5c4438(_0x7b7924[_0xd34c('0x12')][_0xd34c('0x13')]);}logger['error']('JscriptyProject,\x20%s,\x20%s',_0x4670c,_0x7b7924[_0xd34c('0x12')][_0xd34c('0x13')]);return _0xb63ddd(_0x7b7924[_0xd34c('0x12')][_0xd34c('0x13')]);}else{logger['info'](_0xd34c('0xd'),_0x4670c,'request\x20sent');_0xb63ddd(_0x7b7924[_0xd34c('0x14')][_0xd34c('0x13')]);}})[_0xd34c('0x15')](function(_0x8f1d42){logger['error'](_0xd34c('0xd'),_0x4670c,_0x8f1d42);_0x5c4438(_0x8f1d42);});});}