Built motion from commit f7863d46.|2.5.41
[motion2.git] / server / api / cmCustomField / cmCustomField.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 _0x149f=['request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCustomField,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x5e9d35,_0x382c91){var _0x3beb2e=function(_0x4242cf){while(--_0x4242cf){_0x5e9d35['push'](_0x5e9d35['shift']());}};_0x3beb2e(++_0x382c91);}(_0x149f,0x180));var _0xf149=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x149f[_0x2be8c2];return _0x97f531;};'use strict';var _=require(_0xf149('0x0'));var util=require('util');var moment=require(_0xf149('0x1'));var BPromise=require('bluebird');var rs=require(_0xf149('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf149('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf149('0x4'))('rpc');var config=require(_0xf149('0x5'));var jayson=require(_0xf149('0x6'));var client=jayson[_0xf149('0x7')][_0xf149('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x928877,_0xaf824d,_0x46ddcc){return new BPromise(function(_0x704d26,_0x4184a0){return client[_0xf149('0x9')](_0x928877,_0x46ddcc)[_0xf149('0xa')](function(_0x5076e2){logger[_0xf149('0xb')]('CmCustomField,\x20%s,\x20%s',_0xaf824d,_0xf149('0xc'));logger[_0xf149('0xd')](_0xf149('0xe'),_0xaf824d,_0xf149('0xc'),JSON[_0xf149('0xf')](_0x5076e2));if(_0x5076e2[_0xf149('0x10')]){if(_0x5076e2[_0xf149('0x10')][_0xf149('0x11')]===0x1f4){logger[_0xf149('0x10')](_0xf149('0x12'),_0xaf824d,_0x5076e2[_0xf149('0x10')][_0xf149('0x13')]);return _0x4184a0(_0x5076e2['error'][_0xf149('0x13')]);}logger[_0xf149('0x10')]('CmCustomField,\x20%s,\x20%s',_0xaf824d,_0x5076e2[_0xf149('0x10')][_0xf149('0x13')]);return _0x704d26(_0x5076e2[_0xf149('0x10')][_0xf149('0x13')]);}else{logger[_0xf149('0xb')](_0xf149('0x12'),_0xaf824d,'request\x20sent');_0x704d26(_0x5076e2[_0xf149('0x14')][_0xf149('0x13')]);}})[_0xf149('0x15')](function(_0x34f674){logger['error']('CmCustomField,\x20%s,\x20%s',_0xaf824d,_0x34f674);_0x4184a0(_0x34f674);});});}