Built motion from commit (unavailable).|2.4.4
[motion2.git] / server / api / saAsset / saAsset.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 _0x674b=['info','SAAsset,\x20%s,\x20%s','request\x20sent','debug','SAAsset,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0xe1b102,_0x542a72){var _0xed6dcc=function(_0x3191a6){while(--_0x3191a6){_0xe1b102['push'](_0xe1b102['shift']());}};_0xed6dcc(++_0x542a72);}(_0x674b,0x182));var _0xb674=function(_0x2c50a6,_0x2a9854){_0x2c50a6=_0x2c50a6-0x0;var _0x3e6556=_0x674b[_0x2c50a6];return _0x3e6556;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb674('0x0'));var BPromise=require(_0xb674('0x1'));var rs=require(_0xb674('0x2'));var fs=require('fs');var Redis=require(_0xb674('0x3'));var db=require(_0xb674('0x4'))['db'];var utils=require(_0xb674('0x5'));var logger=require(_0xb674('0x6'))(_0xb674('0x7'));var config=require(_0xb674('0x8'));var jayson=require(_0xb674('0x9'));var client=jayson[_0xb674('0xa')][_0xb674('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b364c,_0x132804,_0x5d3979){return new BPromise(function(_0x4278cd,_0x321587){return client[_0xb674('0xc')](_0x1b364c,_0x5d3979)[_0xb674('0xd')](function(_0x40af2d){logger[_0xb674('0xe')](_0xb674('0xf'),_0x132804,_0xb674('0x10'));logger[_0xb674('0x11')](_0xb674('0x12'),_0x132804,_0xb674('0x10'),JSON[_0xb674('0x13')](_0x40af2d));if(_0x40af2d[_0xb674('0x14')]){if(_0x40af2d[_0xb674('0x14')][_0xb674('0x15')]===0x1f4){logger[_0xb674('0x14')](_0xb674('0xf'),_0x132804,_0x40af2d[_0xb674('0x14')]['message']);return _0x321587(_0x40af2d[_0xb674('0x14')][_0xb674('0x16')]);}logger['error'](_0xb674('0xf'),_0x132804,_0x40af2d[_0xb674('0x14')]['message']);return _0x4278cd(_0x40af2d[_0xb674('0x14')]['message']);}else{logger[_0xb674('0xe')](_0xb674('0xf'),_0x132804,_0xb674('0x10'));_0x4278cd(_0x40af2d[_0xb674('0x17')]['message']);}})[_0xb674('0x18')](function(_0x413183){logger['error'](_0xb674('0xf'),_0x132804,_0x413183);_0x321587(_0x413183);});});}