Built motion from commit (unavailable).|2.4.11
[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 _0x6acc=['request\x20sent','JscriptyProject,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyProject,\x20%s,\x20%s'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6acc,0xd5));var _0xc6ac=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0x6acc[_0x476bf4];return _0x788ffe;};'use strict';var _=require(_0xc6ac('0x0'));var util=require('util');var moment=require(_0xc6ac('0x1'));var BPromise=require(_0xc6ac('0x2'));var rs=require(_0xc6ac('0x3'));var fs=require('fs');var Redis=require(_0xc6ac('0x4'));var db=require(_0xc6ac('0x5'))['db'];var utils=require(_0xc6ac('0x6'));var logger=require(_0xc6ac('0x7'))(_0xc6ac('0x8'));var config=require(_0xc6ac('0x9'));var jayson=require(_0xc6ac('0xa'));var client=jayson[_0xc6ac('0xb')][_0xc6ac('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x16d06c,_0x4d7315,_0x1300b7){return new BPromise(function(_0x5d7a41,_0x9f07b3){return client[_0xc6ac('0xd')](_0x16d06c,_0x1300b7)[_0xc6ac('0xe')](function(_0x16ae24){logger[_0xc6ac('0xf')](_0xc6ac('0x10'),_0x4d7315,_0xc6ac('0x11'));logger['debug'](_0xc6ac('0x12'),_0x4d7315,'request\x20sent',JSON['stringify'](_0x16ae24));if(_0x16ae24[_0xc6ac('0x13')]){if(_0x16ae24[_0xc6ac('0x13')][_0xc6ac('0x14')]===0x1f4){logger[_0xc6ac('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x4d7315,_0x16ae24[_0xc6ac('0x13')][_0xc6ac('0x15')]);return _0x9f07b3(_0x16ae24['error']['message']);}logger[_0xc6ac('0x13')](_0xc6ac('0x10'),_0x4d7315,_0x16ae24['error'][_0xc6ac('0x15')]);return _0x5d7a41(_0x16ae24[_0xc6ac('0x13')][_0xc6ac('0x15')]);}else{logger[_0xc6ac('0xf')](_0xc6ac('0x10'),_0x4d7315,_0xc6ac('0x11'));_0x5d7a41(_0x16ae24[_0xc6ac('0x16')]['message']);}})['catch'](function(_0x5eb9c6){logger[_0xc6ac('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x4d7315,_0x5eb9c6);_0x9f07b3(_0x5eb9c6);});});}