Built motion from commit c738b9ac.|2.6.25
[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 _0x7c4e=['jayson/promise','client','http','then','info','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','CmCustomField,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x3d5fdc,_0x12bdfc){var _0x2a0a34=function(_0x820b49){while(--_0x820b49){_0x3d5fdc['push'](_0x3d5fdc['shift']());}};_0x2a0a34(++_0x12bdfc);}(_0x7c4e,0x1af));var _0xe7c4=function(_0x5cb908,_0x10c23d){_0x5cb908=_0x5cb908-0x0;var _0x4d87b7=_0x7c4e[_0x5cb908];return _0x4d87b7;};'use strict';var _=require(_0xe7c4('0x0'));var util=require(_0xe7c4('0x1'));var moment=require('moment');var BPromise=require(_0xe7c4('0x2'));var rs=require(_0xe7c4('0x3'));var fs=require('fs');var Redis=require(_0xe7c4('0x4'));var db=require(_0xe7c4('0x5'))['db'];var utils=require(_0xe7c4('0x6'));var logger=require(_0xe7c4('0x7'))('rpc');var config=require(_0xe7c4('0x8'));var jayson=require(_0xe7c4('0x9'));var client=jayson[_0xe7c4('0xa')][_0xe7c4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e576c,_0x5e656d,_0x1b2d86){return new BPromise(function(_0xea7a24,_0x4825f8){return client['request'](_0x5e576c,_0x1b2d86)[_0xe7c4('0xc')](function(_0x30d594){logger[_0xe7c4('0xd')]('CmCustomField,\x20%s,\x20%s',_0x5e656d,'request\x20sent');logger['debug'](_0xe7c4('0xe'),_0x5e656d,_0xe7c4('0xf'),JSON[_0xe7c4('0x10')](_0x30d594));if(_0x30d594[_0xe7c4('0x11')]){if(_0x30d594[_0xe7c4('0x11')]['code']===0x1f4){logger[_0xe7c4('0x11')]('CmCustomField,\x20%s,\x20%s',_0x5e656d,_0x30d594[_0xe7c4('0x11')][_0xe7c4('0x12')]);return _0x4825f8(_0x30d594[_0xe7c4('0x11')][_0xe7c4('0x12')]);}logger[_0xe7c4('0x11')]('CmCustomField,\x20%s,\x20%s',_0x5e656d,_0x30d594[_0xe7c4('0x11')]['message']);return _0xea7a24(_0x30d594[_0xe7c4('0x11')][_0xe7c4('0x12')]);}else{logger[_0xe7c4('0xd')](_0xe7c4('0x13'),_0x5e656d,_0xe7c4('0xf'));_0xea7a24(_0x30d594[_0xe7c4('0x14')][_0xe7c4('0x12')]);}})[_0xe7c4('0x15')](function(_0xa8b490){logger[_0xe7c4('0x11')]('CmCustomField,\x20%s,\x20%s',_0x5e656d,_0xa8b490);_0x4825f8(_0xa8b490);});});}