Built motion from commit 67e5df37.|2.0.68
[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 _0xf1d4=['CmCustomField,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','result','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then'];(function(_0x32e4de,_0x7da1c5){var _0x51ba2a=function(_0x2a7322){while(--_0x2a7322){_0x32e4de['push'](_0x32e4de['shift']());}};_0x51ba2a(++_0x7da1c5);}(_0xf1d4,0x128));var _0x4f1d=function(_0x1f6af0,_0x1be98f){_0x1f6af0=_0x1f6af0-0x0;var _0x1f028b=_0xf1d4[_0x1f6af0];return _0x1f028b;};'use strict';var _=require(_0x4f1d('0x0'));var util=require(_0x4f1d('0x1'));var moment=require('moment');var BPromise=require(_0x4f1d('0x2'));var rs=require('randomstring');var fs=require('fs');var db=require(_0x4f1d('0x3'))['db'];var utils=require(_0x4f1d('0x4'));var logger=require(_0x4f1d('0x5'))('rpc');var config=require(_0x4f1d('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4f1d('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x593ff3,_0x40be82,_0x4b0dcf){return new BPromise(function(_0x2857a2,_0x2f6b6e){return client[_0x4f1d('0x8')](_0x593ff3,_0x4b0dcf)[_0x4f1d('0x9')](function(_0x61705c){logger['info'](_0x4f1d('0xa'),_0x40be82,'request\x20sent');logger[_0x4f1d('0xb')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x40be82,_0x4f1d('0xc'),JSON['stringify'](_0x61705c));if(_0x61705c[_0x4f1d('0xd')]){if(_0x61705c[_0x4f1d('0xd')][_0x4f1d('0xe')]===0x1f4){logger[_0x4f1d('0xd')]('CmCustomField,\x20%s,\x20%s',_0x40be82,_0x61705c[_0x4f1d('0xd')][_0x4f1d('0xf')]);return _0x2f6b6e(_0x61705c['error'][_0x4f1d('0xf')]);}logger[_0x4f1d('0xd')](_0x4f1d('0xa'),_0x40be82,_0x61705c[_0x4f1d('0xd')][_0x4f1d('0xf')]);return _0x2857a2(_0x61705c[_0x4f1d('0xd')][_0x4f1d('0xf')]);}else{logger[_0x4f1d('0x10')](_0x4f1d('0xa'),_0x40be82,_0x4f1d('0xc'));_0x2857a2(_0x61705c[_0x4f1d('0x11')][_0x4f1d('0xf')]);}})['catch'](function(_0x373567){logger[_0x4f1d('0xd')]('CmCustomField,\x20%s,\x20%s',_0x40be82,_0x373567);_0x2f6b6e(_0x373567);});});}