Built motion from commit da24aabd.|2.6.20
[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 _0xb08f=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x486df7,_0x5f803a){var _0x3c0d43=function(_0x154c7c){while(--_0x154c7c){_0x486df7['push'](_0x486df7['shift']());}};_0x3c0d43(++_0x5f803a);}(_0xb08f,0x1d7));var _0xfb08=function(_0x4b802b,_0x4b55bb){_0x4b802b=_0x4b802b-0x0;var _0x70ff8e=_0xb08f[_0x4b802b];return _0x70ff8e;};'use strict';var _=require(_0xfb08('0x0'));var util=require('util');var moment=require(_0xfb08('0x1'));var BPromise=require(_0xfb08('0x2'));var rs=require(_0xfb08('0x3'));var fs=require('fs');var Redis=require(_0xfb08('0x4'));var db=require(_0xfb08('0x5'))['db'];var utils=require(_0xfb08('0x6'));var logger=require(_0xfb08('0x7'))(_0xfb08('0x8'));var config=require(_0xfb08('0x9'));var jayson=require(_0xfb08('0xa'));var client=jayson[_0xfb08('0xb')][_0xfb08('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xd6db73,_0x191159,_0x23af57){return new BPromise(function(_0x59f4a5,_0x505268){return client[_0xfb08('0xd')](_0xd6db73,_0x23af57)[_0xfb08('0xe')](function(_0x35e109){logger['info'](_0xfb08('0xf'),_0x191159,_0xfb08('0x10'));logger[_0xfb08('0x11')](_0xfb08('0x12'),_0x191159,_0xfb08('0x10'),JSON['stringify'](_0x35e109));if(_0x35e109[_0xfb08('0x13')]){if(_0x35e109['error'][_0xfb08('0x14')]===0x1f4){logger[_0xfb08('0x13')]('CmCustomField,\x20%s,\x20%s',_0x191159,_0x35e109[_0xfb08('0x13')][_0xfb08('0x15')]);return _0x505268(_0x35e109[_0xfb08('0x13')][_0xfb08('0x15')]);}logger['error'](_0xfb08('0xf'),_0x191159,_0x35e109['error'][_0xfb08('0x15')]);return _0x59f4a5(_0x35e109['error'][_0xfb08('0x15')]);}else{logger[_0xfb08('0x16')](_0xfb08('0xf'),_0x191159,_0xfb08('0x10'));_0x59f4a5(_0x35e109[_0xfb08('0x17')][_0xfb08('0x15')]);}})[_0xfb08('0x18')](function(_0x2108a6){logger[_0xfb08('0x13')](_0xfb08('0xf'),_0x191159,_0x2108a6);_0x505268(_0x2108a6);});});}